Permalink
Browse files

further simplifications for NormalizingIterator

  • Loading branch information...
gentryx committed Jun 29, 2018
1 parent fcf5862 commit 4515a87f5cde53369bdd79c61a2cd003a7975be5
Showing with 3 additions and 15 deletions.
  1. +3 −15 src/libgeodecomp/storage/displacedgrid.h
@@ -66,30 +66,18 @@ class NormalizingIterator : public RegionStreakIterator<TOPOLOGY::DIM, Region<TO
normalize();
}
inline const Streak<DIM>& operator*() const
{
return normalizedStreak;
}
inline const Streak<DIM> *operator->() const
{
return &normalizedStreak;
}
private:
// fixme: get rid of this, too?
Streak<DIM> normalizedStreak;
const Coord<DIM>& topoDimensions;
inline void normalize()
{
normalizedStreak = this->streak;
if (TOPOLOGICALLY_CORRECT) {
normalizedStreak.origin = TOPOLOGY::normalize(normalizedStreak.origin, topoDimensions);
int length = this->streak.length();
this->streak.origin = TOPOLOGY::normalize(this->streak.origin, topoDimensions);
this->streak.endX = this->streak.origin.x() + length;
}
normalizedStreak.endX = normalizedStreak.origin.x() + this->streak.length();
}
};

0 comments on commit 4515a87

Please sign in to comment.