iterative-solver 0.0
molpro::linalg::itsolv::Interpolator< value_type > Class Template Reference

The interpolant, in the precision of the problem it is used for. More...

#include <Interpolate.h>

Detailed Description

template<typename value_type = double>
class molpro::linalg::itsolv::Interpolator< value_type >

The interpolant, in the precision of the problem it is used for.

The parameter is a real type, and names a precision rather than a scalar type: minimising a function presupposes that its values are ordered, so a complex instantiation is meaningless and is rejected below. What varies is how accurately the line search is carried out. Optimize passes value_type_abs, which for a std::complex<double> container is double, and for a long double one is long double – the case this template exists for, since narrowing the function values and gradients to double would cap the line search at double precision however the solver was instantiated.

See also
Interpolate for the double-precision specialisation, which is the historical name and the one used throughout the double-precision API.

Classes

struct  point
 

Public Types

using value_t = value_type
 

Public Member Functions

 Interpolator (point p0, point p1, std::string interpolant="cubic", int verbosity=0)
 Construct the interpolant. More...
 
point operator() (value_type x) const
 Evaluate the interpolant and its derivative at a given point. More...
 
point minimize (value_type xa, value_type xb, size_t bracket_grid=100, size_t max_bracket_grid=100000, bool analytic=true) const
 Find the minimum of the interpolant within a range. More...
 
point minimize_cubic () const
 
const std::vector< value_type > & parameters () const
 

Static Public Member Functions

static std::vector< std::string > interpolants ()
 

Member Typedef Documentation

◆ value_t

template<typename value_type = double>
using molpro::linalg::itsolv::Interpolator< value_type >::value_t = value_type

Constructor & Destructor Documentation

◆ Interpolator()

template<typename value_type >
molpro::linalg::itsolv::Interpolator< value_type >::Interpolator ( point  p0,
point  p1,
std::string  interpolant = "cubic",
int  verbosity = 0 
)
explicit

Construct the interpolant.

Parameters
p0Defining point
p1Defining point
interpolantThe interpolation method. An exception is thrown if it is not one of the implemented values.
verbosityValues greater than zero show information on constructing and using the interpolant.

Member Function Documentation

◆ interpolants()

template<typename value_type >
std::vector< std::string > molpro::linalg::itsolv::Interpolator< value_type >::interpolants
static

◆ minimize()

template<typename value_type >
Interpolator< value_type >::point molpro::linalg::itsolv::Interpolator< value_type >::minimize ( value_type  xa,
value_type  xb,
size_t  bracket_grid = 100,
size_t  max_bracket_grid = 100000,
bool  analytic = true 
) const

Find the minimum of the interpolant within a range.

Parameters
xafirst bound of range
xbsecond bound of range
bracket_gridnumber of intervals in |xa-xb|, to be considered in initial bracketing of the minimum. Large values result in many function evaluations, but if set too small in cases of multiple minima, the global minimum may not be found.
Returns
The minimum point. The result may be one of Interpolate(xa), Interpolate(xb) with non-zero first derivative, if no other minimum was found in the interval

◆ minimize_cubic()

template<typename value_type >
Interpolator< value_type >::point molpro::linalg::itsolv::Interpolator< value_type >::minimize_cubic

◆ operator()()

template<typename value_type >
Interpolator< value_type >::point molpro::linalg::itsolv::Interpolator< value_type >::operator() ( value_type  x) const

Evaluate the interpolant and its derivative at a given point.

Parameters
x
Returns

◆ parameters()

template<typename value_type = double>
const std::vector< value_type > & molpro::linalg::itsolv::Interpolator< value_type >::parameters ( ) const
inline