Function

NumCosmoMathSpectralcompute_x2_row

Declaration [src]

void
ncm_spectral_compute_x2_row (
  gdouble* row_data,
  glong k,
  glong offset,
  gdouble coeff
)

Description [src]

Computes row k of the multiplication by $x^2$ operator that maps Chebyshev coefficients to Gegenbauer $C^{(2)}_k$ coefficients.

Input: Chebyshev $T_n(x)$ basis coefficients (columns) Output: Gegenbauer $C^{(2)}_k(x)$ basis coefficient for $x^2 \cdot f(x)$ (row k)

Mathematical formula: $$ (x^2 \cdot f)^{(2)}k = \frac{\theta(k-2) c{k-2}}{8(k+1)} + \frac{c_k}{4(k+1)(k+3)} - \frac{(k+2) c_{k+2}}{4(k+1)(k+3)} - \frac{c_{k+4}}{4(k+1)(k+3)} + \frac{c_{k+6}}{8(k+3)} $$ plus special contributions at k=0,1,2, where $c_n$ are the input Chebyshev coefficients and $\theta$ is the Heaviside function.

Adds to existing row data (for linear combinations of operators).

Matrix entries for row k: - If k >= 2: column k-2: coeff * 1/(8(k+1)) - column k: coeff * 1/(4(k+1)(k+3)) - column k+2: coeff * -(k+2)/(4(k+1)(k+3)) - column k+4: coeff * -1/(4(k+1)(k+3)) - column k+6: coeff * 1/(8(k+3)) - For k=0 only: additional values coeff * 1/12 at column 0 and coeff * 1/8 at column 2 - For k=1 only: additional value coeff * 1/16 at column 1 - For k=2 only: additional value coeff * 1/24 at column 0.

Parameters

row_data

Type: gdouble*

Row structure to update.

The data is owned by the caller of the function.
k

Type: glong

Row index (0-based).

offset

Type: glong

Row offset.

coeff

Type: gdouble

Coefficient to multiply all elements.