The following code has 2 template functions in the same header. I would like to ask whether there is any problem with writing template<int N> before each one. Also is there a way of telling the compiler to assume all functions are template with only one line?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
//Summation Density
template<int N>
double Calc1(CVector vPos[N],double dMass[N], int iIndex, double rho[],double h){
usingnamespace std;
rho[iIndex] = 0;
for (int i = 0; i < N; i++){
rho[iIndex] += (dMass[i])*KrnlCS(vPos, iIndex, i, h);
}
return rho[iIndex];
}
//Summation Density (more accurate)
template<int N>
double Calc2(CVector vPos[N],double dMass[N], int iIndex, double rho[],double h){
usingnamespace std;
}
Also, I didn't know whether parallel programming comes under beginner or intermediate but I would like to implement my code on multiple nodes. I have a basic understanding in which cases I can use parallel programming, would like to learn more but first I would like someone more experienced to advise whether openMP is a decent package to use for this. And am I correct in saying that openMP is included in microsoft visual 2010 with no extra downloads?
Thank you for reading this, appreciate any advise.