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
58d40f7f
Commit
58d40f7f
authored
Sep 23, 2020
by
niklas.baumgarten
Browse files
adapted utils
parent
e38cf85f
Changes
2
Hide whitespace changes
Inline
Side-by-side
mlmc/src/main/Utils.cpp
View file @
58d40f7f
...
...
@@ -60,7 +60,7 @@ void fft(vector<complex<double>> &in, vector<complex<double>> &out) {
}
}
void
fft
(
vector
<
double
>
&
in
,
vector
<
double
>
&
out
)
{
void
fft
(
const
vector
<
double
>
&
in
,
vector
<
double
>
&
out
)
{
int
N
=
in
.
size
();
vector
<
complex
<
double
>>
in_complex
;
vector
<
complex
<
double
>>
out_complex
;
...
...
@@ -107,7 +107,7 @@ void fft2(const vector<vector<complex<double>>> &in,
delete
[]
out_arr
;
}
void
fft2
(
vector
<
vector
<
double
>>
&
in
,
vector
<
vector
<
double
>>
&
out
)
{
void
fft2
(
const
vector
<
vector
<
double
>>
&
in
,
vector
<
vector
<
double
>>
&
out
)
{
int
N2
=
in
.
size
();
int
N1
=
in
[
0
].
size
();
vector
<
vector
<
complex
<
double
>>>
in_complex
;
...
...
mlmc/src/main/Utils.hpp
View file @
58d40f7f
...
...
@@ -7,26 +7,27 @@
#include <complex>
#include <fftw3.h>
std
::
pair
<
double
,
double
>
linear_fit
(
std
::
vector
<
double
>
&
x
,
std
::
vector
<
double
>
&
y
);
std
::
vector
<
double
>
linspace
(
const
double
&
start
,
const
double
&
end
,
int
num
);
std
::
vector
<
double
>
linspace
(
const
double
&
start
,
const
double
&
end
,
int
num
);
void
fft
(
int
N
,
fftw_complex
*
in
,
fftw_complex
*
out
);
void
fft
(
std
::
vector
<
std
::
complex
<
double
>>
&
in
,
std
::
vector
<
std
::
complex
<
double
>>
&
out
);
void
fft
(
std
::
vector
<
std
::
complex
<
double
>>
&
in
,
std
::
vector
<
std
::
complex
<
double
>>
&
out
);
void
fft
(
std
::
vector
<
double
>
&
in
,
std
::
vector
<
double
>
&
out
);
void
fft
(
const
std
::
vector
<
double
>
&
in
,
std
::
vector
<
double
>
&
out
);
void
fft2
(
int
N2
,
int
N1
,
fftw_complex
*
in
,
fftw_complex
*
out
);
void
fft2
(
const
std
::
vector
<
std
::
vector
<
std
::
complex
<
double
>>>
&
in
,
std
::
vector
<
std
::
vector
<
std
::
complex
<
double
>>>
&
out
);
void
fft2
(
const
std
::
vector
<
std
::
vector
<
std
::
complex
<
double
>>>
&
in
,
std
::
vector
<
std
::
vector
<
std
::
complex
<
double
>>>
&
out
);
void
fft2
(
std
::
vector
<
std
::
vector
<
double
>>
&
in
,
std
::
vector
<
std
::
vector
<
double
>>
&
out
);
void
fft2
(
const
std
::
vector
<
std
::
vector
<
double
>>
&
in
,
std
::
vector
<
std
::
vector
<
double
>>
&
out
);
double
calc_mean
(
const
std
::
vector
<
double
>
&
vec
);
...
...
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