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

[Matrix]

use FieldTraits to determin the return type of the norm methods
parent 46cf5787
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@
#include <memory>
#include <dune/istl/vbvector.hh>
#include <dune/common/ftraits.hh>
namespace Dune {
......@@ -485,13 +486,13 @@ 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 std::sqrt(frobenius_norm2());
}
//! square of frobenius norm, need for block recursion
double frobenius_norm2 () const
typename FieldTraits<field_type>::real_type frobenius_norm2 () const
{
double sum=0;
for (size_type i=0; i<N(); ++i)
......@@ -501,7 +502,7 @@ namespace Dune {
}
//! infinity norm (row sum norm, how to generalize for blocks?)
double infinity_norm () const
typename FieldTraits<field_type>::real_type infinity_norm () const
{
double max=0;
for (size_type i=0; i<N(); ++i) {
......@@ -514,7 +515,7 @@ namespace Dune {
}
//! simplified infinity norm (uses Manhattan norm for complex values)
double infinity_norm_real () const
typename FieldTraits<field_type>::real_type infinity_norm_real () const
{
double max=0;
for (size_type i=0; i<N(); ++i) {
......
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