Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mpp
MLUQ
Commits
9793ff71
Commit
9793ff71
authored
Sep 26, 2020
by
niklas.baumgarten
Browse files
refactored SampleID and introduced SampleSolution
parent
6fcedb17
Changes
1
Hide whitespace changes
Inline
Side-by-side
mlmc/src/utility/SampleID.hpp
View file @
9793ff71
#ifndef SAMPLEID_HPP
#define SAMPLEID_HPP
#include
"Algebra.h"
#include
<string>
struct
SampleID
{
int
level
=
-
1
;
int
m
=
-
1
;
bool
coarse
=
false
;
SampleID
()
=
default
;
SampleID
(
int
level
,
int
m
,
int
coarse
)
:
level
(
level
),
m
(
m
),
coarse
(
coarse
)
{}
int
level
;
int
number
;
bool
coarse
;
std
::
string
Str
()
const
{
return
"l:"
+
std
::
to_string
(
level
)
+
"-m:"
+
std
::
to_string
(
m
)
+
"-m:"
+
std
::
to_string
(
number
)
+
"-c:"
+
std
::
to_string
((
int
)
coarse
);
}
};
struct
SampleSolution
{
SampleID
id
;
int
mGraphLevel
;
double
Q
;
double
Cost
;
Vector
U
;
SampleSolution
(
MatrixGraphs
&
solMGraphs
,
int
mGraphLevel
)
:
U
(
Vector
(
solMGraphs
[
mGraphLevel
]))
{
Init
();
}
void
Init
()
{
Q
=
0.0
;
Cost
=
0.0
;
U
=
0.0
;
}
};
#endif //SAMPLEID_HPP
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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