Dune Core Modules (2.4.1)

precision.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_PRECISION_HH
4#define DUNE_PRECISION_HH
5
10#include <stdlib.h>
11
12namespace Dune {
13
22 template <class ctype = double>
24 public:
26 static ctype pivoting_limit ()
27 {
28 return _pivoting;
29 }
30
32 static void set_pivoting_limit (ctype pivthres)
33 {
34 _pivoting = pivthres;
35 }
36
38 static ctype singular_limit ()
39 {
40 return _singular;
41 }
42
44 static void set_singular_limit (ctype singthres)
45 {
46 _singular = singthres;
47 }
48
50 static ctype absolute_limit ()
51 {
52 return _absolute;
53 }
54
56 static void set_absolute_limit (ctype absthres)
57 {
58 _absolute = absthres;
59 }
60
61 private:
62 // just to demonstrate some state information
63 static ctype _pivoting;
64 static ctype _singular;
65 static ctype _absolute;
66 };
67
68 template <class ctype>
69 ctype FMatrixPrecision<ctype>::_pivoting = 1E-8;
70 template <class ctype>
71 ctype FMatrixPrecision<ctype>::_singular = 1E-14;
72 template <class ctype>
73 ctype FMatrixPrecision<ctype>::_absolute = 1E-80;
74
77} // end namespace
78
79#endif
Precisions for calculations with FieldMatrix and FieldVector.
Definition: precision.hh:23
static ctype pivoting_limit()
return threshold to do pivoting
Definition: precision.hh:26
static ctype absolute_limit()
return threshold to declare matrix singular
Definition: precision.hh:50
static void set_singular_limit(ctype singthres)
set singular threshold
Definition: precision.hh:44
static ctype singular_limit()
return threshold to declare matrix singular
Definition: precision.hh:38
static void set_pivoting_limit(ctype pivthres)
set pivoting threshold
Definition: precision.hh:32
static void set_absolute_limit(ctype absthres)
set singular threshold
Definition: precision.hh:56
Dune namespace.
Definition: alignment.hh:10
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)