KASKADE 7 development version
lipschitzConstants.hh
Go to the documentation of this file.
1#ifndef LIPSCHITZCONSTANTS_HH
2#define LIPSCHITZCONSTANTS_HH
3
4namespace Dune
5{
6 template <class,int> class FieldVector;
7 template <class,class> class Matrix;
8}
9
10namespace Kaskade
11{
13 {
14 explicit LagrangianD2LipschitzConstant(int verbose_, double initialOmega = 1e-3);
15
18
19 void setFirstOrder(double norm_dx_, double thetaC_, double modelError_);
20
21 void setSecondOrder(double secondOrderEstimate_=0.0);
22
24 void update(bool doLock);
25
27 bool highRoundOffError(bool hasNormalDirection, double epsilon);
28
29 void setL_xx(double m);
30
31 void print() const;
32
33 bool isPositiveDefinite() const;
34
35 double omega = 1e-3; // new robust value for omega
36 double oldOmega = 1e-3; // last value for omega
37
38 private:
39 double lowFactor = 1e-4; // factor of maximal decrease of omega between two steps
40 double highFactor = 1e3; // factor of maximal increase of omega between two steps
41 double modelError = 0; // Model Error: difference between second order model and function
42 double norm_dx = 1; // norm of correction
43 double thetaC = 0; // contraction for normal step
44 bool lock = false;
45 int verbose = 0;
46 double secondOrderEstimate = 0;
47 bool secondOrderUsed = false; // false: third order estimate (round-off errors may be large) true: second order estimate
48 double L_xx=1;
49 bool firstEstimate = true;
50 };
51
53 {
54 explicit ConstraintD1LipschitzConstant(int verbose_, double initialOmega = 1e-3);
55
56 void update(double newOmega, bool lock = false);
57
58 double omega = 1e-3, oldOmega = 1e-3, theta = 0;
59
60 private:
61 double lowFactor = 1e-3, highFactor = 1e3;
62 int verbose = 0;
63 bool firstEstimate = true;
64 };
65}
66
67#endif // LIPSCHITZCONSTANTS_HH
void update(double newOmega, bool lock=false)
ConstraintD1LipschitzConstant(int verbose_, double initialOmega=1e-3)
LagrangianD2LipschitzConstant & operator=(LagrangianD2LipschitzConstant const &)=default
void setSecondOrder(double secondOrderEstimate_=0.0)
void setFirstOrder(double norm_dx_, double thetaC_, double modelError_)
LagrangianD2LipschitzConstant(int verbose_, double initialOmega=1e-3)
void update(bool doLock)
compute robust value for omegaL
bool highRoundOffError(bool hasNormalDirection, double epsilon)
decide whether their might be high round off error
LagrangianD2LipschitzConstant(LagrangianD2LipschitzConstant const &)=default