Chebyshev
Unit testing for scientific software
chebyshev::prec::property Namespace Reference

Property testing of functions. More...

Functions

template<typename Type , typename Identity = EndoFunction<Type>>
void identity (const std::string &name, Identity id, const estimate_options< Type, Type > &opt)
 Precision testing of an endofunction which is equivalent to the identity. More...
 
template<typename Type , typename Involution = EndoFunction<Type>>
void involution (const std::string &name, Involution invol, const estimate_options< Type, Type > &opt)
 Precision testing of an endofunction which is an involution. More...
 
template<typename Type , typename Involution = EndoFunction<Type>>
void idempotence (const std::string &name, Involution idem, const estimate_options< Type, Type > &opt)
 Precision testing of an endofunction which is idempotent. More...
 
template<typename InputType , typename OutputType = InputType, typename Homogeneous = std::function<OutputType(InputType)>>
void homogeneous (const std::string &name, Homogeneous hom, const estimate_options< InputType, OutputType > &opt, OutputType zero_element=OutputType(0.0))
 Precision testing of an function which is homogeneous over the domain. More...
 

Detailed Description

Property testing of functions.

When estimating error integrals, it is usually necessary to have a function to compare the result to, considered exact. Using property testing, it is possible to test a specific property of a function (such as involution or homogeneity) doing away with the additional "exact" function.

Function Documentation

◆ homogeneous()

template<typename InputType , typename OutputType = InputType, typename Homogeneous = std::function<OutputType(InputType)>>
void chebyshev::prec::property::homogeneous ( const std::string &  name,
Homogeneous  hom,
const estimate_options< InputType, OutputType > &  opt,
OutputType  zero_element = OutputType(0.0) 
)
inline

Precision testing of an function which is homogeneous over the domain.

The function is applied to input values and it is checked against zero. The zero value is constructed as OutputType(0.0), but may be specified as an additional argument.

Parameters
nameThe name of the test case.
homThe homogeneous function to test.
optThe options for estimation.
zero_elementThe zero element of type OutputType (defaults to OutputType(0.0)).

◆ idempotence()

template<typename Type , typename Involution = EndoFunction<Type>>
void chebyshev::prec::property::idempotence ( const std::string &  name,
Involution  idem,
const estimate_options< Type, Type > &  opt 
)
inline

Precision testing of an endofunction which is idempotent.

The function is applied two times to input values and it is checked against itself.

Parameters
nameThe name of the test case.
idemThe idempotent function to test.
optThe options for estimation.

◆ identity()

template<typename Type , typename Identity = EndoFunction<Type>>
void chebyshev::prec::property::identity ( const std::string &  name,
Identity  id,
const estimate_options< Type, Type > &  opt 
)
inline

Precision testing of an endofunction which is equivalent to the identity.

Parameters
nameThe name of the test case.
idThe identity function to test.
optThe options for estimation.

◆ involution()

template<typename Type , typename Involution = EndoFunction<Type>>
void chebyshev::prec::property::involution ( const std::string &  name,
Involution  invol,
const estimate_options< Type, Type > &  opt 
)
inline

Precision testing of an endofunction which is an involution.

The function is applied two times to input values and it is checked against the identity.

Parameters
nameThe name of the test case.
involutionThe involution to test.
optThe options for estimation.