removed gridSize from the template arguments
- not needed and code much cleaner some minor changes new test-cases
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user