Method
NumCosmoMathSpectralcompute_chebyshev_coeffs_adaptive
Declaration [src]
guint
ncm_spectral_compute_chebyshev_coeffs_adaptive (
NcmSpectral* spectral,
NcmSpectralF F,
gdouble a,
gdouble b,
guint k_min,
gdouble tol,
GArray** coeffs,
gpointer user_data
)
Description [src]
Computes Chebyshev coefficients of $f(x)$ on $[a,b]$ adaptively, starting at
level k_min and doubling the nested Chebyshev–Lobatto grid until the
coefficients converge to tol or max-order is reached. Only the new odd
nodes are evaluated at each refinement. See the
Spectral Methods page for the nested
grids and convergence criterion.
If coeffs points to NULL, allocates a new GArray. If coeffs points to an existing
GArray, resizes it as needed. Through bindings, coeffs always receives NULL.
Parameters
F-
Type:
NcmSpectralFFunction to evaluate, receives x in [a,b].
a-
Type:
gdoubleLeft endpoint of the interval.
b-
Type:
gdoubleRight endpoint of the interval.
k_min-
Type:
guintMinimum refinement level (N_min = 2^
k_min+ 1). tol-
Type:
gdoubleSpectral convergence tolerance.
coeffs-
Type: An array of
doubleOutput array of coefficients.
The argument will be set by the function. The caller of the method takes ownership of the returned data, and is responsible for freeing it. user_data-
Type:
gpointerUser data for
F.The argument can be NULL.The data is owned by the caller of the method.