removed gridSize from the template arguments

- not needed and code much cleaner
some minor changes
new test-cases
This commit is contained in:
2016-01-25 15:53:12 +01:00
parent 9947dced15
commit 5aedce47f1
16 changed files with 167 additions and 66 deletions

View File

@@ -8,7 +8,7 @@ class NeighborIter : std::iterator<std::input_iterator_tag, int> {
private:
/** the grid the src-node belongs to */
Grid<gridSize_cm, T>* grid;
Grid<T>* grid;
/** index of the source-node within its grid */
int srcNodeIdx;
@@ -19,8 +19,8 @@ private:
public:
/** ctor */
NeighborIter(const Grid<gridSize_cm, T>& grid, const int srcNodeIdx, const int nIdx) :
grid((Grid<gridSize_cm, T>*)&grid), srcNodeIdx(srcNodeIdx), nIdx(nIdx) {;}
NeighborIter(const Grid<T>& grid, const int srcNodeIdx, const int nIdx) :
grid((Grid<T>*)&grid), srcNodeIdx(srcNodeIdx), nIdx(nIdx) {;}
/** next neighbor */
NeighborIter& operator++() {++nIdx; return *this;}
@@ -44,7 +44,7 @@ class NeighborForEach {
private:
/** the grid the src-node belongs to */
const Grid<gridSize_cm, T>& grid;
const Grid<T>& grid;
/** index of the source-node within its grid */
const int srcNodeIdx;
@@ -52,7 +52,7 @@ private:
public:
/** ctor */
NeighborForEach(const Grid<gridSize_cm, T>& grid, const int srcNodeIdx) :
NeighborForEach(const Grid<T>& grid, const int srcNodeIdx) :
grid(grid), srcNodeIdx(srcNodeIdx) {;}
/** starting point */