Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Reinecke
ducc
Commits
bacdff6d
Commit
bacdff6d
authored
Aug 16, 2020
by
Martin Reinecke
Browse files
improve accuracy?
parent
dcabd8a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ducc0/math/gridding_kernel.h
View file @
bacdff6d
...
...
@@ -47,8 +47,15 @@ vector<double> getCoeffs(size_t W, size_t D, const function<double(double)> &fun
double
l
=
-
1
+
2.
*
i
/
double
(
W
);
double
r
=
-
1
+
2.
*
(
i
+
1
)
/
double
(
W
);
// function values at Chebyshev nodes
double
avg
=
0
;
for
(
size_t
j
=
0
;
j
<=
D
;
++
j
)
{
y
[
j
]
=
func
(
chebroot
[
j
]
*
(
r
-
l
)
*
0.5
+
(
r
+
l
)
*
0.5
);
avg
+=
y
[
j
];
}
avg
/=
(
D
+
1
);
for
(
size_t
j
=
0
;
j
<=
D
;
++
j
)
y
[
j
]
-=
avg
;
// Chebyshev coefficients
for
(
size_t
j
=
0
;
j
<=
D
;
++
j
)
{
...
...
@@ -71,6 +78,7 @@ vector<double> getCoeffs(size_t W, size_t D, const function<double(double)> &fun
for
(
size_t
j
=
0
;
j
<=
D
;
++
j
)
for
(
size_t
k
=
0
;
k
<=
D
;
++
k
)
lcf2
[
k
]
+=
C
[
j
*
(
D
+
1
)
+
k
]
*
lcf
[
j
];
lcf2
[
0
]
+=
avg
;
for
(
size_t
j
=
0
;
j
<=
D
;
++
j
)
coeff
[
j
*
W
+
i
]
=
lcf2
[
D
-
j
];
}
...
...
Write
Preview
Supports
Markdown
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