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 modified spherical Bessel ODE over a specific interval $[a, b]$ and angular momentum range $[\ell_{\min}, \ell_{\max}]$. Encapsulates: - Problem parameters: interval endpoints, angular momentum range, and tolerance - Discretized system: banded matrix representation and right-hand side storage - Factorization state: adaptive QR decomposition 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 different parameters via ncm_sbessel_ode_operator_reset()
- 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$.
Instance methods
ncm_sbessel_ode_operator_get_ell_range
Gets the range of angular momentum values [ell_min, ell_max] for which the operator solves. For single-ell operators, ell_min == ell_max.
ncm_sbessel_ode_operator_get_n_cols
Gets the number of columns in the currently stored diagonalization. Returns 0 if no diagonalization has been performed yet, or if the operator has been reset. This is useful for understanding the convergence behavior and for testing that diagonalization reuse is working correctly.
ncm_sbessel_ode_operator_get_operator_size
Gets the total allocated size of the operator’s internal storage. This represents the allocated size (operator_order * n_ell) for the arrays (matrix_rows, rotation_params, c) that store the diagonalized operator and factorization data. The operator size grows as needed when solving problems that require more storage than currently allocated.
ncm_sbessel_ode_operator_get_tolerance
Gets the convergence tolerance used by the operator for adaptive QR decomposition.
ncm_sbessel_ode_operator_reset
Resets the operator with new structural parameters without modifying the reference count. Clears all factorization state, rotations, and convergence state, but preserves allocated capacities for efficiency. After reset, the operator behaves exactly like a freshly created one.
ncm_sbessel_ode_operator_solve
Solves the ODE using adaptive QR decomposition with ultraspherical spectral methods. The algorithm grows the matrix size until convergence is achieved (error < tolerance).
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_unref
Decreases the reference count of op by one.
When the reference count reaches zero, frees all allocated memory.