Chebyshev
Unit testing for scientific software
prec.h File Reference

Precision testing module. More...

#include <string>
#include <vector>
#include <map>
#include <fstream>
#include <iostream>
#include <ctime>
#include "./prec/prec_structures.h"
#include "./prec/fail.h"
#include "./prec/estimator.h"
#include "./core/output.h"
#include "./core/random.h"

Go to the source code of this file.

Classes

class  chebyshev::prec::prec_settings
 of the precision testing module. More...
 
class  chebyshev::prec::prec_results
 of the precision testing module. More...
 

Namespaces

 chebyshev
 General namespace of the framework.
 
 chebyshev::prec
 Precision testing module.
 
 chebyshev::prec::property
 Property testing of functions.
 

Functions

void chebyshev::prec::setup (std::string moduleName, int argc=0, const char **argv=nullptr)
 Setup the precision testing environment. More...
 
void chebyshev::prec::terminate (bool exit=true)
 Terminate the precision testing environment, printing the results to standard output and output files. More...
 
template<typename R , typename ... Args, typename Function1 = std::function<R(Args...)>, typename Function2 = Function1>
void chebyshev::prec::estimate (const std::string &name, Function1 funcApprox, Function2 funcExpected, estimate_options< R, Args... > opt)
 Estimate error integrals over a function with respect to an exact function, with the given options. More...
 
template<typename R , typename ... Args, typename Function1 = std::function<R(Args...)>, typename Function2 = Function1>
void chebyshev::prec::estimate (const std::string &name, Function1 funcApprox, Function2 funcExpected, std::vector< interval > domain, long double tolerance, unsigned int iterations, FailFunction fail, Estimator< R, Args... > estimator, bool quiet=false)
 Estimate error integrals over a function with respect to an exact function. More...
 
void chebyshev::prec::estimate (const std::string &name, EndoFunction< double > funcApprox, EndoFunction< double > funcExpected, interval domain, long double tolerance=settings.defaultTolerance, unsigned int iterations=settings.defaultIterations, FailFunction fail=fail::fail_on_max_err(), Estimator< double, double > estimator=estimator::quadrature1D< double >(), bool quiet=false)
 Estimate error integrals over a real function of real variable, with respect to an exact function. More...
 
template<typename Type , typename Identity = EndoFunction<Type>>
void chebyshev::prec::property::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 chebyshev::prec::property::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 chebyshev::prec::property::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 chebyshev::prec::property::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...
 
template<typename T = double>
void chebyshev::prec::equals (const std::string &name, const T &evaluated, const T &expected, equation_options< T > opt=equation_options< T >())
 Test an equivalence up to a tolerance, with the given options (e.g. More...
 
template<typename T = double>
void chebyshev::prec::equals (const std::string &name, const T &evaluated, const T &expected, long double tolerance, DistanceFunction< T > distance, bool quiet=false)
 Test an equivalence up to a tolerance, with the given options (e.g. More...
 
void chebyshev::prec::equals (const std::string &name, long double evaluated, long double expected, long double tolerance=settings.defaultTolerance, bool quiet=false)
 Test an equivalence up to a tolerance, with the given options (e.g. More...
 
template<typename T >
void chebyshev::prec::equals (const std::string &name, std::vector< std::array< T, 2 >> values, long double tolerance=settings.defaultTolerance, bool quiet=false)
 Evaluate multiple pairs of values for equivalence up to the given tolerance (e.g. More...
 

Variables

struct chebyshev::prec::prec_settings chebyshev::prec::settings
 
struct chebyshev::prec::prec_results chebyshev::prec::results
 

Detailed Description

Precision testing module.