Struct

NumCosmoMathSBesselOdeOperator

Description [src]

struct NcmSBesselOdeOperator {
  /* No available fields */
}

Opaque boxed type for a configured spectral operator.

Represents a fully configured two-point boundary value problem for the spherical Bessel ODE in Riccati-Bessel form over a specific interval $[a, b]$ and angular momentum range $[\ell_{\min}, \ell_{\max}]$. Encapsulates:

  • Problem parameters: interval endpoints, multipole range, and tolerance
  • Discretized system: banded matrix representation and right-hand side storage
  • Factorization state: incremental Givens QR and spectral truncation order

Operators are created from a NcmSBesselOdeSolver via ncm_sbessel_ode_solver_create_operator() and managed via reference counting. Once created, an operator can be:

  • Reused for multiple right-hand sides with the same $[a,b]$ and $[\ell_{\min}, \ell_{\max}]$
  • Reconfigured for another interval or multipole range via ncm_sbessel_ode_solver_reconfigure_operator()
  • Deallocated via ncm_sbessel_ode_operator_unref()

Batched mode (multiple $\ell$ values) is automatically selected and optimized based on $n_\ell = \ell_{\max} - \ell_{\min} + 1$.

Functions

ncm_sbessel_ode_operator_clear

Decreases the reference count of op by one and sets op to NULL.

Instance methods

ncm_sbessel_ode_operator_get_constraint
No description available.

ncm_sbessel_ode_operator_get_ell_range

Gets the multipole range [ell_min, ell_max] for which the operator solves. For single-ell operators, ell_min == ell_max.

ncm_sbessel_ode_operator_get_interval

Gets the interval [a, b] on which the operator is defined.

ncm_sbessel_ode_operator_get_last_deriv_error

Bound on the roundoff left in the endpoint derivatives of the last solve for that multipole: $\sum_j j^2 |a_j| / h$, which multiplied by the machine epsilon bounds the absolute error of $u’(x_a)$ and $u’(x_b)$. Those are formed as $u’(\pm 1) = (1/h)\sum_j (\pm 1)^{j+1} j^2 a_j$, and under NCM_SBESSEL_ODE_CONSTRAINT_TAU any homogeneous content the truncation admitted cancels in that sum, exactly but not in floating point —- so this is what survives, and it is what limits the accuracy of a boundary functional built from the derivatives.

ncm_sbessel_ode_operator_get_last_max_coeff

Largest $|a_j|$ produced by the last back-substitution for that multipole. Under NCM_SBESSEL_ODE_CONSTRAINT_TAU a value far above the forcing’s own scale $\max|x F| / \min|x^2 - \nu^2|$ means the solve admitted homogeneous content, and the panel must be redone with Dirichlet data.

ncm_sbessel_ode_operator_get_matrix

Dense $n \times n$ row-major representation of op, closed the way op is closed: rows 0 and 1 carry the two constraint functionals of its NcmSBesselOdeConstraint —- the dense $(-1)^j$ and $1$ patterns of Dirichlet data, the two single entries of the pinned constraint, or nothing at all under NCM_SBESSEL_ODE_CONSTRAINT_TAU —- and rows 2 to nrows-1 are the discretized operator. For validation and for comparison with dense solvers; the solve itself never forms this matrix.

ncm_sbessel_ode_operator_get_min_cols
No description available.

ncm_sbessel_ode_operator_get_n_cols

Gets the number of columns in the currently stored factorization, zero before the first solve and after a reconfiguration or a constraint change.

ncm_sbessel_ode_operator_get_operator_size

Gets the number of matrix rows allocated, the rows per multipole times the block’s $n_\ell$, which sizes the stored rows, rotations and transformed right-hand side. It grows when a solve needs more columns and is kept across reconfigurations.

ncm_sbessel_ode_operator_get_pins

Reads back the indices last given to ncm_sbessel_ode_operator_set_pinned_constraint(), both zero if it was never called. They act only while ncm_sbessel_ode_operator_get_constraint() is NCM_SBESSEL_ODE_CONSTRAINT_PINNED.

ncm_sbessel_ode_operator_get_tau_constraint_order

Number of coefficients a NCM_SBESSEL_ODE_CONSTRAINT_TAU solve of a right-hand side with rhs_len entries uses at least: the larger of the operator’s minimum and the forcing floor.

ncm_sbessel_ode_operator_get_tolerance

Gets the operator’s relative coefficient-decay tolerance.

ncm_sbessel_ode_operator_ref

Increases the reference count of op by one.

ncm_sbessel_ode_operator_set_constraint

Sets the constraint of this operator alone, overriding what it inherited from the solver. The stored factorization is discarded and the resolution floor recomputed.

ncm_sbessel_ode_operator_set_min_cols

Overrides the floor the decay test may not stop below. Experimental: with NCM_SBESSEL_ODE_CONSTRAINT_PINNED and a floor of zero the test may stop before the pinned columns have entered the system, in which case the pins never act and the solve is closed by whatever back-substitution assigns to the trailing coefficients, which is NCM_SBESSEL_ODE_CONSTRAINT_TAU by another route. The stored factorization is discarded.

ncm_sbessel_ode_operator_set_pinned_constraint

Puts op on NCM_SBESSEL_ODE_CONSTRAINT_PINNED, closing the system with $\langle T_{pin1}, u\rangle = \langle T_{pin2}, u\rangle = 0$ instead of the Dirichlet data $u(x_a) = u(x_b) = 0$.

ncm_sbessel_ode_operator_solve

Solves the ODE by adaptive QR in ultraspherical coefficient space. The matrix grows until the relative coefficient-decay criterion described by NcmSBesselOdeSolver is met.

ncm_sbessel_ode_operator_solve_endpoints

Efficiently computes only the endpoint derivatives u’(a) and u’(b) without building the full solution vector. This is much more efficient when only endpoint information is needed (e.g., for integral computations via Green’s identity).

ncm_sbessel_ode_operator_solve_values

Solves the ODE and evaluates the solution and its physical-coordinate derivative at two points without constructing the complete Chebyshev coefficient vectors. For each multipole the output contains [u(x0), u'(x0), u(x1), u'(x1)].

ncm_sbessel_ode_operator_unref

Decreases the reference count of op by one. When the reference count reaches zero, frees all allocated memory.