diff --git a/common/fvector.hh b/common/fvector.hh index 0818cab2b3d93dac6aea52c6b1e03a8db9a5c0c6..88aa19a073d1d58af27e8fb5641e9f84b6f91d87 100644 --- a/common/fvector.hh +++ b/common/fvector.hh @@ -880,20 +880,6 @@ namespace Dune { } //===== vector space arithmetic - //! vector space addition - FieldVector& operator+= (const FieldVector& y) - { - p += y.p; - return *this; - } - - //! vector space subtraction - FieldVector& operator-= (const FieldVector& y) - { - p -= y.p; - return *this; - } - //! vector space add scalar to each comp FieldVector& operator+= (const K& k) { @@ -929,15 +915,11 @@ namespace Dune { return *this; } -#ifndef DUNE_EXPRESSIONTEMPLATES - //===== Euclidean scalar product - //! scalar product - inline K operator* ( const FieldVector &y ) const + inline K operator* ( const K & k ) const { - return p * y[ 0 ]; + return p * k; } -#endif //===== norms diff --git a/common/test/fvectortest.cc b/common/test/fvectortest.cc index 5e3e28a65a483597a0f79ad00b4847161032f864..6fe93d9ad2c3fdca79e25acabd3ba9d9210d84f0 100644 --- a/common/test/fvectortest.cc +++ b/common/test/fvectortest.cc @@ -67,6 +67,13 @@ public: v = a - v; v = a * v; v = a / v; + + v -= v; + v -= a; + v += v; + v += a; + v *= a; + v /= a; } };