Skip to content
Snippets Groups Projects
Commit 19c8ba47 authored by Christian Engwer's avatar Christian Engwer
Browse files

[ScaledIDMatrix]

use FieldTraits to determin the return type of the norm methods
parent 344431d2
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
#include <dune/common/exceptions.hh>
#include <dune/common/fmatrix.hh>
#include <dune/common/diagonalmatrix.hh>
#include <dune/common/ftraits.hh>
namespace Dune {
......@@ -344,25 +345,25 @@ namespace Dune {
//===== norms
//! frobenius norm: sqrt(sum over squared values of entries)
double frobenius_norm () const
typename FieldTraits<field_type>::real_type frobenius_norm () const
{
return fvmeta::sqrt(n*p_*p_);
}
//! square of frobenius norm, need for block recursion
double frobenius_norm2 () const
typename FieldTraits<field_type>::real_type frobenius_norm2 () const
{
return n*p_*p_;
}
//! infinity norm (row sum norm, how to generalize for blocks?)
double infinity_norm () const
typename FieldTraits<field_type>::real_type infinity_norm () const
{
return std::abs(p_);
}
//! simplified infinity norm (uses Manhattan norm for complex values)
double infinity_norm_real () const
typename FieldTraits<field_type>::real_type infinity_norm_real () const
{
return fvmeta::absreal(p_);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment