votca 2024.2-dev
|
#include <spline.h>
Public Types | |
enum | eBoundary { splineNormal = 0 , splinePeriodic = 1 , splineDerivativeZero = 2 } |
enum for type of boundary condition More... | |
Public Member Functions | |
Spline ()=default | |
virtual | ~Spline ()=default |
virtual void | Interpolate (const Eigen::VectorXd &x, const Eigen::VectorXd &y)=0 |
Calculate interpolating spline for given (x,y) values. Points on resulting spline can be obtained via Calculate(). | |
virtual void | Fit (const Eigen::VectorXd &x, const Eigen::VectorXd &y)=0 |
Fit spline through noisy (x,y) values. Points on resulting fitted spline can be obtained via Calculate(). | |
virtual double | Calculate (double x)=0 |
Calculate spline function value for a given x value on the spline created by Interpolate() or Fit() | |
virtual double | CalculateDerivative (double x)=0 |
Calculate y value for a given x value on the derivative of the spline created by function Interpolate or Fit. | |
void | setBC (eBoundary bc) |
Set the boundary type of the spline. | |
void | setBCInt (Index bc) |
Set the boundary type of the spline. | |
double | getGridPoint (int i) |
Get the grid point of certain index. | |
Eigen::VectorXd | Calculate (const Eigen::VectorXd &x) |
Calculate spline function values for given x values on the spline created by Interpolate() or Fit() | |
Eigen::VectorXd | CalculateDerivative (const Eigen::VectorXd &x) |
Calculate y values for given x values on the derivative of the spline created by function Interpolate or Fit. | |
void | Print (std::ostream &out, double interval) |
Print spline values (using Calculate()) on output "out" on the entire grid in steps of "interval". | |
Index | getInterval (double r) |
Determine the index of the interval containing value r. | |
Index | GenerateGrid (double min, double max, double h) |
Generate the grid for fitting from "min" to "max" in steps of "h". | |
Eigen::VectorXd & | getX () |
Get the grid array x. | |
const Eigen::VectorXd & | getX () const |
Protected Attributes | |
eBoundary | boundaries_ = eBoundary::splineNormal |
Get the spline data f_. | |
Eigen::VectorXd | r_ |
Spline Class.
class supports spline interpolation and fit of data the cubic spline class, akima spline class and linear spline class are inherited from this one
|
default |
|
virtualdefault |
Eigen::VectorXd votca::tools::Spline::Calculate | ( | const Eigen::VectorXd & | x | ) |
Calculate spline function values for given x values on the spline created by Interpolate() or Fit()
x | vector of data values |
|
pure virtual |
Calculate spline function value for a given x value on the spline created by Interpolate() or Fit()
x | data value |
Implemented in votca::tools::AkimaSpline, votca::tools::CubicSpline, and votca::tools::LinSpline.
Eigen::VectorXd votca::tools::Spline::CalculateDerivative | ( | const Eigen::VectorXd & | x | ) |
|
pure virtual |
Calculate y value for a given x value on the derivative of the spline created by function Interpolate or Fit.
x | data value |
Implemented in votca::tools::AkimaSpline, votca::tools::CubicSpline, and votca::tools::LinSpline.
|
pure virtual |
Fit spline through noisy (x,y) values. Points on resulting fitted spline can be obtained via Calculate().
x | values of data to be fitted |
y | values of data to be fitted both vectors must be of same size |
Implemented in votca::tools::AkimaSpline, votca::tools::CubicSpline, and votca::tools::LinSpline.
Index votca::tools::Spline::GenerateGrid | ( | double | min, |
double | max, | ||
double | h ) |
double votca::tools::Spline::getGridPoint | ( | int | i | ) |
Index votca::tools::Spline::getInterval | ( | double | r | ) |
|
inline |
|
inline |
|
pure virtual |
Calculate interpolating spline for given (x,y) values. Points on resulting spline can be obtained via Calculate().
x | values of data to be interpolated |
y | values of data to be interpolated both vectors must be of same size |
Implemented in votca::tools::AkimaSpline, votca::tools::CubicSpline, and votca::tools::LinSpline.
void votca::tools::Spline::Print | ( | std::ostream & | out, |
double | interval ) |
Print spline values (using Calculate()) on output "out" on the entire grid in steps of "interval".
out | output |
interval | size of "interval" |
|
inline |
|
inline |
|
protected |