|
World Builder
1.1.0-pre
A geodynamic initial conditions generator
|
#include <utilities.h>
Public Member Functions | |
| void | set_points (const std::vector< double > &y) |
| double | operator() (const double x) const |
| double | operator() (const double x, const size_t idx, const double h) const |
| double | value_inside (const size_t idx, const double h) const |
| double | value_outside (const size_t idx, const double h) const |
Public Attributes | |
| size_t | mx_size_min |
| std::vector< std::array< double, 4 > > | m |
Class for linear and monotone spline interpolation
Definition at line 188 of file utilities.h.
|
inline |
Evaluate at point x.
Definition at line 203 of file utilities.h.
|
inline |
Definition at line 218 of file utilities.h.
| void WorldBuilder::Utilities::interpolation::set_points | ( | const std::vector< double > & | y | ) |
Initialize the spline. This function assumes that all y points are spaced 1 in the x direction.
| y | Values in the interpolation points. |
This monotone spline algorithm is based on the javascript version at https://en.wikipedia.org/wiki/Monotone_cubic_interpolation. The parameters from this algorithm prevent overshooting in the interpolation spline.
Definition at line 1040 of file utilities.cc.

|
inline |
Evaluate at point x. assumes x is between 0 and mx_size_min. assume size_t idx = (size_t)x and h = x-idx.
Definition at line 233 of file utilities.h.
|
inline |
Evaluate at point x. assumes x is between 0 and mx_size_min. assume size_t idx = (size_t)x and h = x-idx.
Definition at line 246 of file utilities.h.
| std::vector<std::array<double,4> > WorldBuilder::Utilities::interpolation::m |
interpolation parameters [ f(x) = a*(x-x_i)^3 + b*(x-x_i)^2 + c*(x-x_i) + y_i ]
Definition at line 265 of file utilities.h.
| size_t WorldBuilder::Utilities::interpolation::mx_size_min |
number of x coordinates of points
Definition at line 257 of file utilities.h.