From 191859892ec370edb10543069d017583083f98f4 Mon Sep 17 00:00:00 2001 From: Christian Engwer <christi@dune-project.org> Date: Wed, 13 Oct 2010 18:51:18 +0000 Subject: [PATCH] get rid of the "K" [[Imported from SVN: r6180]] --- dune/common/densevector.hh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/dune/common/densevector.hh b/dune/common/densevector.hh index 010a61b7d..c760745a3 100644 --- a/dune/common/densevector.hh +++ b/dune/common/densevector.hh @@ -220,7 +220,7 @@ namespace Dune { class DenseVector { typedef DenseMatVecTraits<V> Traits; - typedef typename Traits::value_type K; + // typedef typename Traits::value_type K; // Curiously recuring template pattern V & asImp() { return static_cast<V&>(*this); } @@ -252,7 +252,7 @@ namespace Dune { //===== assignment from scalar //! Assignment operator for scalar - derived_type& operator= (const K& k) + derived_type& operator= (const value_type& k) { for (size_type i=0; i<size(); i++) (*this)[i] = k; @@ -399,7 +399,7 @@ namespace Dune { } //! vector space multiplication with scalar - derived_type& operator*= (const K& k) + derived_type& operator*= (const value_type& k) { for (size_type i=0; i<size(); i++) (*this)[i] *= k; @@ -407,7 +407,7 @@ namespace Dune { } //! vector space division by scalar - derived_type& operator/= (const K& k) + derived_type& operator/= (const value_type& k) { for (size_type i=0; i<size(); i++) (*this)[i] /= k; @@ -433,7 +433,7 @@ namespace Dune { //! vector space axpy operation ( *this += a y ) - derived_type& axpy (const K& a, const DenseVector& y) + derived_type& axpy (const value_type& a, const DenseVector& y) { assert(y.size() == size()); for (size_type i=0; i<size(); i++) @@ -456,8 +456,8 @@ namespace Dune { //===== norms //! one norm (sum over absolute values of entries) - typename FieldTraits<K>::real_type one_norm() const { - typename FieldTraits<K>::real_type result = 0; + typename FieldTraits<value_type>::real_type one_norm() const { + typename FieldTraits<value_type>::real_type result = 0; for (size_type i=0; i<size(); i++) result += std::abs((*this)[i]); return result; @@ -465,45 +465,45 @@ namespace Dune { //! simplified one norm (uses Manhattan norm for complex values) - typename FieldTraits<K>::real_type one_norm_real () const + typename FieldTraits<value_type>::real_type one_norm_real () const { - typename FieldTraits<K>::real_type result = 0; + typename FieldTraits<value_type>::real_type result = 0; for (size_type i=0; i<size(); i++) result += fvmeta::absreal((*this)[i]); return result; } //! two norm sqrt(sum over squared values of entries) - typename FieldTraits<K>::real_type two_norm () const + typename FieldTraits<value_type>::real_type two_norm () const { - typename FieldTraits<K>::real_type result = 0; + typename FieldTraits<value_type>::real_type result = 0; for (size_type i=0; i<size(); i++) result += fvmeta::abs2((*this)[i]); return fvmeta::sqrt(result); } //! square of two norm (sum over squared values of entries), need for block recursion - typename FieldTraits<K>::real_type two_norm2 () const + typename FieldTraits<value_type>::real_type two_norm2 () const { - typename FieldTraits<K>::real_type result = 0; + typename FieldTraits<value_type>::real_type result = 0; for (size_type i=0; i<size(); i++) result += fvmeta::abs2((*this)[i]); return result; } //! infinity norm (maximum of absolute values of entries) - typename FieldTraits<K>::real_type infinity_norm () const + typename FieldTraits<value_type>::real_type infinity_norm () const { - typename FieldTraits<K>::real_type result = 0; + typename FieldTraits<value_type>::real_type result = 0; for (size_type i=0; i<size(); i++) result = std::max(result, std::abs((*this)[i])); return result; } //! simplified infinity norm (uses Manhattan norm for complex values) - typename FieldTraits<K>::real_type infinity_norm_real () const + typename FieldTraits<value_type>::real_type infinity_norm_real () const { - typename FieldTraits<K>::real_type result = 0; + typename FieldTraits<value_type>::real_type result = 0; for (size_type i=0; i<size(); i++) result = std::max(result, fvmeta::absreal((*this)[i])); return result; -- GitLab