Function

NumCosmoMathSpectralcompute_x_row

Declaration [src]

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

Description [src]

Computes row k of the multiplication by x 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 \cdot f(x)$ (row k)

Mathematical formula: $$ (x \cdot f)^{(2)}k = \frac{\theta(k-1) c{k-1}}{4(k+1)} - \frac{c_{k+1}}{4(k+3)} - \frac{c_{k+3}}{4(k+1)} + \frac{c_{k+5}}{4(k+3)} $$ plus special contributions: $\frac{c_1}{4}\delta_{k,0}$ and $\frac{c_0}{8}\delta_{k,1}$, 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 >= 1: column k-1: coeff * 1/(4(k+1)) - column k+1: coeff * -1/(4(k+3)) - column k+3: coeff * -1/(4(k+1)) - column k+5: coeff * 1/(4(k+3)) - For k=0 only: additional value coeff * 1/4 at column 1 - For k=1 only: additional value coeff * 1/8 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.