Triumvirate C++ API 0.5.0.post1.dev301+g026f21751
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
trv::maths::HankelTransform Class Reference

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

#include <fftlog.hpp>

+ Inheritance diagram for trv::maths::HankelTransform:
+ Collaboration diagram for trv::maths::HankelTransform:

Public Member Functions

 HankelTransform (double mu, double q, bool threaded=true)
 Construct the Hankel transform.
 
 ~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.
 
void initialise (std::vector< double > sample_pts, double kr_c, bool lowring=true, int extrap=0, double extrap_exp=2.)
 Initialise the Hankel transform.
 
void biased_transform (std::complex< double > *a, std::complex< double > *b)
 Perform the (forward biased) Hankel transform.
 
std::vector< std::complex< double > > compute_kernel_coeff ()
 Compute the FFTLog transform kernel coefficients \( u \).
 
double calc_lowring_pivot (double delta, double kr_c=1.)
 Calculate a low-ringing FFTLog transform pivot value \( k r = k_c r_c \).
 

Public Attributes

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
 

Detailed Description

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

Definition at line 68 of file fftlog.hpp.

Constructor & Destructor Documentation

◆ HankelTransform()

trv::maths::HankelTransform::HankelTransform ( double mu,
double q,
bool threaded = true )

Construct the Hankel transform.

Parameters
muOrder of the Hankel transform.
qPower-law bias index.
threadedIf true (default), use multi-threads FFT.

Definition at line 39 of file fftlog.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~HankelTransform()

trv::maths::HankelTransform::~HankelTransform ( )

Destruct the Hankel transform.

Definition at line 65 of file fftlog.cpp.

Member Function Documentation

◆ initialise() [1/2]

void trv::maths::HankelTransform::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_ptsLogarithmically linearly-spaced sample points. Must be even in length if extrapolation is enabled.
kr_cPivot value.
lowringIf true (default), set the pivot value by the low-ringing condition.
extrapExtrapolation 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_expSample 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.
Exceptions
trv::sys::InvalidParameterErrorWhen the size of sample_pts is less than 2.
trv::sys::InvalidParameterErrorWhen sample_pts is not logarithmically spaced.
trv::sys::InvalidParameterErrorWhen the size of sample_pts is not even with extrapolation enabled.
trv::sys::InvalidParameterErrorWhen extrap_exp results in a shrunken sample size.
trv::sys::InvalidParameterErrorWhen kr_c is non-positive while lowring is false.

Definition at line 102 of file fftlog.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialise() [2/2]

void trv::maths::HankelTransform::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.

Parameters
sample_ptsLogarithmically linearly-spaced sample points. Must be even in length if extrapolation is enabled.
kr_cPivot value.
lowringIf true (default), set the pivot value by the low-ringing condition.
extrapExtrapolation 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_expSample 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.

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

Definition at line 246 of file fftlog.cpp.

+ Here is the call graph for this function:

◆ biased_transform()

void trv::maths::HankelTransform::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) \,. \]

Parameters
[in]aPre-transform sample values. Must be even in length if extrapolation is enabled.
[out]bPost-trasform sample values.
Attention
If extrapolation is enabled (extrap not trv::array::ExtrapOption::NONE, the pre-transform samples are assumed to be real.

Definition at line 346 of file fftlog.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compute_kernel_coeff()

std::vector< std::complex< double > > trv::maths::HankelTransform::compute_kernel_coeff ( )

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

Returns
Kernel coefficients.

Definition at line 287 of file fftlog.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calc_lowring_pivot()

double trv::maths::HankelTransform::calc_lowring_pivot ( double delta,
double kr_c = 1. )

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

Parameters
deltaLogarithmic-interval sample spacing.
kr_cInitial pivot value (default is 1.). If zero, it is calculated directly; otherwise, it is adjusted from the initial value.
Returns
Low-ringing pivot value.
Note
This is not bound to the logarithmic-interval sample spacing initialised.

Definition at line 255 of file fftlog.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ order

double trv::maths::HankelTransform::order

order of the Hankel transform

Definition at line 70 of file fftlog.hpp.

◆ bias

double trv::maths::HankelTransform::bias

power-law bias index

Definition at line 71 of file fftlog.hpp.

◆ nsamp

int trv::maths::HankelTransform::nsamp = 0

number of samples provided

Definition at line 72 of file fftlog.hpp.

◆ nsamp_trans

int trv::maths::HankelTransform::nsamp_trans = 0

number of samples transformed

Definition at line 73 of file fftlog.hpp.

◆ logres

double trv::maths::HankelTransform::logres = 0.

logarithmic interval sample spacing

Definition at line 74 of file fftlog.hpp.

◆ pivot

double trv::maths::HankelTransform::pivot = 1.

pivot value

Definition at line 75 of file fftlog.hpp.

◆ pre_sampts

std::vector<double> trv::maths::HankelTransform::pre_sampts

logarithmically linearly-spaced sample points pre-transform

Definition at line 78 of file fftlog.hpp.

◆ post_sampts

std::vector<double> trv::maths::HankelTransform::post_sampts

logarithmically linearly-spaced sample points post-transform

Definition at line 81 of file fftlog.hpp.


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