atomicrex  0.1
An advanced atomistic model building tool
Public Member Functions | List of all members
atomicrex::CubicSpline Class Reference

#include <CubicSpline.h>

Public Member Functions

 CubicSpline ()
 Default constructor.
 
void init (int N, double derivStart, double derivEnd)
 Initialization of the spline function.
 
void setKnot (int i, double x, double y)
 Sets the position of a knot of the spline function.
 
int knotCount () const
 Returns the number of knots.
 
double derivStart () const
 Returns first derivative of spline function at knot 0.
 
double derivEnd () const
 Returns first derivative of spline function at the last knot.
 
double knotX (int i) const
 Returns the X coordinate of the i-th knot.
 
double knotY (int i) const
 Returns the Y coordinate of the i-th knot.
 
double knotY2 (int i) const
 Returns the second derivative at the i-th knot.
 
void prepareSpline ()
 Calculates the second derivatives of the cubic spline.
 
double eval (double x) const
 Evaluates the spline function at position x.
 
double eval (double x, double &deriv) const
 Evaluates the spline function and its first derivative at position x.
 
double cutoff () const
 Returns the cutoff radius of this spline function.
 
void writeGnuplot (const FPString &filename, const FPString &title) const
 Create a Gnuplot script that displays the spline function.
 

Detailed Description

A one-dimensional cubic spline function.

The spline consists of N knots with coordinates (x,y) ordered along the x-axis.

The first derivative of the function must be explicitly specified at the first and the last knot.


The documentation for this class was generated from the following files: