CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
BesselTableCache Class Reference

#include <bessel_table_cache.h>

Public Member Functions

std::shared_ptr< const HyperInterpStruct > Get (const std::vector< int > &l, double xmin, double xmax, double sampling, int l_WKB, double phiminabs)
 

Detailed Description

Keeps the transfer module's table of flat-space spherical Bessel functions from one cosmology to the next.

The table depends on the multipoles, on the x range and on three precision parameters, but on the cosmology only through how far in x it must reach. Built afresh for every cosmology, it cost 24 ms of 0.85 s on one thread for LCDM to l = 3000, in a serial step ahead of the threaded transfer loop. A sampler calls compute() thousands of times on one classy object, which owns one cache (CAMB keeps its Bessel tables for the same reason).

The cached table is reused only when it was built for the same multipoles and parameters and reaches at least as far in x. Tables are built on a fixed spacing (HyperInterpStruct::OnFixedSpacing), so a reused table holds exactly the nodes and values a fresh one would. A computation therefore gives the same result whatever is cached. docs/superpowers/specs/2026-10-26-bessel-table-cache-design.md

Member Function Documentation

◆ Get()

std::shared_ptr< const HyperInterpStruct > BesselTableCache::Get ( const std::vector< int > &  l,
double  xmin,
double  xmax,
double  sampling,
int  l_WKB,
double  phiminabs 
)
inline

The table for these multipoles on [xmin, xmax]: the cached one if it serves, else a new one, which then replaces it.


The documentation for this class was generated from the following file: