Ignis
Loading...
Searching...
No Matches
linearInterp Class Reference

#include <linearInterp.h>

Public Member Functions

double interp (double x)
 
 linearInterp ()
 Default (empty) constructor.
 
 linearInterp (std::vector< double > &_X, std::vector< double > &_Y)
 

Public Attributes

std::vector< double > * X
 abscissas for Y(X)
 
std::vector< double > * Y
 ordinate values for Y(X)
 
int nxy
 number of grid points
 

Private Member Functions

void set_bounding_indicies (double x)
 

Private Attributes

int ilo
 lower of adjacent bounding grid points for desired interpolation point
 
int ihi
 upper of adjacent bounding grid points for desired interpolation point
 

Detailed Description

Linear interpolation class (one-dimensional) Header-only class

Definition at line 14 of file linearInterp.h.

Constructor & Destructor Documentation

◆ linearInterp() [1/2]

linearInterp::linearInterp ( )
inline

Default (empty) constructor.

Definition at line 63 of file linearInterp.h.

◆ linearInterp() [2/2]

linearInterp::linearInterp ( std::vector< double > &  _X,
std::vector< double > &  _Y 
)
inline

constructor function

Parameters
_Xgrid of abscissas forming the basis for interpolation
_Ygrid of ordinate values _Y(_X) forming the basis for interpolation

Definition at line 68 of file linearInterp.h.

Member Function Documentation

◆ interp()

double linearInterp::interp ( double  x)
inline

Interpolation function for arbitrary point x.

Parameters
xinput: grid value we are interpolating to (abscissa)
Returns
interpolated value y(x)

Definition at line 35 of file linearInterp.h.

Here is the call graph for this function:

◆ set_bounding_indicies()

void linearInterp::set_bounding_indicies ( double  x)
inlineprivate

find values of ilo and ihi using a search algorithm from stl

Parameters
xinput: grid value we are interpolating to (abscissa)

Definition at line 44 of file linearInterp.h.

Here is the caller graph for this function:

Member Data Documentation

◆ X

std::vector<double>* linearInterp::X

abscissas for Y(X)

Definition at line 18 of file linearInterp.h.

◆ Y

std::vector<double>* linearInterp::Y

ordinate values for Y(X)

Definition at line 19 of file linearInterp.h.

◆ nxy

int linearInterp::nxy

number of grid points

Definition at line 21 of file linearInterp.h.

◆ ilo

int linearInterp::ilo
private

lower of adjacent bounding grid points for desired interpolation point

Definition at line 25 of file linearInterp.h.

◆ ihi

int linearInterp::ihi
private

upper of adjacent bounding grid points for desired interpolation point

Definition at line 26 of file linearInterp.h.


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