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
d3750485
Commit
d3750485
authored
Mar 10, 2021
by
niklas.baumgarten
Browse files
removing more scalar and complex sequences
parent
65aa0464
Changes
4
Hide whitespace changes
Inline
Side-by-side
mlmc/src/generators/SampleGenerator.hpp
View file @
d3750485
...
...
@@ -4,7 +4,7 @@
#include "utility/Config.hpp"
#include "basics/Sample.hpp"
#include "mesh/Meshes.hpp"
#include "CVector.hpp"
typedef
std
::
complex
<
double
>
Complex
;
...
...
@@ -12,10 +12,6 @@ static double abs(const Complex &complex) {
return
sqrt
(
pow
(
complex
.
real
(),
2
)
+
pow
(
complex
.
imag
(),
2
));
}
typedef
std
::
vector
<
Scalar
>
ScalarSequence1D
;
typedef
std
::
vector
<
Complex
>
ComplexSequence1D
;
typedef
std
::
vector
<
std
::
vector
<
Complex
>>
ComplexSequence2D
;
typedef
std
::
vector
<
std
::
vector
<
Scalar
>>
ScalarSequence2D
;
...
...
@@ -121,7 +117,7 @@ public:
virtual
string
Name
()
const
override
{
return
"DummyGenerator"
;
};
};
class
ScalarSequence1DDummy
:
public
SampleGenerator
<
ScalarSequence1D
>
{
class
ScalarSequence1DDummy
:
public
SampleGenerator
<
RVector
>
{
public:
ScalarSequence1DDummy
(
Meshes
&
meshes
)
:
SampleGenerator
(
meshes
)
{}
...
...
@@ -132,7 +128,7 @@ public:
virtual
string
Name
()
const
override
{
return
"DummyGenerator"
;
};
};
class
ComplexSequence1DDummy
:
public
SampleGenerator
<
C
omplexSequence1D
>
{
class
ComplexSequence1DDummy
:
public
SampleGenerator
<
C
Vector
>
{
public:
ComplexSequence1DDummy
(
Meshes
&
meshes
)
:
SampleGenerator
(
meshes
)
{}
...
...
mlmc/src/generators/SampleGeneratorContainer.hpp
View file @
d3750485
...
...
@@ -24,9 +24,9 @@ public:
SampleGenerator
<
Tensor
>
*
tensorGenerator
;
SampleGenerator
<
ScalarSequence1D
>
*
scalarSequence1DGenerator
;
SampleGenerator
<
RVector
>
*
scalarSequence1DGenerator
;
SampleGenerator
<
C
omplexSequence1D
>
*
complexSequence1DGenerator
;
SampleGenerator
<
C
Vector
>
*
complexSequence1DGenerator
;
SampleGenerator
<
ScalarSequence2D
>
*
scalarSequence2DGenerator
;
...
...
mlmc/src/generators/algorithms/NormalDistribution.hpp
View file @
d3750485
...
...
@@ -73,11 +73,11 @@ public:
};
};
class
NormalDistributionScalarSequence1D
:
public
SampleGenerator
<
ScalarSequence1D
>
{
class
NormalDistributionScalarSequence1D
:
public
SampleGenerator
<
RVector
>
{
private:
NormalDistribution
normalDist
;
ScalarSequence1D
sample
;
RVector
sample
;
void
drawSample
(
const
SampleID
&
id
)
override
{
for
(
int
i
=
0
;
i
<
sample
.
size
();
i
++
)
{
...
...
@@ -95,7 +95,7 @@ public:
sample
.
resize
(
sizeN
);
}
ScalarSequence1D
EvalSample
()
override
{
RVector
EvalSample
()
override
{
return
sample
;
}
...
...
@@ -104,11 +104,11 @@ public:
};
};
class
NormalDistributionComplexSequence1D
:
public
SampleGenerator
<
C
omplexSequence1D
>
{
class
NormalDistributionComplexSequence1D
:
public
SampleGenerator
<
C
Vector
>
{
private:
ComplexNormalDistribution
normalDist
;
C
omplexSequence1D
sample
;
C
Vector
sample
;
void
drawSample
(
const
SampleID
&
id
)
override
{
for
(
int
i
=
0
;
i
<
sample
.
size
();
i
++
)
{
...
...
@@ -126,7 +126,7 @@ public:
sample
.
resize
(
sizeN
);
}
C
omplexSequence1D
EvalSample
()
override
{
C
Vector
EvalSample
()
override
{
return
sample
;
}
...
...
mlmc/tests/generators/TestCirculantEmbedding.cpp
View file @
d3750485
...
...
@@ -79,7 +79,7 @@ TEST_F(TestCirculantEmbedding1D, TestPaddingDummyExample) {
}
TEST_F
(
TestCirculantEmbedding1D
,
TestGenerateFieldf
)
{
C
omplexSequence1D
Xf
;
C
Vector
Xf
;
Xf
=
generator
->
generateField
(
SampleID
());
EXPECT_EQ
(
Xf
.
size
(),
2
*
(
*
meshes
)[
2
].
CellCount
()
-
1
);
}
...
...
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