Browse Source

Vector: added norm_squared() because sometimes you can safe the sqrt operation

master
Matthias Grob 7 years ago
parent
commit
5130da206a
  1. 5
      matrix/Vector.hpp

5
matrix/Vector.hpp

@ -71,6 +71,11 @@ public: @@ -71,6 +71,11 @@ public:
return Type(sqrt(a.dot(a)));
}
Type norm_squared() const {
const Vector &a(*this);
return Type(a.dot(a));
}
inline Type length() const {
return norm();
}

Loading…
Cancel
Save