P
Philipp
Hello, I've got a class Lattice which is declared like that:
// file: lattice.h
class Latticeublic EventChooser{
public:
Lattice(LatticeParameters* params);
virtual ~Lattice();
// (...snip...)
private:
// How do I declare this member array in the lattice.h file?
// The following doesn't seem to work
LatticeSite** lattice; // does not compile
};
// file: lattice.cpp
Lattice::Lattice(LatticeParameters* params){
// Initializing 3D lattice
LatticeSite lattice[Ni][Nj][Nk];
for(int i=0; i<Ni; i++)
for(int j=0; j<Nj; j++)
for(int k=0; k<Nk; k++)
lattice[j][k].setValues(i,j,k,0);
}
The class LatticeSite has a default constructor.
So I don't know how to declare "lattice" which is an array of LatticeSite
objects in the file lattice.h.
Any ideas? Thanks Phil
// file: lattice.h
class Latticeublic EventChooser{
public:
Lattice(LatticeParameters* params);
virtual ~Lattice();
// (...snip...)
private:
// How do I declare this member array in the lattice.h file?
// The following doesn't seem to work
LatticeSite** lattice; // does not compile
};
// file: lattice.cpp
Lattice::Lattice(LatticeParameters* params){
// Initializing 3D lattice
LatticeSite lattice[Ni][Nj][Nk];
for(int i=0; i<Ni; i++)
for(int j=0; j<Nj; j++)
for(int k=0; k<Nk; k++)
lattice[j][k].setValues(i,j,k,0);
}
The class LatticeSite has a default constructor.
So I don't know how to declare "lattice" which is an array of LatticeSite
objects in the file lattice.h.
Any ideas? Thanks Phil