A monotone cubic spline.
More...
#include <dumux/common/monotonecubicspline.hh>
template<class Scalar = double>
class Dumux::MonotoneCubicSpline< Scalar >
A monotone cubic spline.
- Note
- Construction after Fritsch & Butland (1984) (see https://doi.org/10.1137/0905021)
-
The resulting interpolation is globally monotone but only C^1
|
| MonotoneCubicSpline ()=default |
| Default constructor. More...
|
|
| MonotoneCubicSpline (const std::vector< Scalar > &x, const std::vector< Scalar > &y) |
| Construct a monotone cubic spline from the control points (x[i], y[i]) More...
|
|
void | updatePoints (const std::vector< Scalar > &x, const std::vector< Scalar > &y) |
| Create a monotone cubic spline from the control points (x[i], y[i]) More...
|
|
Scalar | eval (const Scalar x) const |
| Evaluate the y value at a given x value. More...
|
|
Scalar | evalDerivative (const Scalar x) const |
| Evaluate the first derivative dy/dx at a given x value. More...
|
|
Scalar | evalInverse (const Scalar y) const |
| Evaluate the inverse function. More...
|
|
◆ MonotoneCubicSpline() [1/2]
template<class Scalar = double>
◆ MonotoneCubicSpline() [2/2]
template<class Scalar = double>
Construct a monotone cubic spline from the control points (x[i], y[i])
- Note
- if the data set is monotone, monotonicity is preserved
- Parameters
-
x | a vector of x-coordinates |
y | a vector of y-coordinates |
◆ eval()
template<class Scalar = double>
Evaluate the y value at a given x value.
- Parameters
-
- Note
- We extrapolate linearly if out of bounds
◆ evalDerivative()
template<class Scalar = double>
Evaluate the first derivative dy/dx at a given x value.
- Parameters
-
- Note
- We extrapolate linearly if out of bounds
◆ evalInverse()
template<class Scalar = double>
Evaluate the inverse function.
- Parameters
-
- Note
- We extrapolate linearly if out of bounds
-
Throws exception if inverse could not be found (e.g. not unique)
◆ updatePoints()
template<class Scalar = double>
Create a monotone cubic spline from the control points (x[i], y[i])
- Parameters
-
x | a vector of x-coordinates |
y | a vector of y-coordinates |
The documentation for this class was generated from the following file: