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

Precision estimators. More...

Functions

template<typename FloatType = double>
auto quadrature1D ()
 Use Simpson's quadrature scheme to approximate error integrals for univariate real functions (endofunctions on real number types). More...
 
template<typename IntType = int, typename ReturnType = IntType>
auto discrete1D ()
 Use a discrete estimator over a lattice of points, here implemented in one dimension, to compute error sums over a discrete domain. More...
 
template<typename FloatType = double>
auto montecarlo1D ()
 Use crude Monte Carlo integration to approximate error integrals for univariate real functions. More...
 
template<typename FloatType = double, typename Vector = std::vector<FloatType>>
auto montecarlo (unsigned int dimensions)
 Use crude Monte Carlo integration to approximate error integrals for multivariate real functions. More...
 

Detailed Description

Precision estimators.

Function Documentation

◆ discrete1D()

template<typename IntType = int, typename ReturnType = IntType>
auto chebyshev::prec::estimator::discrete1D ( )
inline

Use a discrete estimator over a lattice of points, here implemented in one dimension, to compute error sums over a discrete domain.

The function is evaluated at the discrete integer values inside the prec::interval domain and the errors are summed and averaged, returning a prec::estimate_result.

ReturnType must be a type that has operator-() and is castable to long double.

◆ montecarlo()

template<typename FloatType = double, typename Vector = std::vector<FloatType>>
auto chebyshev::prec::estimator::montecarlo ( unsigned int  dimensions)
inline

Use crude Monte Carlo integration to approximate error integrals for multivariate real functions.

Parameters
dimensionsThe dimension of the space of inputs
Note
You may specify a custom vector type to use as input, but it must provide a constructor taking in the number of elements.

◆ montecarlo1D()

template<typename FloatType = double>
auto chebyshev::prec::estimator::montecarlo1D ( )
inline

Use crude Monte Carlo integration to approximate error integrals for univariate real functions.

A uniform random sampler is used to sample points over the one-dimensional domain

◆ quadrature1D()

template<typename FloatType = double>
auto chebyshev::prec::estimator::quadrature1D ( )
inline

Use Simpson's quadrature scheme to approximate error integrals for univariate real functions (endofunctions on real number types).

The estimator is returned as a lambda function.