UFO
ufo::PiecewiseLinearInterpolation Class Reference

Represents a piecewise linear interpolation of a set of data points. More...

#include <PiecewiseLinearInterpolation.h>

Public Member Functions

 PiecewiseLinearInterpolation (std::vector< double > sortedAbscissas, std::vector< double > ordinates)
 Create an object representing a piecewise linear interpolation of the data points (sortedAbscissas[i], ordinates[i]). More...
 
double operator() (double abscissa) const
 Evaluate the interpolated function at abscissa. More...
 

Static Public Member Functions

static double interpolate (const std::vector< double > &sortedAbscissas, const std::vector< double > &ordinates, double abscissa)
 Convenience function interpolating the data points (sortedAbscissas[i], ordinates[i]) at abscissa without creating a PiecewiseLinearInterpolation object. More...
 

Private Attributes

std::vector< double > abscissas_
 
std::vector< double > ordinates_
 

Detailed Description

Represents a piecewise linear interpolation of a set of data points.

Definition at line 16 of file src/ufo/utils/PiecewiseLinearInterpolation.h.

Constructor & Destructor Documentation

◆ PiecewiseLinearInterpolation()

ufo::PiecewiseLinearInterpolation::PiecewiseLinearInterpolation ( std::vector< double >  sortedAbscissas,
std::vector< double >  ordinates 
)

Create an object representing a piecewise linear interpolation of the data points (sortedAbscissas[i], ordinates[i]).

Both arguments must have the same length and be non-empty. The elements of sortedAbscissas must be sorted.

Definition at line 16 of file PiecewiseLinearInterpolation.cc.

Member Function Documentation

◆ interpolate()

double ufo::PiecewiseLinearInterpolation::interpolate ( const std::vector< double > &  sortedAbscissas,
const std::vector< double > &  ordinates,
double  abscissa 
)
static

Convenience function interpolating the data points (sortedAbscissas[i], ordinates[i]) at abscissa without creating a PiecewiseLinearInterpolation object.

Definition at line 32 of file PiecewiseLinearInterpolation.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator()()

double ufo::PiecewiseLinearInterpolation::operator() ( double  abscissa) const

Evaluate the interpolated function at abscissa.

Definition at line 28 of file PiecewiseLinearInterpolation.cc.

Here is the call graph for this function:

Member Data Documentation

◆ abscissas_

std::vector<double> ufo::PiecewiseLinearInterpolation::abscissas_
private

Definition at line 37 of file src/ufo/utils/PiecewiseLinearInterpolation.h.

◆ ordinates_

std::vector<double> ufo::PiecewiseLinearInterpolation::ordinates_
private

Definition at line 38 of file src/ufo/utils/PiecewiseLinearInterpolation.h.


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