Storage container for a smoothed linear spline interpolation.
More...
#include <smooth_linear_spline.hpp>
|
template<typename OutputStream > |
OutputStream & | operator<< (OutputStream &ostream, const SmoothLinearSpline &smooth_linear_spline) |
| Streaming output insertion operator for smoothed linear splines. More...
|
|
Storage container for a smoothed linear spline interpolation.
These interpolations connect waypoints linearly and add a smoothed corner (using a quintic polynomial) to connect each linear segment. The shape of the corners is parameterised with a maximum curvature parameter (acceleration).
Math::Splines.
Definition at line 45 of file smooth_linear_spline.hpp.
◆ SmoothLinearSpline() [1/2]
ecl::SmoothLinearSpline::SmoothLinearSpline |
( |
| ) |
|
|
inline |
Default constructor.
Don't really need this, but things like vectors and array containers need it so they can reserve the appropriate storage.
Definition at line 53 of file smooth_linear_spline.hpp.
◆ SmoothLinearSpline() [2/2]
ecl::SmoothLinearSpline::SmoothLinearSpline |
( |
const Array< double > & |
x_data, |
|
|
const Array< double > & |
y_data, |
|
|
double |
a_max |
|
) |
| |
Constructor that properly configures the ramped spline.
The constructor uses the input data sets to initialise the segmentation. Corners are constrained by the maximum curvature (acceleration) - if construction should fail (not enough space between the waypoints) then this method will throw an exception indicating failure. It is accompanied with an int type data element that indicates the number of the segment that failed to construct. Failure typically occurs because the maximum curvature constraint at the corner was broken. Try increasing the maximum curvature constraint or increasing the time duration of the specified segment to ensure success a second time around.
- Parameters
-
a_max | : the maximum bound (absolute) on the acceleration. |
x_data | : set of data on the domain axis. |
y_data | : set of values on the range axis. |
- Exceptions
-
| DataException : throws if the spline could not be constructed because of broken a_max constraint. |
The int data for the exception represents the element in the set which could not make a corner without breaking the acceleration constraint. Note that if you have a data set of size 5 (i.e. elements 0-4), then it will only throw between 1 and 3, as this is where smoothed corners are built.
Definition at line 30 of file smooth_linear_spline.cpp.
◆ ~SmoothLinearSpline()
virtual ecl::SmoothLinearSpline::~SmoothLinearSpline |
( |
| ) |
|
|
inlinevirtual |
◆ dderivative()
double ecl::SmoothLinearSpline::dderivative |
( |
const double & |
x | ) |
const |
Spline second derivative.
Extract the second derivative of the spline.
- Parameters
-
- Returns
- double : the second derivative of the spline.
- Exceptions
-
Definition at line 138 of file smooth_linear_spline.cpp.
◆ derivative()
double ecl::SmoothLinearSpline::derivative |
( |
const double & |
x | ) |
const |
Spline derivative.
Extract the derivative of the spline at the indicated value.
- Parameters
-
- Returns
- double : the derivative of the spline.
- Exceptions
-
Definition at line 125 of file smooth_linear_spline.cpp.
◆ domain()
const Array<double>& ecl::SmoothLinearSpline::domain |
( |
| ) |
const |
|
inline |
The discretised domain for this spline.
This returns the array of discretised time values that define the domains of each polynomial within the spline.
- Returns
- const Array<double>& : the discretised domain.
Definition at line 120 of file smooth_linear_spline.hpp.
◆ Interpolation()
static SmoothLinearSpline ecl::SmoothLinearSpline::Interpolation |
( |
const Array< double > & |
x_data, |
|
|
const Array< double > & |
y_data, |
|
|
double |
a_max |
|
) |
| |
|
inlinestatic |
Static construction that interpolates on a set of waypoints.
Static construction that interpolates on a set of waypoints.
- Parameters
-
x_data | : set of data on the domain axis. |
y_data | : set of values on the range axis. |
a_max | : the maximum bound (absolute) on the acceleration. |
- Exceptions
-
| DataException : throws if the spline could not be constructed, data is the segment # that failed. |
Definition at line 136 of file smooth_linear_spline.hpp.
◆ operator()()
double ecl::SmoothLinearSpline::operator() |
( |
const double & |
x | ) |
const |
Spline function.
Extract the spline function's value at the indicated location.
- Parameters
-
- Returns
- double : the spline function's value.
- Exceptions
-
Definition at line 112 of file smooth_linear_spline.cpp.
◆ operator<<
template<typename OutputStream >
OutputStream& operator<< |
( |
OutputStream & |
ostream, |
|
|
const SmoothLinearSpline & |
smooth_linear_spline |
|
) |
| |
|
friend |
Streaming output insertion operator for smoothed linear splines.
Streaming output insertion operator for smoothed linear splines. This simply lists the spline segments and corners (linear functions and quintic polynomials) in algebraic form.
- Template Parameters
-
OutputStream | : the type of stream being used. |
- Parameters
-
ostream | : the output stream being used. |
smooth_linear_spline | : the tension spline. |
- Returns
- OutputStream : the output stream.
Definition at line 176 of file smooth_linear_spline.hpp.
◆ corners
◆ discretised_domain
Array<double> ecl::SmoothLinearSpline::discretised_domain |
|
private |
◆ segments
The documentation for this class was generated from the following files: