ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ModuleBase::Bspline Class Reference

A class to treat Cardinal B-spline interpolation. More...

#include <math_bspline.h>

Collaboration diagram for ModuleBase::Bspline:

Public Member Functions

 Bspline ()
 
 ~Bspline ()
 
void init (int norderin, double Dxin, double xiin)
 
void getbspline (double x)
 
double bezier_ele (int n)
 

Private Attributes

int norder
 
double Dx
 
double xi
 
double * bezier
 

Detailed Description

A class to treat Cardinal B-spline interpolation.

Author
qianrui created 2021-09-14

see: J. Chem. Phys. 103, 8577 (1995). Math: Only uniform nodes are considered: xm-x[m-1]=Dx(>= 0) for control node: X={x0,x1,...,xm}; Any function p(x) can be written by p(x)=\sum_i{ci*M_ik(x)} (k->infinity), where M_ik is the i-th k-order Cardinal B-spline base function and ci is undetermined coefficient. M_i0 = H(x-xi)-H(x-x[i+1]), H(x): step function x-xi x[i+k+1]-x M_ik(x)= ------—*M_i(k-1)(x)+ -------------—*M_[i+1][k-1](x) ( xi <= x <= x[i+1] ) x[i+k]-xi x[i+k+1]-x[i+1] For uniform nodes: M_[i+1]k(x+Dx)=M_ik(x) If we define Bk[n] stores M_ik(x+n*Dx) for x in (xi,xi+Dx): x+n*Dx-xi xi+(k-n+1)*Dx-x Bk[n] = --------—*B(k-1)[n] + --------------—*B(k-1)[n-1] k*Dx k*Dx USAGE: ModuleBase::Bspline bp; bp.init(10,0.7,2); //Dx = 0.7, xi = 2 bp.getbslpine(0.5); //x = 0.5 cout<<bp.bezier_ele(3)<<endl; //print M_ik[xi+3*Dx+x]: M_i10

Constructor & Destructor Documentation

◆ Bspline()

ModuleBase::Bspline::Bspline ( )

◆ ~Bspline()

ModuleBase::Bspline::~Bspline ( )

Member Function Documentation

◆ bezier_ele()

double ModuleBase::Bspline::bezier_ele ( int  n)
Here is the caller graph for this function:

◆ getbspline()

void ModuleBase::Bspline::getbspline ( double  x)
Here is the caller graph for this function:

◆ init()

void ModuleBase::Bspline::init ( int  norderin,
double  Dxin,
double  xiin 
)
Here is the caller graph for this function:

Member Data Documentation

◆ bezier

double* ModuleBase::Bspline::bezier
private

◆ Dx

double ModuleBase::Bspline::Dx
private

◆ norder

int ModuleBase::Bspline::norder
private

◆ xi

double ModuleBase::Bspline::xi
private

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