From 9ce8e74e19c5e23e18a53a78c5713f22a1b78cd3 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Thu, 24 Jun 2021 17:08:55 +0200 Subject: [PATCH] operator!= for nested types --- vec.cc | 5 +++++ vec.h | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/vec.cc b/vec.cc index 9713039..6425bbd 100644 --- a/vec.cc +++ b/vec.cc @@ -969,10 +969,15 @@ return m;\ INSTANTIZE_NONCOMPLEX(char) +INSTANTIZE_NONCOMPLEX(unsigned char) INSTANTIZE_NONCOMPLEX(short) +INSTANTIZE_NONCOMPLEX(unsigned short) INSTANTIZE_NONCOMPLEX(int) +INSTANTIZE_NONCOMPLEX(unsigned int) INSTANTIZE_NONCOMPLEX(long) +INSTANTIZE_NONCOMPLEX(unsigned long) INSTANTIZE_NONCOMPLEX(long long) +INSTANTIZE_NONCOMPLEX(unsigned long long) INSTANTIZE_NONCOMPLEX(float) INSTANTIZE_NONCOMPLEX(double) diff --git a/vec.h b/vec.h index 70e0651..9f61b93 100644 --- a/vec.h +++ b/vec.h @@ -170,7 +170,16 @@ public: NRVec& operator|=(const NRVec &rhs); //! relational operators - const bool operator!=(const NRVec &rhs) const {if(nn!=rhs.nn) return 1; return LA_traits::gencmp(v,rhs.v,nn);} + const bool operator!=(const NRVec &rhs) const + { + if(nn!=rhs.nn) return 1; + if(LA_traits::is_plaindata()) return LA_traits::gencmp(v,rhs.v,nn); + else + { + for(int i=0; i(const NRVec &rhs) const; const bool operator<(const NRVec &rhs) const;