operator!= for nested types
This commit is contained in:
parent
cc65575536
commit
9ce8e74e19
5
vec.cc
5
vec.cc
@ -969,10 +969,15 @@ return m;\
|
|||||||
|
|
||||||
|
|
||||||
INSTANTIZE_NONCOMPLEX(char)
|
INSTANTIZE_NONCOMPLEX(char)
|
||||||
|
INSTANTIZE_NONCOMPLEX(unsigned char)
|
||||||
INSTANTIZE_NONCOMPLEX(short)
|
INSTANTIZE_NONCOMPLEX(short)
|
||||||
|
INSTANTIZE_NONCOMPLEX(unsigned short)
|
||||||
INSTANTIZE_NONCOMPLEX(int)
|
INSTANTIZE_NONCOMPLEX(int)
|
||||||
|
INSTANTIZE_NONCOMPLEX(unsigned int)
|
||||||
INSTANTIZE_NONCOMPLEX(long)
|
INSTANTIZE_NONCOMPLEX(long)
|
||||||
|
INSTANTIZE_NONCOMPLEX(unsigned long)
|
||||||
INSTANTIZE_NONCOMPLEX(long long)
|
INSTANTIZE_NONCOMPLEX(long long)
|
||||||
|
INSTANTIZE_NONCOMPLEX(unsigned long long)
|
||||||
INSTANTIZE_NONCOMPLEX(float)
|
INSTANTIZE_NONCOMPLEX(float)
|
||||||
INSTANTIZE_NONCOMPLEX(double)
|
INSTANTIZE_NONCOMPLEX(double)
|
||||||
|
|
||||||
|
11
vec.h
11
vec.h
@ -170,7 +170,16 @@ public:
|
|||||||
NRVec& operator|=(const NRVec &rhs);
|
NRVec& operator|=(const NRVec &rhs);
|
||||||
|
|
||||||
//! relational operators
|
//! relational operators
|
||||||
const bool operator!=(const NRVec &rhs) const {if(nn!=rhs.nn) return 1; return LA_traits<T>::gencmp(v,rhs.v,nn);}
|
const bool operator!=(const NRVec &rhs) const
|
||||||
|
{
|
||||||
|
if(nn!=rhs.nn) return 1;
|
||||||
|
if(LA_traits<T>::is_plaindata()) return LA_traits<T>::gencmp(v,rhs.v,nn);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for(int i=0; i<nn; ++i) if(v[i]!=rhs.v[i]) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
const bool operator==(const NRVec &rhs) const {return !(*this != rhs);};
|
const bool operator==(const NRVec &rhs) const {return !(*this != rhs);};
|
||||||
const bool operator>(const NRVec &rhs) const;
|
const bool operator>(const NRVec &rhs) const;
|
||||||
const bool operator<(const NRVec &rhs) const;
|
const bool operator<(const NRVec &rhs) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user