Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mpp
MLUQ
Commits
ef8bd619
Commit
ef8bd619
authored
Mar 04, 2020
by
niklas.baumgarten
Browse files
refactored covariance function
parent
7783383e
Changes
2
Show whitespace changes
Inline
Side-by-side
mlmc/conf/mlmc_elliptic.conf
View file @
ef8bd619
...
...
@@ -39,7 +39,7 @@ MainVerbose = 1
MCVerbose
=
2
MLMCVerbose
=
2
PDEVerbose
=
1
GeneratorVerbose
=
0
GeneratorVerbose
=
1
GeneratorPlotting
=
4
MCPlotting
=
3
...
...
@@ -51,7 +51,7 @@ sigma = 1.0
norm_p
=
2
lambda1
=
0
.
15
lambda2
=
0
.
15
alpha
=
1
.
0
smoothing
=
1
.
0
evtol
=
1
e
-
10
# Other
...
...
mlmc/src/stochastics/CovarianceFunction.h
View file @
ef8bd619
...
...
@@ -3,18 +3,18 @@
class
CovarianceFunction
{
public:
double
sigma
;
int
norm_p
;
double
lambda1
;
double
lambda2
;
// Has no influence on 1D
double
alpha
;
double
sigma
=
1.0
;
int
norm_p
=
2
;
double
lambda1
=
0.15
;
double
lambda2
=
0.15
;
// Has no influence on 1D
double
smoothing
=
1.0
;
CovarianceFunction
()
{
ReadConfig
(
Settings
,
"sigma"
,
sigma
);
ReadConfig
(
Settings
,
"norm_p"
,
norm_p
);
ReadConfig
(
Settings
,
"lambda1"
,
lambda1
);
ReadConfig
(
Settings
,
"lambda2"
,
lambda2
);
ReadConfig
(
Settings
,
"alpha"
,
alpha
);
config
.
get
(
"sigma"
,
sigma
);
config
.
get
(
"norm_p"
,
norm_p
);
config
.
get
(
"lambda1"
,
lambda1
);
config
.
get
(
"lambda2"
,
lambda2
);
config
.
get
(
"smoothing"
,
smoothing
);
}
virtual
double
covariance_fct
(
double
*
tau
)
=
0
;
...
...
@@ -26,7 +26,7 @@ class CovarianceFunction1D : CovarianceFunction {
public:
double
covariance_fct
(
double
*
tau
)
override
{
tau
[
0
]
/=
lambda1
;
return
pow
(
sigma
,
2
)
*
exp
(
-
pow
(
norm
(
tau
),
alpha
));
return
pow
(
sigma
,
2
)
*
exp
(
-
pow
(
norm
(
tau
),
smoothing
));
}
double
norm
(
const
double
*
x
)
override
{
...
...
@@ -39,7 +39,7 @@ public:
double
covariance_fct
(
double
*
tau
)
override
{
tau
[
0
]
/=
lambda1
;
tau
[
1
]
/=
lambda2
;
return
pow
(
sigma
,
2
)
*
exp
(
-
pow
(
norm
(
tau
),
alpha
));
return
pow
(
sigma
,
2
)
*
exp
(
-
pow
(
norm
(
tau
),
smoothing
));
}
double
norm
(
const
double
*
x
)
override
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment