![]() |
OGS
|
This class implements a one dimensional piecewise constant interpolation algorithm.
Definition at line 26 of file PiecewiseConstantInterpolation.h.
#include <PiecewiseConstantInterpolation.h>
Public Member Functions | |
PiecewiseConstantInterpolation (std::vector< T > const &supporting_points, std::vector< double > const &values_at_supp_pnts) | |
double | value (double const pnt_to_interpolate) const |
Calculates the interpolation value. | |
Private Attributes | |
std::vector< T > const & | supp_pnts_ |
std::vector< double > const & | values_at_supp_pnts_ |
|
inline |
The constructor stores the vector of supporting points \((x_0, x_1, \dots, x_n)\) and the entries of the vector of values at the supporting points \((y_0, y_1, \dots, y_n)\) where \(n\) is the number of entries of the vector. The number of supporting points must be equal to the number of values at the supporting points. It is assumed that \(x_j\) corresponds to \(y_j\) for all \(j \in [0, n]\).
Furthermore, it is assumed that the supporting points are sorted, i.e. \(x_0 < x_1 < \dots < x_n\).
supporting_points | vector of supporting points |
values_at_supp_pnts | vector of values at the supporting points one can set the switch to true |
Definition at line 44 of file PiecewiseConstantInterpolation.h.
References MathLib::PiecewiseConstantInterpolation< T >::supp_pnts_, and MathLib::PiecewiseConstantInterpolation< T >::values_at_supp_pnts_.
|
inline |
Calculates the interpolation value.
pnt_to_interpolate | The point the interpolation value is calculated for. If the pnt_to_interpolate is outside the interval \([x_{\min},
x_{\max}]\), where \(x_{\min} = \min_{1 \le j \le n} x_j\) and \(x_{\max} = \max_{1 \le j \le n} x_j\). If point_to_interpolate is smaller than \(x_{\min}\) then \(y_{\min}\) is returned. Analogously, if the point_to_interpolate is greater than \(x_{\max}\) then \(y_{\max}\) is returned. |
Definition at line 76 of file PiecewiseConstantInterpolation.h.
References MathLib::PiecewiseConstantInterpolation< T >::supp_pnts_, and MathLib::PiecewiseConstantInterpolation< T >::values_at_supp_pnts_.
|
private |
Definition at line 98 of file PiecewiseConstantInterpolation.h.
Referenced by MathLib::PiecewiseConstantInterpolation< T >::PiecewiseConstantInterpolation(), and MathLib::PiecewiseConstantInterpolation< T >::value().
|
private |
Definition at line 99 of file PiecewiseConstantInterpolation.h.
Referenced by MathLib::PiecewiseConstantInterpolation< T >::PiecewiseConstantInterpolation(), and MathLib::PiecewiseConstantInterpolation< T >::value().