This class applies the Least Squares algorithm to a set of points to provide a smooth curve for sampling values. More...
#include <BilinearInterpolation.h>
Public Member Functions | |
BilinearInterpolation (const std::vector< Real > &xaxis, const std::vector< Real > &yaxis, const ColumnMajorMatrix &zsurface) | |
Constructor, Takes two vectors of points for which to apply the fit. More... | |
virtual | ~BilinearInterpolation ()=default |
Real | sample (const Real s1, const Real s2) const override |
This function will take an independent variable input and will return the dependent variable based on the generated fit. More... | |
ADReal | sample (const ADReal &s1, const ADReal &s2) const override |
ChainedReal | sample (const ChainedReal &s1, const ChainedReal &s2) const override |
Real | sampleDerivative (const Real s1, const Real s2, unsigned int deriv_var) const override |
Samples first derivative at point (s1, s2) More... | |
ADReal | sampleDerivative (const ADReal &s1, const ADReal &s2, unsigned int deriv_var) const override |
ChainedReal | sampleDerivative (const ChainedReal &s1, const ChainedReal &s2, unsigned int deriv_var) const override |
void | sampleValueAndDerivatives (Real s1, Real s2, Real &y, Real &dy_ds1, Real &dy_ds2) const override |
Samples value and first derivatives at point (x1, x2) Use this function for speed when computing both value and derivatives, as it minimizes the amount of time spent locating the point in the tabulated data. More... | |
void | getNeighborIndices (const std::vector< Real > &inArr, Real x, unsigned int &lowerX, unsigned int &upperX) const |
virtual void | sampleValueAndDerivatives (Real, Real, Real &, Real &, Real &) const |
Samples value and first derivatives at point (x1, x2) Use this function for speed when computing both value and derivatives, as it minimizes the amount of time spent locating the point in the tabulated data. More... | |
virtual void | sampleValueAndDerivatives (const ADReal &, const ADReal &, ADReal &, ADReal &, ADReal &) const |
virtual void | sampleValueAndDerivatives (const ChainedReal &, const ChainedReal &, ChainedReal &, ChainedReal &, ChainedReal &) const |
virtual Real | sample2ndDerivative (Real, Real, unsigned int) const |
Samples second derivative at point (x1, x2) More... | |
virtual void | sampleValueAndDerivatives (const ADReal &, const ADReal &, ADReal &, ADReal &, ADReal &) const |
virtual void | sampleValueAndDerivatives (const ChainedReal &, const ChainedReal &, ChainedReal &, ChainedReal &, ChainedReal &) const |
Public Attributes | |
std::vector< Real > | _x1 |
Independent values in the x1 direction. More... | |
std::vector< Real > | _x2 |
Independent values in the x2 direction. More... | |
Private Member Functions | |
template<typename T > | |
T | sampleInternal (const T &s1, const T &s2) const |
sampleInternal only used by BilinearInterpolation, hence made private More... | |
template<typename T > | |
T | sampleDerivativeInternal (const T s1, const T s2, const unsigned int deriv_var) const |
Private Attributes | |
ColumnMajorMatrix | _z_surface |
Static Private Attributes | |
static int | _file_number = 0 |
This class applies the Least Squares algorithm to a set of points to provide a smooth curve for sampling values.
BilinearInterpolation is designed to linearly interpolate a function of two values e.g. z(x,y). Supply Bilinearlinear with a vector of x and a vector of y and a ColumnMajorMatrix of function values, z, that correspond to the values in the vectors x and y...and also a sample point (s1 and s2), and BilinearInterpolation will return the value of the function at the sample point. A simple example:
x = [1 2], y = [1 2],
z = [1 2] [3 4]
with s1 = 1.5 and s2 = 1.5 returns a value of 2.5.
Definition at line 37 of file BilinearInterpolation.h.
BilinearInterpolation::BilinearInterpolation | ( | const std::vector< Real > & | xaxis, |
const std::vector< Real > & | yaxis, | ||
const ColumnMajorMatrix & | zsurface | ||
) |
Constructor, Takes two vectors of points for which to apply the fit.
One should be of the independent variable while the other should be of the dependent variable. These values should correspond to one and other in the same position.
Definition at line 15 of file BilinearInterpolation.C.
|
virtualdefault |
void BilinearInterpolation::getNeighborIndices | ( | const std::vector< Real > & | inArr, |
Real | x, | ||
unsigned int & | lowerX, | ||
unsigned int & | upperX | ||
) | const |
Definition at line 23 of file BilinearInterpolation.C.
Referenced by sampleDerivativeInternal(), and sampleInternal().
This function will take an independent variable input and will return the dependent variable based on the generated fit.
Implements BidimensionalInterpolation.
Definition at line 60 of file BilinearInterpolation.C.
Referenced by sampleValueAndDerivatives().
Implements BidimensionalInterpolation.
Definition at line 66 of file BilinearInterpolation.C.
|
overridevirtual |
Implements BidimensionalInterpolation.
Definition at line 72 of file BilinearInterpolation.C.
|
inlinevirtualinherited |
Samples second derivative at point (x1, x2)
Reimplemented in BicubicInterpolation.
Definition at line 73 of file BidimensionalInterpolation.h.
|
overridevirtual |
Samples first derivative at point (s1, s2)
Reimplemented from BidimensionalInterpolation.
Definition at line 125 of file BilinearInterpolation.C.
Referenced by sampleValueAndDerivatives().
|
overridevirtual |
Reimplemented from BidimensionalInterpolation.
Definition at line 131 of file BilinearInterpolation.C.
|
overridevirtual |
Reimplemented from BidimensionalInterpolation.
Definition at line 139 of file BilinearInterpolation.C.
|
private |
Definition at line 148 of file BilinearInterpolation.C.
Referenced by sampleDerivative().
|
private |
sampleInternal only used by BilinearInterpolation, hence made private
Definition at line 79 of file BilinearInterpolation.C.
Referenced by sample().
|
inline |
Samples value and first derivatives at point (x1, x2) Use this function for speed when computing both value and derivatives, as it minimizes the amount of time spent locating the point in the tabulated data.
Definition at line 84 of file BidimensionalInterpolation.h.
|
inline |
Definition at line 99 of file BidimensionalInterpolation.h.
|
inline |
Definition at line 90 of file BidimensionalInterpolation.h.
|
overridevirtual |
Samples value and first derivatives at point (x1, x2) Use this function for speed when computing both value and derivatives, as it minimizes the amount of time spent locating the point in the tabulated data.
Reimplemented from BidimensionalInterpolation.
Definition at line 602 of file BilinearInterpolation.C.
|
inlinevirtualinherited |
Reimplemented in BicubicInterpolation.
Definition at line 90 of file BidimensionalInterpolation.h.
|
inlinevirtualinherited |
Reimplemented in BicubicInterpolation.
Definition at line 99 of file BidimensionalInterpolation.h.
|
staticprivate |
Definition at line 88 of file BilinearInterpolation.h.
|
inherited |
Independent values in the x1 direction.
Definition at line 37 of file BidimensionalInterpolation.h.
Referenced by BicubicInterpolation::BicubicInterpolation(), BicubicInterpolation::errorCheck(), BicubicInterpolation::precomputeCoefficients(), BicubicInterpolation::sample2ndDerivative(), BicubicInterpolation::sampleDerivative(), sampleDerivativeInternal(), sampleInternal(), BicubicInterpolation::sampleInternal(), BicubicInterpolation::sampleValueAndDerivativesInternal(), and BicubicInterpolation::tableDerivatives().
|
inherited |
Independent values in the x2 direction.
Definition at line 39 of file BidimensionalInterpolation.h.
Referenced by BicubicInterpolation::BicubicInterpolation(), BicubicInterpolation::errorCheck(), BicubicInterpolation::precomputeCoefficients(), BicubicInterpolation::sample2ndDerivative(), BicubicInterpolation::sampleDerivative(), sampleDerivativeInternal(), sampleInternal(), BicubicInterpolation::sampleInternal(), BicubicInterpolation::sampleValueAndDerivativesInternal(), and BicubicInterpolation::tableDerivatives().
|
private |
Definition at line 87 of file BilinearInterpolation.h.
Referenced by sampleDerivativeInternal(), and sampleInternal().