Skip to content

Commit

Permalink
Vector: switch read only functions to const (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR authored and Julian Kent committed Nov 26, 2019
1 parent a172c3c commit de85dcf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions matrix/Vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Vector : public Matrix<Type, M, 1>
return (*this) / norm();
}

Vector unit_or_zero(const Type eps = Type(1e-5)) {
Vector unit_or_zero(const Type eps = Type(1e-5)) const {
const Type n = norm();
if (n > eps) {
return (*this) / n;
Expand All @@ -104,8 +104,7 @@ class Vector : public Matrix<Type, M, 1>
return unit();
}

bool longerThan(Type testVal)
{
bool longerThan(Type testVal) const {
return norm_squared() > testVal*testVal;
}

Expand Down

0 comments on commit de85dcf

Please sign in to comment.