6#ifndef CHEBYSHEV_PREC_STRUCTURES_H
7#define CHEBYSHEV_PREC_STRUCTURES_H
13#include "../core/common.h"
28 std::string
name =
"unknown";
70 template<
typename Type>
76 template<
typename R,
typename ...Args>
79 using Estimator_t = std::function<
81 std::function<
R(
Args...)>,
82 std::function<
R(
Args...)>,
106 return (
r.maxErr >
r.tolerance) || (
r.maxErr !=
r.maxErr);
149 std::vector<interval>
omega,
161 template<
typename R,
typename ...Args>
#define CHEBYSHEV_PREC_ITER
Default number of function evaluations in precision testing.
Definition common.h:12
#define CHEBYSHEV_PREC_TOLERANCE
Default tolerance in precision testing.
Definition common.h:17
Interval over the real numbers.
General namespace of the framework.
Definition benchmark.h:22
constexpr FloatType get_nan()
Get a quiet NaN of the specified floating point type.
Definition common.h:65
std::function< long double(Type, Type)> DistanceFunction
Distance function between two elements.
Definition prec_structures.h:71
std::function< bool(const estimate_result &)> FailFunction
A function which determines whether an estimation failed.
Definition prec_structures.h:66
typename estimate_options< R, Args... >::Estimator_t Estimator
Generic precision estimator function signature.
Definition prec_structures.h:162
Structure holding options for equivalence evaluation.
Definition prec_structures.h:199
bool quiet
Print to standard output or not.
Definition prec_structures.h:212
equation_options(long double tolerance, DistanceFunction< T > dist, bool quiet=false)
Construct equation options from the tolerance, the distance function and the quiet flag (defaults to ...
Definition prec_structures.h:226
long double tolerance
Tolerance on the absolute difference.
Definition prec_structures.h:202
equation_options()
Default constructor for equation options.
Definition prec_structures.h:216
DistanceFunction< T > distance
Distance function to measure the distance between the expected and evaluated value.
Definition prec_structures.h:206
equation_options(long double tolerance)
Construct equation options from the tolerance, setting the distance function to a simple Euclidean di...
Definition prec_structures.h:221
A structure holding the result of an evaluation.
Definition prec_structures.h:167
long double tolerance
Tolerance on the absolute difference.
Definition prec_structures.h:186
bool failed
Whether the test failed.
Definition prec_structures.h:189
bool quiet
Print to standard output or not.
Definition prec_structures.h:192
std::string name
Identifying name of the function or test case.
Definition prec_structures.h:170
long double difference
Evaluated difference between expected and evaluated values.
Definition prec_structures.h:179
std::map< std::string, long double > additionalFields
Additional fields by name, as a floating point value.
Definition prec_structures.h:183
long double evaluated
Evaluated value.
Definition prec_structures.h:173
long double expected
Expected value.
Definition prec_structures.h:176
A structure holding the options for precision estimation.
Definition prec_structures.h:77
FailFunction fail
The function to determine whether the test failed (defaults to fail::fail_on_max_err).
Definition prec_structures.h:105
estimate_options(interval omega, Estimator_t estimator, long double tolerance, unsigned int iterations, bool quiet=false)
Construct estimate options from a one-dimensional interval domain, an estimator, a tolerance and an o...
Definition prec_structures.h:129
unsigned int iterations
Number of function evaluations to use.
Definition prec_structures.h:101
estimate_options(interval omega, Estimator_t estimator)
Construct estimate options from a one-dimensional interval domain and an estimator,...
Definition prec_structures.h:122
estimate_options(std::vector< interval > omega, Estimator_t estimator)
Construct estimate options from a multidimensional interval domain and an estimator,...
Definition prec_structures.h:142
std::vector< interval > domain
The domain of estimation.
Definition prec_structures.h:86
Estimator_t estimator
The precision estimator to use (defaults to a dummy estimator)
Definition prec_structures.h:90
estimate_options(std::vector< interval > omega, Estimator_t estimator, long double tolerance, unsigned int iterations, bool quiet=false)
Construct estimate options from a multidimensional interval domain, an estimator, a tolerance and an ...
Definition prec_structures.h:148
long double tolerance
The tolerance to use to determine whether the test failed.
Definition prec_structures.h:98
bool quiet
Whether to show the test result or not.
Definition prec_structures.h:110
estimate_options()
Construct estimate options with all default values.
Definition prec_structures.h:116
A structure holding the result of precision estimation.
Definition prec_structures.h:25
std::string name
Identifying name of the function or test case.
Definition prec_structures.h:28
std::map< std::string, long double > additionalFields
Additional fields by name, as a floating point value.
Definition prec_structures.h:52
bool quiet
Print to standard output or not.
Definition prec_structures.h:58
long double meanErr
Estimated mean error on interval.
Definition prec_structures.h:40
long double relErr
Estimated relative error on interval.
Definition prec_structures.h:46
long double maxErr
Estimated maximum absolute error on interval.
Definition prec_structures.h:37
bool failed
Whether the test failed.
Definition prec_structures.h:55
std::vector< interval > domain
Interval of estimation.
Definition prec_structures.h:31
long double rmsErr
Estimated RMS error on interval.
Definition prec_structures.h:43
unsigned int iterations
Total number of iterations for integral quadrature.
Definition prec_structures.h:61
long double absErr
Estimated absolute error on interval.
Definition prec_structures.h:49
long double tolerance
Tolerance on the max absolute error.
Definition prec_structures.h:34
An interval on the real numbers.
Definition interval.h:16