ALFI
Advanced Library for Function Interpolation
Loading...
Searching...
No Matches
alfi::dist Namespace Reference

Enumerations

enum class  Type {
  GENERAL ,
  UNIFORM ,
  QUADRATIC ,
  CUBIC ,
  CHEBYSHEV ,
  CHEBYSHEV_STRETCHED ,
  CHEBYSHEV_AUGMENTED ,
  CHEBYSHEV_2 ,
  CHEBYSHEV_3 ,
  CHEBYSHEV_3_STRETCHED ,
  CHEBYSHEV_4 ,
  CHEBYSHEV_4_STRETCHED ,
  CHEBYSHEV_ELLIPSE ,
  CHEBYSHEV_ELLIPSE_STRETCHED ,
  CHEBYSHEV_ELLIPSE_AUGMENTED ,
  CHEBYSHEV_ELLIPSE_2 ,
  CHEBYSHEV_ELLIPSE_3 ,
  CHEBYSHEV_ELLIPSE_3_STRETCHED ,
  CHEBYSHEV_ELLIPSE_4 ,
  CHEBYSHEV_ELLIPSE_4_STRETCHED ,
  LOGISTIC ,
  LOGISTIC_STRETCHED ,
  ERF ,
  ERF_STRETCHED
}
 

Functions

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > uniform (SizeT n, const Number &a, const Number &b)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > quadratic (SizeT n, const Number &a, const Number &b)
 Generates a distribution of n points on the segment [a, b] using two quadratic polynomials.
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > cubic (SizeT n, const Number &a, const Number &b)
 Generates a distribution of n points on the segment [a, b] using cubic polynomial.
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev (SizeT n, const Number &a, const Number &b)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_stretched (SizeT n, const Number &a, const Number &b)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_augmented (SizeT n, const Number &a, const Number &b)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_2 (SizeT n, const Number &a, const Number &b)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_3 (SizeT n, const Number &a, const Number &b)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_3_stretched (SizeT n, const Number &a, const Number &b)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_4 (SizeT n, const Number &a, const Number &b)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_4_stretched (SizeT n, const Number &a, const Number &b)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_ellipse (SizeT n, const Number &a, const Number &b, const Number &ratio)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_ellipse_stretched (SizeT n, const Number &a, const Number &b, const Number &ratio)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_ellipse_augmented (SizeT n, const Number &a, const Number &b, const Number &ratio)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_ellipse_2 (SizeT n, const Number &a, const Number &b, const Number &ratio)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_ellipse_3 (SizeT n, const Number &a, const Number &b, const Number &ratio)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_ellipse_3_stretched (SizeT n, const Number &a, const Number &b, const Number &ratio)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_ellipse_4 (SizeT n, const Number &a, const Number &b, const Number &ratio)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > chebyshev_ellipse_4_stretched (SizeT n, const Number &a, const Number &b, const Number &ratio)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > logistic (SizeT n, const Number &a, const Number &b, const Number &steepness)
 Generates a distribution of n points on the interval (a, b) using the logistic function.
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > logistic_stretched (SizeT n, const Number &a, const Number &b, const Number &steepness)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > erf (SizeT n, const Number &a, const Number &b, const Number &steepness)
 Generates a distribution of n points on the interval (a, b) using the error function.
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > erf_stretched (SizeT n, const Number &a, const Number &b, const Number &steepness)
 
template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > of_type (Type type, SizeT n, const Number &a, const Number &b, const Number &parameter=NAN)
 

Enumeration Type Documentation

◆ Type

enum class alfi::dist::Type
strong
Enumerator
GENERAL 
UNIFORM 
QUADRATIC 
CUBIC 
CHEBYSHEV 
CHEBYSHEV_STRETCHED 
CHEBYSHEV_AUGMENTED 
CHEBYSHEV_2 
CHEBYSHEV_3 
CHEBYSHEV_3_STRETCHED 
CHEBYSHEV_4 
CHEBYSHEV_4_STRETCHED 
CHEBYSHEV_ELLIPSE 
CHEBYSHEV_ELLIPSE_STRETCHED 
CHEBYSHEV_ELLIPSE_AUGMENTED 
CHEBYSHEV_ELLIPSE_2 
CHEBYSHEV_ELLIPSE_3 
CHEBYSHEV_ELLIPSE_3_STRETCHED 
CHEBYSHEV_ELLIPSE_4 
CHEBYSHEV_ELLIPSE_4_STRETCHED 
LOGISTIC 
LOGISTIC_STRETCHED 
ERF 
ERF_STRETCHED 

Function Documentation

◆ uniform()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::uniform ( SizeT n,
const Number & a,
const Number & b )

◆ quadratic()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::quadratic ( SizeT n,
const Number & a,
const Number & b )

Generates a distribution of n points on the segment [a, b] using two quadratic polynomials.

The following transform function \(f\):

\[ f(x) = \begin{cases} (x+1)^2 - 1, & x \leq 0 \\ -(x-1)^2 + 1, & x > 0 \end{cases} \]

is applied to n points uniformly distributed on the segment [-1, 1], mapping them onto the same segment.
The resulting points are then linearly mapped to the target segment [a, b].

Parameters
nnumber of points
aleft boundary of the segment
bright boundary of the segment
Returns
a container with n points distributed on the segment [a, b] according to the transform function

◆ cubic()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::cubic ( SizeT n,
const Number & a,
const Number & b )

Generates a distribution of n points on the segment [a, b] using cubic polynomial.

The following transform function \(f\):

\[ f(x) = -0.5x^3 + 1.5x \]

is applied to n points uniformly distributed on the segment [-1, 1], mapping them onto the same segment.
The resulting points are then linearly mapped to the target segment [a, b].

Parameters
nnumber of points
aleft boundary of the segment
bright boundary of the segment
Returns
a container with n points distributed on the segment [a, b] according to the transform function

◆ chebyshev()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev ( SizeT n,
const Number & a,
const Number & b )

◆ chebyshev_stretched()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_stretched ( SizeT n,
const Number & a,
const Number & b )

◆ chebyshev_augmented()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_augmented ( SizeT n,
const Number & a,
const Number & b )

◆ chebyshev_2()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_2 ( SizeT n,
const Number & a,
const Number & b )

◆ chebyshev_3()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_3 ( SizeT n,
const Number & a,
const Number & b )

◆ chebyshev_3_stretched()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_3_stretched ( SizeT n,
const Number & a,
const Number & b )

◆ chebyshev_4()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_4 ( SizeT n,
const Number & a,
const Number & b )

◆ chebyshev_4_stretched()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_4_stretched ( SizeT n,
const Number & a,
const Number & b )

◆ chebyshev_ellipse()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_ellipse ( SizeT n,
const Number & a,
const Number & b,
const Number & ratio )

◆ chebyshev_ellipse_stretched()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_ellipse_stretched ( SizeT n,
const Number & a,
const Number & b,
const Number & ratio )

◆ chebyshev_ellipse_augmented()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_ellipse_augmented ( SizeT n,
const Number & a,
const Number & b,
const Number & ratio )

◆ chebyshev_ellipse_2()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_ellipse_2 ( SizeT n,
const Number & a,
const Number & b,
const Number & ratio )

◆ chebyshev_ellipse_3()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_ellipse_3 ( SizeT n,
const Number & a,
const Number & b,
const Number & ratio )

◆ chebyshev_ellipse_3_stretched()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_ellipse_3_stretched ( SizeT n,
const Number & a,
const Number & b,
const Number & ratio )

◆ chebyshev_ellipse_4()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_ellipse_4 ( SizeT n,
const Number & a,
const Number & b,
const Number & ratio )

◆ chebyshev_ellipse_4_stretched()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::chebyshev_ellipse_4_stretched ( SizeT n,
const Number & a,
const Number & b,
const Number & ratio )

◆ logistic()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::logistic ( SizeT n,
const Number & a,
const Number & b,
const Number & steepness )

Generates a distribution of n points on the interval (a, b) using the logistic function.

The following transform function \(f\):

\[ f(x) = \frac{1}{1 + e^{-steepness \cdot x}} \]

is applied to n points uniformly distributed on the interval (-1, 1), mapping them onto the (0, 1) interval.
The resulting points are then linearly mapped to the target interval (a, b).

The slope of the transform function \(f\) at x = 0 is determined by steepness and is given by:

\[ \left. \dv{f}{x} \right\vert_{x=0} = \frac14 \cdot steepness \]

Note
Extreme points don't lie on the interval (a, b) boundaries.
Parameters
nnumber of points
aleft boundary of the interval
bright boundary of the interval
steepnessdetermines the slope of the transform function at x = 0
Returns
a container with n points distributed on the interval (a, b) according to the transform function

◆ logistic_stretched()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::logistic_stretched ( SizeT n,
const Number & a,
const Number & b,
const Number & steepness )

◆ erf()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::erf ( SizeT n,
const Number & a,
const Number & b,
const Number & steepness )

Generates a distribution of n points on the interval (a, b) using the error function.

The following transform function \(f\):

\[ f(x) = \operatorname{erf}(steepness \cdot x) \]

is applied to n points uniformly distributed on the interval (-1, 1), mapping them onto the same interval.
The resulting points are then linearly mapped to the target interval (a, b).

The slope of the transform function \(f\) at x = 0 is determined by steepness and is given by:

\[ \left. \dv{f}{x} \right\vert_{x=0} = \frac2\pi \cdot steepness \]

Note
Extreme points don't lie on the interval (a, b) boundaries.
Parameters
nnumber of points
aleft boundary of the interval
bright boundary of the interval
steepnessdetermines the slope of the transform function at x = 0
Returns
a container with n points distributed on the interval (a, b) according to the transform function

◆ erf_stretched()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::erf_stretched ( SizeT n,
const Number & a,
const Number & b,
const Number & steepness )

◆ of_type()

template<typename Number = DefaultNumber, template< typename, typename... > class Container = DefaultContainer>
Container< Number > alfi::dist::of_type ( Type type,
SizeT n,
const Number & a,
const Number & b,
const Number & parameter = NAN )