Commit 46bdf277 authored by Pierre Kraemer's avatar Pierre Kraemer

operator!= on vectors

parent 49e1fa24
...@@ -132,6 +132,9 @@ public: ...@@ -132,6 +132,9 @@ public:
// Equal // Equal
bool operator==(const Vector<DIM,T>& v) const ; bool operator==(const Vector<DIM,T>& v) const ;
// Different
bool operator!=(const Vector<DIM,T>& v) const ;
bool hasNan() const ; bool hasNan() const ;
/**********************************************/ /**********************************************/
......
...@@ -277,6 +277,15 @@ inline bool Vector<DIM,T>::operator==(const Vector<DIM,T>& v) const ...@@ -277,6 +277,15 @@ inline bool Vector<DIM,T>::operator==(const Vector<DIM,T>& v) const
return true ; return true ;
} }
template <unsigned int DIM, typename T>
inline bool Vector<DIM,T>::operator!=(const Vector<DIM,T>& v) const
{
for(unsigned int i = 0 ; i < DIM ; ++i)
if(v[i] != m_data[i])
return true ;
return false ;
}
template <unsigned int DIM, typename T> template <unsigned int DIM, typename T>
inline bool Vector<DIM,T>::hasNan() const inline bool Vector<DIM,T>::hasNan() const
{ {
...@@ -314,7 +323,6 @@ inline Vector<DIM,T> operator*(T a, const Vector<DIM,T>& v) ...@@ -314,7 +323,6 @@ inline Vector<DIM,T> operator*(T a, const Vector<DIM,T>& v)
return v * a ; return v * a ;
} }
template <unsigned int DIM, typename T> template <unsigned int DIM, typename T>
inline Vector<DIM,T> operator/(T a, const Vector<DIM,T>& v) inline Vector<DIM,T> operator/(T a, const Vector<DIM,T>& v)
{ {
...@@ -346,7 +354,6 @@ inline Vector<DIM,T> slerp(const Vector<DIM,T> &v1, const Vector<DIM,T> &v2, con ...@@ -346,7 +354,6 @@ inline Vector<DIM,T> slerp(const Vector<DIM,T> &v1, const Vector<DIM,T> &v2, con
return res ; return res ;
} }
} // namespace Geom } // namespace Geom
} // namespace CGoGN } // namespace CGoGN
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment