Class HankelTransform#

Inheritance Relationships#

Derived Type#

Class Documentation#

class HankelTransform#

Perform the (forward biased) Hankel and associated transforms using the FFTLog algorithm.

Subclassed by trv::maths::SphericalBesselTransform

Public Functions

HankelTransform(double mu, double q, bool threaded = true)#

Construct the Hankel transform.

Parameters:
  • mu – Order of the Hankel transform.

  • q – Power-law bias index.

  • threaded – If true (default), use multi-threads FFT.

~HankelTransform()#

Destruct the Hankel transform.

void initialise(std::vector<double> sample_pts, double kr_c, bool lowring = true, trva::ExtrapOption extrap = trva::ExtrapOption::NONE, double extrap_exp = 2.)#

Initialise the Hankel transform.

This sets up the pre- and post-transform samples as well as the transform kernel and the pivot value.

Parameters:
  • sample_pts – Logarithmically linearly-spaced sample points. Must be even in length if extrapolation is enabled.

  • kr_c – Pivot value.

  • lowring – If true (default), set the pivot value by the low-ringing condition.

  • extrap – Extrapolation option. If not trv::array::ExtrapOption::NONE (default), the sample size for the transform is the smallest power of 2 that is greater than or equal to extrap_exp times the original number of sample points; the pre-transform samples are assumed to be real and must be even in length.

  • extrap_exp – Sample size expansion factor (default is 2.) for extrapolation. The smallest power of 2 greater than or equal to this times the original number of sample points is used as the sample size for the transform.

Throws:
void initialise(std::vector<double> sample_pts, double kr_c, bool lowring = true, int extrap = 0, double extrap_exp = 2.)#

Initialise the Hankel transform.

This sets up the pre- and post-transform samples as well as the transform kernel and the pivot value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
  • sample_pts – Logarithmically linearly-spaced sample points. Must be even in length if extrapolation is enabled.

  • kr_c – Pivot value.

  • lowring – If true (default), set the pivot value by the low-ringing condition.

  • extrap – Extrapolation option. If not 0 (default), the sample size for the transform is the smallest power of 2 that is greater than or equal to extrap_exp times the original number of sample points; the pre-transform samples are assumed to be real and must be even in length.

  • extrap_exp – Sample size expansion factor (default is 2.) for extrapolation. The smallest power of 2 greater than or equal to this times the original number of sample points is used as the sample size for the transform.

void biased_transform(std::complex<double> *a, std::complex<double> *b)#

Perform the (forward biased) Hankel transform.

The transform is defined here as

\[ b(k) = \int_0^\infty k \mathrm{d}r \, (k r)^q J_\mu(k r) a(r) \,. \]

Attention

If extrapolation is enabled (extrap not trv::array::ExtrapOption::NONE, the pre-transform samples are assumed to be real.

Parameters:
  • a[in] Pre-transform sample values. Must be even in length if extrapolation is enabled.

  • b[out] Post-trasform sample values.

std::vector<std::complex<double>> compute_kernel_coeff()#

Compute the FFTLog transform kernel coefficients \( u \).

Returns:

Kernel coefficients.

double calc_lowring_pivot(double delta, double kr_c = 1.)#

Calculate a low-ringing FFTLog transform pivot value \( k r = k_c r_c \).

Note

This is not bound to the logarithmic-interval sample spacing initialised.

Parameters:
  • delta – Logarithmic-interval sample spacing.

  • kr_c – Initial pivot value (default is 1.). If zero, it is calculated directly; otherwise, it is adjusted from the initial value.

Returns:

Low-ringing pivot value.

Public Members

double order#

order of the Hankel transform

double bias#

power-law bias index

int nsamp = 0#

number of samples provided

int nsamp_trans = 0#

number of samples transformed

double logres = 0.#

logarithmic interval sample spacing

double pivot = 1.#

pivot value

std::vector<double> pre_sampts#

logarithmically linearly-spaced sample points pre-transform

std::vector<double> post_sampts#

logarithmically linearly-spaced sample points post-transform