diff --git a/include/Geometry/vector_gen.h b/include/Geometry/vector_gen.h index f86dfd195e61a168cd8121d52c93111b6e8b7fb5..632b33ff906da60f82eec84d9821d2df0025f159 100644 --- a/include/Geometry/vector_gen.h +++ b/include/Geometry/vector_gen.h @@ -132,6 +132,9 @@ public: // Equal bool operator==(const Vector& v) const ; + // Different + bool operator!=(const Vector& v) const ; + bool hasNan() const ; /**********************************************/ diff --git a/include/Geometry/vector_gen.hpp b/include/Geometry/vector_gen.hpp index a7f1275158673c46246141e6037d634ec66533a2..8d714c3db117793d3fc787f6aca675714bd73d1b 100644 --- a/include/Geometry/vector_gen.hpp +++ b/include/Geometry/vector_gen.hpp @@ -277,6 +277,15 @@ inline bool Vector::operator==(const Vector& v) const return true ; } +template +inline bool Vector::operator!=(const Vector& v) const +{ + for(unsigned int i = 0 ; i < DIM ; ++i) + if(v[i] != m_data[i]) + return true ; + return false ; +} + template inline bool Vector::hasNan() const { @@ -314,7 +323,6 @@ inline Vector operator*(T a, const Vector& v) return v * a ; } - template inline Vector operator/(T a, const Vector& v) { @@ -346,7 +354,6 @@ inline Vector slerp(const Vector &v1, const Vector &v2, con return res ; } - } // namespace Geom } // namespace CGoGN