PSCF v1.1
List of all members
Util::CardinalBSpline Class Reference

A cardinal B-spline basis function. More...

#include <CardinalBSpline.h>

Constructor and Destructor

 CardinalBSpline (int degree, bool verbose=false)
 Construct a spline basis of specified degree. More...
 
 ~CardinalBSpline ()
 Destructor. More...
 
Polynomial< double > const & operator[] (int i) const
 Get Polynomial<double> object for domain [i,i+1]. More...
 
double operator() (double x) const
 Compute the value of the spline basis function. More...
 
int degree () const
 Return degree of basis function (i.e., degree of polynomials). More...
 

Detailed Description

A cardinal B-spline basis function.

A cardinal B-Spline of order m or degree k = m - 1 is a piecewise continuous polynomial of degree k defined over the domain [0, k+1]. Such a function is defined by k different polynomials, each of which has a domain [i, i+1] for an integer i with 0 <= i <=k. For k > 0, the function and k-1 derivatives are continuous.

A CardinalBSpline object of degree k has k Polynomial<double> objects, indexed by an integer 0 <= i <= k, each of which defines the polynomial with a domain [i,i+1].

If object b is a CardinalBSpline of degree k, then:

Definition at line 42 of file CardinalBSpline.h.

Constructor & Destructor Documentation

◆ CardinalBSpline()

Util::CardinalBSpline::CardinalBSpline ( int  degree,
bool  verbose = false 
)

Construct a spline basis of specified degree.

Parameters
degreedegree of the function (i.e., degree of polynomials)
verboseif true, write verbose report to std::cout

Definition at line 17 of file CardinalBSpline.cpp.

References Util::DArray< Data >::allocate(), degree(), and UTIL_CHECK.

◆ ~CardinalBSpline()

Util::CardinalBSpline::~CardinalBSpline ( )

Destructor.

Definition at line 125 of file CardinalBSpline.cpp.

Member Function Documentation

◆ operator[]()

Polynomial< double > const & Util::CardinalBSpline::operator[] ( int  i) const
inline

Get Polynomial<double> object for domain [i,i+1].

If b is a CardinalBSpline, b[i] returns the Polynomial<double> object (the polynomial with double precision floating point coefficients) associated with the domain [i,i+1].

Parameters
iinteger index in range 0 <= i <= degree.
Returns
polynomial associated with domain [i, i+1]

Definition at line 119 of file CardinalBSpline.h.

◆ operator()()

double Util::CardinalBSpline::operator() ( double  x) const
inline

Compute the value of the spline basis function.

If b is a CardinalBSpline, b(x) returns the value of the spline function for specified floating point argument x, giving a nonzero value only for 0 < x < degree + 1.

Parameters
xargument of spline basis function

Definition at line 126 of file CardinalBSpline.h.

References UTIL_ASSERT.

◆ degree()

int Util::CardinalBSpline::degree ( ) const
inline

Return degree of basis function (i.e., degree of polynomials).

Definition at line 139 of file CardinalBSpline.h.

Referenced by CardinalBSpline().


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