diff --git a/MixtComp/src/lib/LinAlg/Iterator.h b/MixtComp/src/lib/LinAlg/Iterator.h index 4a400438f..ab26d0027 100644 --- a/MixtComp/src/lib/LinAlg/Iterator.h +++ b/MixtComp/src/lib/LinAlg/Iterator.h @@ -57,7 +57,7 @@ class Iterator { rows_(mat.rows()), p_mat_(&mat) {} - Iterator operator+(int i) { + Iterator operator+(int i) const { int posP, iP, jP; posP = pos(); posP += i; @@ -75,7 +75,7 @@ class Iterator { return *this; } - Iterator operator-(int i) { + Iterator operator-(int i) const { int posP, iP, jP; posP = pos(); posP -= i; @@ -83,9 +83,9 @@ class Iterator { return Iterator(iP, jP, *p_mat_); } - int operator-(const Iterator &it) { return pos() - it.pos(); } + int operator-(const Iterator &it) const { return pos() - it.pos(); } - bool operator<(const Iterator &it) { + bool operator<(const Iterator &it) const { if (j_ < it.j_) { return true; } else if (j_ > it.j_) { @@ -97,14 +97,14 @@ class Iterator { return false; } - bool operator==(const Iterator &it) { + bool operator==(const Iterator &it) const { if (i_ == it.i_ && j_ == it.j_) return true; else return false; } - bool operator>(const Iterator &it) { + bool operator>(const Iterator &it) const { if (j_ > it.j_) { return true; } else if (j_ > it.j_) { @@ -116,7 +116,7 @@ class Iterator { return false; } - bool operator>=(const Iterator &it) { + bool operator>=(const Iterator &it) const { if (!(*this < it)) { return true; } @@ -124,7 +124,7 @@ class Iterator { return false; } - bool operator!=(const Iterator &it) { + bool operator!=(const Iterator &it) const { if (i_ != it.i_ || j_ != it.j_) return true; else