diff --git a/common/fvector.hh b/common/fvector.hh index b2d3c24ae3c9b89d8171e6d026882d47aeae908d..2bf1a0b84ef65f15df95143e9a0d383d335d0b00 100644 --- a/common/fvector.hh +++ b/common/fvector.hh @@ -579,6 +579,13 @@ namespace Dune { return true; } + //! Binary vector incomparison + bool operator!= (const FieldVector& y) const + { + return !operator==(y); + } + + //! vector space axpy operation ( *this += a y ) FieldVector& axpy (const K& a, const FieldVector& y) { diff --git a/common/test/fvectortest.cc b/common/test/fvectortest.cc index 0274ff118bbe8843c4cc792daa638ce2740a3b9c..715a5d93e507be296d679c46f68930fe79c25184 100644 --- a/common/test/fvectortest.cc +++ b/common/test/fvectortest.cc @@ -12,8 +12,8 @@ class FieldVectorMainTest { protected: FieldVectorMainTest() { - FieldVector<ct,1> v(1); - FieldVector<ct,1> w(2); + FieldVector<ct,d> v(1); + FieldVector<ct,d> w(2); bool b; (w+v).two_norm(); @@ -22,6 +22,7 @@ protected: b = (w != v); b = (w == v); + w=v; } }; @@ -40,9 +41,11 @@ public: { ct a = 1; FieldVector<ct,1> v(2); + FieldVector<ct,1> w(2); bool b; v = a; + v = w = v; a = v; b = (v == a);