diff --git a/matrix.cpp b/matrix.cpp index 61b54950..0a51a4fb 100644 --- a/matrix.cpp +++ b/matrix.cpp @@ -249,8 +249,8 @@ matrix::is_magic (void) const { unsigned int sum1 = 0, sum2 = 0; for (unsigned int j = 0; j < m_columns; ++j) { - if (!numbers.includes ((*this)[i][j]) || - !numbers.includes ((*this)[j][i])) + if (!numbers.contains ((*this)[i][j]) || + !numbers.contains ((*this)[j][i])) return false; sum1 += (*this)[i][j]; diff --git a/range.cpp b/range.cpp index 0e83e68b..035dbea1 100644 --- a/range.cpp +++ b/range.cpp @@ -43,13 +43,13 @@ range::range (T _min, T _max): template bool -range::includes (T val) const +range::contains (T val) const { return val >= min && val <= max; } template bool -range::includes (const range &r) const +range::contains (const range &r) const { return r.min >= min && r.max <= max; } diff --git a/range.hpp b/range.hpp index 262d024e..baf882a1 100644 --- a/range.hpp +++ b/range.hpp @@ -37,9 +37,11 @@ struct range { range (T _min, T _max); /// Check whether value falls within this range (inclusive) - bool includes (T val) const; + bool contains (T val) const; /// Check whether a range falls completely within (inclusive) this range - bool includes (const range &r) const; + bool contains (const range &r) const; + /// Check whether a range falls partially within (inclusive) this range + //bool includes (const range &r) const; /// Return the closest number that falls within the range. T clamp (T val) const;