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 adaptively using nested Chebyshev-Lobatto nodes.
The function F is evaluated at points x in [a,b]. Starts at level k_min and refines
by doubling until spectral convergence is achieved or max_order is reached. Uses nested
nodes: only new odd nodes are computed at each refinement level.
The Chebyshev expansion is $f(x) = f(t) = \sum_{k=0}^{N-1} a_k T_k(t)$ where
$t = (2x - (a+b))/(b-a)$.
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.