]> git.treefish.org Git - phys/latlib.git/blobdiff - neigh.h
...
[phys/latlib.git] / neigh.h
diff --git a/neigh.h b/neigh.h
new file mode 100644 (file)
index 0000000..73ffe62
--- /dev/null
+++ b/neigh.h
@@ -0,0 +1,18 @@
+#ifndef NEIGH_H
+#define NEIGH_H
+
+class neigh
+{
+ private:
+  int *nfield;
+  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);
+  int& operator[] (int i) {return nfield[i];}
+};
+
+#endif