From: Alex Schmidt Date: Wed, 18 Jul 2012 13:11:05 +0000 (+0200) Subject: ... X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/commitdiff_plain/41027e824fcefd168dc0c8a8db1a1b89482c272a ... --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 586117c..5b5abad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ project(latlib) -add_library(configcache configcache.cpp) -target_link_libraries(configcache boost_iostreams) +add_library(lat_configcache configcache.cpp) +target_link_libraries(lat_configcache boost_iostreams) -add_library(neigh neigh.cpp) +add_library(lat_neigh neigh.cpp) -add_library(writeout writeout.cpp) \ No newline at end of file +add_library(lat_writeout writeout.cpp) diff --git a/neigh.cpp b/neigh.cpp index a25d1e7..8e4084c 100644 --- a/neigh.cpp +++ b/neigh.cpp @@ -1,28 +1,44 @@ #include "neigh.h" -neigh::neigh(const int& dimension, const int& length) +#include + +using namespace std; + +int neigh::dirstep(int dir) { - nfield = new int[ipow(dimension,length)*2*dimension]; + int step=1; + for(int idir=0; idir + class neigh { private: + int *len; int *nfield; + int dirstep(int dir); static int ipow(const int& x, const int& p){ if (p == 0) return 1; if (p == 1) return x; return x * ipow(x, p-1); } public: - neigh(const int& length, const int& dimension); + neigh(const int& dimension, ...); int& operator[] (int i) {return nfield[i];} };