From a41af436891cd1575e9c70f1b3b552ad89facc55 Mon Sep 17 00:00:00 2001 From: Uli Sack <usack@math.fu-berlin.de> Date: Fri, 13 Sep 2013 11:56:41 +0000 Subject: [PATCH] tabs->spaces, fix include guard, add editor hints [[Imported from SVN: r12071]] --- dune/solvers/norms/sumnorm.hh | 76 ++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/dune/solvers/norms/sumnorm.hh b/dune/solvers/norms/sumnorm.hh index b0a8167e..1fd9fdfa 100644 --- a/dune/solvers/norms/sumnorm.hh +++ b/dune/solvers/norms/sumnorm.hh @@ -1,5 +1,7 @@ -#ifndef __SUMNORM__HH__ -#define __SUMNORM__HH__ +// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +#ifndef SUMNORM_HH +#define SUMNORM_HH #include <cmath> @@ -8,40 +10,40 @@ template <class VectorType> class SumNorm: public Norm<VectorType> { - public: - SumNorm(double _alpha1, const Norm<VectorType> &_norm1, double _alpha2, const Norm<VectorType> &_norm2) : - alpha1(_alpha1), - norm1(_norm1), - alpha2(_alpha2), - norm2(_norm2) - {} - - //! Compute the norm of the given vector - double operator()(const VectorType &v) const - { - double r1 = norm1.normSquared(v); - double r2 = norm2.normSquared(v); - - return std::sqrt(alpha1 * r1 + alpha2 * r2); - } - - //! Compute the norm of the difference of two vectors - double diff(const VectorType &v1, const VectorType &v2) const - { - double r1 = norm1.diff(v1,v2); - double r2 = norm2.diff(v1,v2); - - return std::sqrt(alpha1 * r1 * r1 + alpha2 * r2 *r2); - } - - private: - const double alpha1; - const Norm<VectorType> &norm1; - - const double alpha2; - const Norm<VectorType> &norm2; - - + public: + SumNorm(double _alpha1, const Norm<VectorType> &_norm1, double _alpha2, const Norm<VectorType> &_norm2) : + alpha1(_alpha1), + norm1(_norm1), + alpha2(_alpha2), + norm2(_norm2) + {} + + //! Compute the norm of the given vector + double operator()(const VectorType &v) const + { + double r1 = norm1.normSquared(v); + double r2 = norm2.normSquared(v); + + return std::sqrt(alpha1 * r1 + alpha2 * r2); + } + + //! Compute the norm of the difference of two vectors + double diff(const VectorType &v1, const VectorType &v2) const + { + double r1 = norm1.diff(v1,v2); + double r2 = norm2.diff(v1,v2); + + return std::sqrt(alpha1 * r1 * r1 + alpha2 * r2 *r2); + } + + private: + const double alpha1; + const Norm<VectorType> &norm1; + + const double alpha2; + const Norm<VectorType> &norm2; + + }; -#endif +#endif -- GitLab