18 #ifndef INTERPOLATION_H 19 #define INTERPOLATION_H 91 double bound_a()
const;
92 double bound_b()
const;
93 unsigned int size()
const;
99 void set_interval(
double bound_a,
double bound_b);
104 void set_size(
unsigned int size);
119 void set_size_automatic(
double user_tol,
unsigned int init_size,
unsigned int max_size=default_max_size);
140 unsigned int interval_miss_a,
158 void check_stats_and_reinterpolate(
double percentage=0.3);
299 template<
template<
class>
class Func,
class Type >
300 Interpolant(Func<Type>* func,
bool interpolate_derivative=
false);
303 virtual ~Interpolant(
void);
310 double val(
double x);
316 double val_test(
double x);
331 double val_p1(
double x);
341 double f_val(
double x);
353 double f_diffn(
double x,
unsigned int n);
369 template<
template<
class>
class Func,
class Type >
370 void set_functor(Func<Type>* func,
bool interpolate_derivative=
false);
407 void compute_values();
437 template<
template<
class>
class Func,
class Type >
441 virtual ~InterpolantImplicit(
void);
449 template<
template<
class>
class Func,
class Type >
450 void set_functor(Func<Type>* func,
bool interpolate_derivative=
false);
466 double val(
double u);
482 double f_val(
double x,
double y);
487 double f_val(
double u);
500 double f_diffn(
double u,
unsigned int n);
516 template<
class Type=
double>
535 void interpolate_p1();
FunctorBase< B< double > > * func_diff
Pointer to original functor with FADBAD B type.
bool automatic_size
Is true if step/size should be chosen automatically.
ErrorNorm::Type norm_type
Type of norm used to compute error of the interpolation.
static const double simpson_tolerance
Tolerance in Adaptive Simpson intergration.
IntersectionPoint * interpolate(const IntersectionPoint &A1, const IntersectionPoint &A2, double t)
bool interpolate_derivative
Is true if we want to interpolate the derivative too.
static const unsigned int default_max_size
Default maximal size of the interpolation table.
unsigned int total_calls
counts total calls of evaluation
double user_tol
User set tolerance which is used during automatic step choice.
std::vector< double > df_vec
Vector of function derivatives values at nodes.
FunctorBase< T< double > > * func_diffn
Pointer to original functor with FADBAD T type.
std::pair< double, double > DiffValue
Base class for interpolation.
std::vector< double > f_vec
Vector of function values at nodes.
double error_
Error of the interpolation.
static constexpr bool value
IFunctorBase< B< double > > * func_diff
Interpolant * explicit_interpolant
Structure that keeps statistics of evaluation.
unsigned int max_size
Maximal size of the interpolation table.
FunctorBase< double > * func
Pointer to original functor with double type.
double step
Chosen interpolation step.
std::vector< bool > checks
Vector of boolean values telling us which parameters are set or not.
EvalStatistics stats
Structure which keeps evaluation statistics. See InterpolantBase::eval_statistics.
Extrapolation::Type extrapolation
The main class for interpolation of functors.
IFunctorBase< T< double > > * func_diffn
IFunctorBase< double > * func
FuncExplicit< double > * func_u
bool interpolate_derivative
Is true if we want to interpolate the derivative too.
static const unsigned int n_derivatives
Defines how many derivatives we allow to be returned from Taylor's coeficients.
y variable will be fixed with given value
double p
Exponent used in norms and when computing error.
double min
minimal x for which the evaluation was called outside the interval (initially is equal the left bound...
unsigned int size_
Number of dividing intervals.