herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
exsample::linear_interpolator Class Reference

A linear interpolation allowing for inversion of the linear interpolation. More...

#include <linear_interpolator.h>

Public Member Functions

 linear_interpolator ()
 default constructor
 
 linear_interpolator (const std::map< double, double > &points)
 construct a linear interpolator given the map of interpolation points and values
 
double operator() (double x) const
 return the interpolations value at the given point
 
std::pair< double, double > range () const
 return the range of the interpolation
 
bool invertible (double f) const
 return true, if an inverse exists for the given value
 
double unique_inverse (double f) const
 return the inverse, assuming the inverse is unique
 
std::map< double, double > & interpolation ()
 access the interpolation map
 
void set_interpolation (double point, double value)
 set the value at the given point
 
void reset ()
 reset after interpolation points have been changed
 
template<class OStream >
void put (OStream &os) const
 put to ostream
 
template<class IStream >
void get (IStream &is)
 get from istream
 

Private Attributes

std::map< double, double > interpolation_
 map points to values
 
std::pair< double, double > range_
 the range of the interpolation
 

Detailed Description

A linear interpolation allowing for inversion of the linear interpolation.

Definition at line 42 of file linear_interpolator.h.

Member Function Documentation

◆ interpolation()

std::map< double, double > & exsample::linear_interpolator::interpolation ( )
inline

access the interpolation map

Definition at line 75 of file linear_interpolator.h.

References interpolation_.

◆ invertible()

bool exsample::linear_interpolator::invertible ( double  f) const
inline

return true, if an inverse exists for the given value

Definition at line 65 of file linear_interpolator.h.

References range_.

◆ range()

std::pair< double, double > exsample::linear_interpolator::range ( ) const
inline

return the range of the interpolation

Definition at line 59 of file linear_interpolator.h.

References range_.

Member Data Documentation

◆ interpolation_

std::map<double, double> exsample::linear_interpolator::interpolation_
private

map points to values

Definition at line 98 of file linear_interpolator.h.

Referenced by interpolation().

◆ range_

std::pair<double,double> exsample::linear_interpolator::range_
private

the range of the interpolation

Definition at line 101 of file linear_interpolator.h.

Referenced by invertible(), and range().


The documentation for this class was generated from the following file: