Vector: switch read only functions to const (#108)

This commit is contained in:
Matthias Grob 2019-11-26 13:46:45 +01:00 committed by Julian Kent
parent a172c3cdac
commit de85dcff97

View File

@ -92,7 +92,7 @@ public:
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;
@ -104,8 +104,7 @@ public:
return unit();
}
bool longerThan(Type testVal)
{
bool longerThan(Type testVal) const {
return norm_squared() > testVal*testVal;
}