QUGaR 0.0.4
Loading...
Searching...
No Matches
qugar::TanhSinh Class Reference

Helper class for computing the abscissae and weights of the tanh-sinh quadrature rule referred to the [0,1]. The maximum number of abscissae/weights is prescribed by n_max. The abscissae / weights are precomputed with enough precision (34 significant digits) for double or quadruple precision applications. More...

#include <quadrature.hpp>

Static Public Member Functions

static real get_abscissa (const int n_points, const int pt_id)
 Gets a tanh-sinh abscissa in the [0,1] domain.
 
static real get_weight (const int n_points, const int pt_id)
 Gets a tanh-sinh weight in the [0,1] domain.
 

Static Public Attributes

static constexpr int n_max = 100
 Maximum precomputed degree of tanh-sinh points.
 

Static Private Member Functions

static const std::array< real, n_entries > & get_quad_data ()
 Gets a reference to a static array containing all the information of the quadrature.
 

Static Private Attributes

static constexpr int n_entries = n_max * (n_max + 1)
 Number of entries in data vectors.
 

Detailed Description

Helper class for computing the abscissae and weights of the tanh-sinh quadrature rule referred to the [0,1]. The maximum number of abscissae/weights is prescribed by n_max. The abscissae / weights are precomputed with enough precision (34 significant digits) for double or quadruple precision applications.

Member Function Documentation

◆ get_abscissa()

static real qugar::TanhSinh::get_abscissa ( const int n_points,
const int pt_id )
static

Gets a tanh-sinh abscissa in the [0,1] domain.

Parameters
n_pointsNumber of points of the 1D quadrature. It must be smaller or equal than n_max.
pt_idId of the point whose abscissa is returned. The point must be in the range [0, n_points [.
Returns
Abscissa of the point.

◆ get_quad_data()

static const std::array< real, n_entries > & qugar::TanhSinh::get_quad_data ( )
staticprivate

Gets a reference to a static array containing all the information of the quadrature.

The array contains the abscissae and weights from 1 up to n_max points. The data is sorted in the following way: for a given number of points n, from 1 to n_max, first the abcissae in ascending order (in [0,1]) are stored and then associated weights. Then, the abscissae for n+1 points and weights, etc.

Returns
Constant reference to static array containing all the data.

◆ get_weight()

static real qugar::TanhSinh::get_weight ( const int n_points,
const int pt_id )
static

Gets a tanh-sinh weight in the [0,1] domain.

Parameters
n_pointsNumber of points of the 1D quadrature. It must be smaller or equal than n_max.
pt_idId of the point whose weight is returned. The point must be in the range [0, n_points [.
Returns
Weight of the point.

Member Data Documentation

◆ n_entries

int qugar::TanhSinh::n_entries = n_max * (n_max + 1)
staticconstexprprivate

Number of entries in data vectors.

◆ n_max

int qugar::TanhSinh::n_max = 100
staticconstexpr

Maximum precomputed degree of tanh-sinh points.


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