#include <interpolation.h>
Represent a piecewise linear interpolation.
| T | Type of interpolated values. |
Definition at line 67 of file interpolation.h.
Public Member Functions | |
| InterpolateDataLinear (const std::vector< T > &x, const std::vector< T > &y, ExtrapolationType extrapolation_type=ExtrapolationType::None) | |
| Interpolate function f given discrete samples f(x_i) = y_i. More... | |
| T | operator() (T x) const |
| Calculate linear interpolation at x. More... | |
Private Attributes | |
| std::vector< T > | x_ {} |
| x_i More... | |
| std::vector< InterpolateLinear< T > > | f_ {} |
| Piecewise linear interpolation using f(x_i) More... | |
| ExtrapolationType | extrapolation_type_ = ExtrapolationType::None |
| Extrapolation type. More... | |
| smash::InterpolateDataLinear< T >::InterpolateDataLinear | ( | const std::vector< T > & | x, |
| const std::vector< T > & | y, | ||
| ExtrapolationType | extrapolation_type = ExtrapolationType::None |
||
| ) |
Interpolate function f given discrete samples f(x_i) = y_i.
Piecewise linear interpolation is used.
| x | x-values. |
| y | y-values. |
| extrapolation_type | Type of extrapolation for requested x_i values that are out of bounds. Extrapolation is by default disabled. Possible types are None, Zero, Constant, and Linear. |
| std::invalid_argument | if vectors x and y have different length. |
| std::out_of_range | if values outside of the boundaries of the underlying data are tried to be accessed and extrapolation is disabled. |
| std::invalid_argument | if unsupported extrapolation type is requested. |
Definition at line 186 of file interpolation.h.
| T smash::InterpolateDataLinear< T >::operator() | ( | T | x | ) | const |
Calculate linear interpolation at x.
| x | Interpolation argument. |
| std::out_of_range | if values outside of the boundaries of the underlying data are tried to be accessed and extrapolation is disabled. |
Definition at line 247 of file interpolation.h.
|
private |
x_i
Definition at line 107 of file interpolation.h.
|
private |
Piecewise linear interpolation using f(x_i)
Definition at line 109 of file interpolation.h.
|
private |
Extrapolation type.
Definition at line 111 of file interpolation.h.