WARPXM v1.10.0
Loading...
Searching...
No Matches
wxm::spline Namespace Reference

Functions

void fpbspl (const std::vector< real > &t, const int n, const int k, const real x, const int l, std::vector< real > &h)
 Subroutine fpbspl evaluates the (k+1) non-zero b-splines of degree k at t(l) <= x < t(l+1) using the stable recurrence relation of de boor and cox.
 
void eval_spline2d (const std::vector< real > &tx, const std::vector< real > &ty, const int nx, const int ny, const std::vector< real > &c, const int kx, const int ky, std::vector< real > &lx, std::vector< real > &ly, std::vector< real > &hx, std::vector< real > &hy, std::vector< std::vector< real > > &wx, std::vector< std::vector< real > > &wy, const int mx, const int my, const std::vector< real > &x, const std::vector< real > &y, std::vector< std::vector< real > > &SplineValue2D)
 Evaluate 2D B-spline values at (x, y), given the knots vector and coefficients.
 

Function Documentation

◆ eval_spline2d()

void wxm::spline::eval_spline2d ( const std::vector< real > &  tx,
const std::vector< real > &  ty,
const int  nx,
const int  ny,
const std::vector< real > &  c,
const int  kx,
const int  ky,
std::vector< real > &  lx,
std::vector< real > &  ly,
std::vector< real > &  hx,
std::vector< real > &  hy,
std::vector< std::vector< real > > &  wx,
std::vector< std::vector< real > > &  wy,
const int  mx,
const int  my,
const std::vector< real > &  x,
const std::vector< real > &  y,
std::vector< std::vector< real > > &  SplineValue2D 
)

Evaluate 2D B-spline values at (x, y), given the knots vector and coefficients.

The algorithm is coplied from fphisp.f in FITPACK.

Parameters
txThe vector of knot in x direction
tyThe vector of knot in y direction
cThe vector of coefficients. The size is (nx-kx-1)*(ny-kx-1) , where nx is the number of knots in x, kx is the degree of basis polynomials in x.
kxThe polynomial degree of the spline basis in x
kyThe polynomial degree of the spline basis in y
hxValues of basis polynomial in x at one given point
hyValues of basis polynomial in y at one given point
xThe vector of points at which to evaluate it in x
yThe vector of points at which to evalutate it in y
Returns
The 2D B-spline values at the given points
Todo:
Check data before starting computations. If the input data are invalid, control is immediately repassed to the calling program.

◆ fpbspl()

void wxm::spline::fpbspl ( const std::vector< real > &  t,
const int  n,
const int  k,
const real  x,
const int  l,
std::vector< real > &  h 
)

Subroutine fpbspl evaluates the (k+1) non-zero b-splines of degree k at t(l) <= x < t(l+1) using the stable recurrence relation of de boor and cox.

Copied from fpbspl.f in FITPACK.

Parameters
tThe vector of knots
nInteger, giving the total number of knots
kThe polynomial degree of the spline basis
xThe point at which to evaluate the (k+1) non-zero b-splines
lThe index of the knot vector where the given x is located
hThe value of the (k+1) non-zero b-splines at the given point x