ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
orb5x::spclibs Namespace Reference

Classes

struct  GBMat
 General Band Matrix (LAPACK GB storage format) More...
 
struct  GEMat
 General Dense Matrix (LAPACK GE storage format) More...
 
struct  PBMat
 Packed Band Matrix (LAPACK PB storage format) More...
 
struct  PeriodicMat
 Periodic Band Matrix. More...
 
struct  Spline1D
 1-dimensional B-spline More...
 
struct  Spline2D
 2-dimensional B-spline (tensor product) More...
 
struct  Spline2D1D
 2D+1D B-spline (for axisymmetric problems) More...
 
struct  ZGBMat
 Complex General Band Matrix. More...
 
struct  ZGEMat
 Complex General Dense Matrix. More...
 
struct  ZPBMat
 Complex Packed Band Matrix. More...
 
struct  ZPeriodicMat
 Complex Periodic Band Matrix. More...
 

Typedefs

using spline1d = Spline1D
 Backward-compatible name for Spline1D.
 
using spline2d = Spline2D
 Backward-compatible name for Spline2D.
 
using spline2d1d = Spline2D1D
 Backward-compatible name for Spline2D1D.
 

Functions

void basfun (Real x, const Spline1D &sp, Real *fun, int left, int nderiv=1)
 Evaluate basis functions and derivatives at a point.
 
void bsolve (const GBMat &mat, Real *b, int nrhs=1)
 Solve linear system A*x = b.
 
void bsolve (const GEMat &mat, Real *b, int nrhs=1)
 Solve linear system A*x = b.
 
void bsolve (const PBMat &mat, Real *b, int nrhs=1)
 Solve linear system A*x = b.
 
void bsolve (const PeriodicMat &mat, Real *b, int nrhs=1)
 Solve linear system A*x = b.
 
void bsolve (const ZGBMat &mat, Complex *b, int nrhs=1)
 Solve linear system A*x = b.
 
void bsolve (const ZGEMat &mat, Complex *b, int nrhs=1)
 Solve linear system A*x = b.
 
void bsolve (const ZPBMat &mat, Complex *b, int nrhs=1)
 Solve linear system A*x = b.
 
void bsolve (const ZPeriodicMat &mat, Complex *b, int nrhs=1)
 Solve linear system A*x = b.
 
void bsplvb (const Real *t, int jhigh, Real x, int left, Real *biatx)
 Evaluate B-spline basis functions at a point.
 
void bsplvd (const Real *t, int k, Real x, int left, Real *a, Real *dbiatx, int nderiv)
 Evaluate B-spline basis functions and derivatives at a point.
 
void bspp2d (const Real *t, const Real *bcoef, int n, int k, Real *scrtch, Real *ppcoef)
 Convert B-spline coefficients to PPFORM.
 
void calc_integ (const Spline1D &sp, Real *integ)
 Calculate integral of each basis function.
 
void CompMassMatrix (const Spline1D &sp, GBMat &mat)
 Compute mass matrix for FEM discretization.
 
void CompMassMatrix (const Spline1D &sp, PeriodicMat &mat)
 Assemble the finite-element mass matrix with periodic index wrapping.
 
void def_basfun (Real x, const Spline1D &sp, Real *fun, int *left=nullptr, int nderiv=1)
 Define basis functions at a point (auto-locates interval)
 
void destroy (GBMat &mat)
 Release numerical storage and reset a matrix descriptor.
 
void destroy (GEMat &mat)
 Release numerical storage and reset a matrix descriptor.
 
void destroy (PBMat &mat)
 Release numerical storage and reset a matrix descriptor.
 
void destroy (PeriodicMat &mat)
 Release numerical storage and reset a matrix descriptor.
 
void destroy (ZGBMat &mat)
 Release numerical storage and reset a matrix descriptor.
 
void destroy (ZGEMat &mat)
 Release numerical storage and reset a matrix descriptor.
 
void destroy (ZPBMat &mat)
 Release numerical storage and reset a matrix descriptor.
 
void destroy (ZPeriodicMat &mat)
 Release numerical storage and reset a matrix descriptor.
 
void destroy_sp (Spline1D &sp)
 Release all 1-D Views/matrices and reset scalar metadata.
 
void destroy_sp (Spline2D &sp)
 Release both one-dimensional factors and all 2-D storage.
 
void destroy_sp (Spline2D1D &sp)
 Release all three factors and all 3-D storage.
 
Real determinant (const GBMat &mat)
 Compute determinant of factorized matrix.
 
Real determinant (const GEMat &mat)
 Compute determinant of factorized matrix.
 
Real determinant (const PBMat &mat)
 Compute determinant of factorized matrix.
 
Complex determinant (const ZGBMat &mat)
 Compute determinant of factorized matrix.
 
Complex determinant (const ZGEMat &mat)
 Compute determinant of factorized matrix.
 
Complex determinant (const ZPBMat &mat)
 Compute determinant of factorized matrix.
 
int factor (GBMat &mat)
 Compute LU factorization of matrix.
 
int factor (GEMat &mat)
 Compute LU factorization of matrix.
 
int factor (PBMat &mat)
 Compute LU factorization of matrix.
 
int factor (PeriodicMat &mat)
 Compute LU factorization of matrix.
 
int factor (ZGBMat &mat)
 Compute LU factorization of matrix.
 
int factor (ZGEMat &mat)
 Compute LU factorization of matrix.
 
int factor (ZPBMat &mat)
 Compute LU factorization of matrix.
 
int factor (ZPeriodicMat &mat)
 Compute LU factorization of matrix.
 
void gauleg (Real x1, Real x2, Real *x, Real *w, int n)
 Compute Gauss-Legendre quadrature points and weights.
 
void get_dim (const Spline1D &sp, int &dim, int *nx=nullptr, int *nidbas=nullptr)
 Get dimension information from 1D spline.
 
void get_dim (const Spline2D &sp, int dim[2], int nx[2]=nullptr, int nidbas[2]=nullptr)
 Get dimension information from both factors of a 2-D spline.
 
void get_gauss (const Spline1D &sp, int &n, int i=-1, Real *x=nullptr, Real *w=nullptr)
 Get Gauss quadrature information from spline.
 
void get_splcoef (const Spline1D &sp, const Real *bcoef, Real *fvals)
 Get function values from spline coefficients.
 
void getcol (const GBMat &mat, int j, Real *col)
 Expand one logical matrix column into contiguous storage.
 
void getcol (const PBMat &mat, int j, Real *col)
 Expand one logical matrix column into contiguous storage.
 
void getcol (const PeriodicMat &mat, int j, Real *col)
 Expand one logical matrix column into contiguous storage.
 
Real getele (const GBMat &mat, int i, int j)
 Get matrix element.
 
Real getele (const PBMat &mat, int i, int j)
 Get matrix element.
 
Real getele (const PeriodicMat &mat, int i, int j)
 Get matrix element.
 
Complex getele (const ZGBMat &mat, int i, int j)
 Get matrix element.
 
Complex getele (const ZPBMat &mat, int i, int j)
 Get matrix element.
 
Complex getele (const ZPeriodicMat &mat, int i, int j)
 Get matrix element.
 
void getrow (const GBMat &mat, int i, Real *row)
 Get row of matrix.
 
void getrow (const GEMat &mat, int i, Real *row)
 Get row of matrix.
 
void getrow (const PBMat &mat, int i, Real *row)
 Get row of matrix.
 
void getrow (const PeriodicMat &mat, int i, Real *row)
 Get row of matrix.
 
void getrow (const ZPBMat &mat, int i, Complex *row)
 Get row of matrix.
 
Real * getvalp (GBMat &mat, int i, int j)
 Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.
 
Real * getvalp (GEMat &mat, int i, int j)
 Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.
 
Real * getvalp (PBMat &mat, int i, int j)
 Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.
 
Complex * getvalp (ZGBMat &mat, int i, int j)
 Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.
 
Complex * getvalp (ZGEMat &mat, int i, int j)
 Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.
 
Complex * getvalp (ZPBMat &mat, int i, int j)
 Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.
 
void gridval (const Spline1D &sp, const Real *xgrid, int npts, const Real *bcoef, Real *fvals, int jder=0)
 Evaluate spline on a grid of points.
 
void gridval (const Spline2D &sp, const Real *xgrid1, int npts1, const Real *xgrid2, int npts2, const Real *bcoef, Real *fvals, int jder1=0, int jder2=0)
 Evaluate a tensor-product spline on a Cartesian product grid.
 
void gridval (const Spline2D1D &sp, const Real *xgrid1, int npts1, const Real *xgrid2, int npts2, const Real *xgrid3, int npts3, const Real *bcoef, Real *fvals, int jder1=0, int jder2=0, int jder3=0)
 Evaluate 3D spline (2D+1D) on a 3D grid.
 
void init (int kl, int ku, int n, int nterms, GBMat &mat, int kmat=0, int mrows=-1)
 Initialize a general band matrix.
 
void init (int kl, int ku, int n, int nterms, PeriodicMat &mat, int kmat=0)
 Initialize a real periodic band matrix and Woodbury factors.
 
void init (int kl, int ku, int n, int nterms, ZGBMat &mat, int kmat=0, int mrows=-1)
 Initialize a general band matrix.
 
void init (int kl, int ku, int n, int nterms, ZPeriodicMat &mat, int kmat=0)
 Initialize a real periodic band matrix and Woodbury factors.
 
void init (int ku, int n, int nterms, PBMat &mat, int kmat=0)
 Initialize a real symmetric positive-definite band matrix.
 
void init (int ku, int n, int nterms, ZPBMat &mat, int kmat=0)
 Initialize a real symmetric positive-definite band matrix.
 
void init (int n, int nterms, GEMat &mat, int kmat=0, int mrows=-1)
 Initialize a real general dense matrix.
 
void init (int n, int nterms, ZGEMat &mat, int kmat=0, int mrows=-1)
 Initialize a real general dense matrix.
 
void interv (const Real *xt, int lxt, Real x, int &left, int &mflag)
 Locate interval containing x in a knot sequence.
 
void interv_hint (const Real *xt, int lxt, Real x, int &left, int &mflag, int &ilo)
 Thread-safe version of interv with explicit previous guess.
 
bool is_equid (const Real *grid, int n)
 Check if a grid is equidistant.
 
void locintv (const Spline1D &sp, Real x, int &left)
 Locate interval containing x in spline knot sequence.
 
void maddto (Real alpha, const GBMat &a, GBMat &b)
 Accumulate B = B + alpha*A without changing storage layout.
 
void maddto (Real alpha, const GEMat &a, GEMat &b)
 Accumulate B = B + alpha*A without changing storage layout.
 
void maddto (Real alpha, const PBMat &a, PBMat &b)
 Accumulate B = B + alpha*A without changing storage layout.
 
void maddto (Real alpha, const PeriodicMat &a, PeriodicMat &b)
 Accumulate B = B + alpha*A without changing storage layout.
 
void mcopy (const GBMat &src, GBMat &dst)
 Deep-copy matrix metadata and numerical storage.
 
void mcopy (const GEMat &src, GEMat &dst)
 Deep-copy matrix metadata and numerical storage.
 
void mcopy (const PBMat &src, PBMat &dst)
 Deep-copy matrix metadata and numerical storage.
 
void mcopy (const PeriodicMat &src, PeriodicMat &dst)
 Deep-copy matrix metadata and numerical storage.
 
Real ppval (const Real *t, const Real *coef, int n, int k, Real x, int &left)
 Evaluate polynomial in piecewise polynomial form.
 
void putcol (GBMat &mat, int j, const Real *col)
 Replace one zero-based logical matrix column.
 
void putcol (GEMat &mat, int j, const Real *col)
 Replace one zero-based logical matrix column.
 
void putcol (PBMat &mat, int j, const Real *col)
 Replace one zero-based logical matrix column.
 
void putcol (PeriodicMat &mat, int j, const Real *col)
 Replace one zero-based logical matrix column.
 
void putcol (ZPBMat &mat, int j, const Complex *col)
 Replace one zero-based logical matrix column.
 
void putele (GBMat &mat, Real val, int i, int j)
 Assign one zero-based logical matrix element.
 
void putele (PBMat &mat, Real val, int i, int j)
 Assign one zero-based logical matrix element.
 
void putele (PeriodicMat &mat, Real val, int i, int j)
 Assign one zero-based logical matrix element.
 
void putele (ZGBMat &mat, Complex val, int i, int j)
 Assign one zero-based logical matrix element.
 
void putele (ZPBMat &mat, Complex val, int i, int j)
 Assign one zero-based logical matrix element.
 
void putele (ZPeriodicMat &mat, Complex val, int i, int j)
 Assign one zero-based logical matrix element.
 
void putrow (GBMat &mat, int i, const Real *row)
 Replace one zero-based logical matrix row.
 
void putrow (GEMat &mat, int i, const Real *row)
 Replace one zero-based logical matrix row.
 
void putrow (PBMat &mat, int i, const Real *row)
 Replace one zero-based logical matrix row.
 
void putrow (PeriodicMat &mat, int i, const Real *row)
 Replace one zero-based logical matrix row.
 
void putrow (ZPBMat &mat, int i, const Complex *row)
 Replace one zero-based logical matrix row.
 
void set_splcoef (Spline1D &sp, const Real *fvals, Real *bcoef)
 Set spline coefficients from function values.
 
void set_spline (const int p[2], const int ngauss[2], const Real *grid1, int ngrid1, const Real *grid2, int ngrid2, Spline2D &sp, const bool period[2]=nullptr, bool nlppform=true, const int nlequid[2]=nullptr)
 Initialize a 2D spline.
 
void set_spline (const int p[3], const int ngauss[3], const Real *grid1, int ngrid1, const Real *grid2, int ngrid2, const Real *grid3, int ngrid3, Spline2D1D &sp, const bool period[3]=nullptr, bool nlppform=true, const int nlequid[3]=nullptr)
 Initialize a 2D+1D spline.
 
void set_spline (int p, int ngauss, const Real *grid, int ngrid, Spline1D &sp, bool period=false, bool nlppform=true, int nlequid=-1)
 Initialize a 1D spline.
 
void updtmat (GBMat &mat, Real val, int i, int j)
 Update matrix element: mat(i,j) += val.
 
void updtmat (GEMat &mat, Real val, int i, int j)
 Update matrix element: mat(i,j) += val.
 
void updtmat (PBMat &mat, Real val, int i, int j)
 Update matrix element: mat(i,j) += val.
 
void updtmat (PeriodicMat &mat, Real val, int i, int j)
 Update matrix element: mat(i,j) += val.
 
void updtmat (ZGBMat &mat, Complex val, int i, int j)
 Update matrix element: mat(i,j) += val.
 
void updtmat (ZPBMat &mat, Complex val, int i, int j)
 Update matrix element: mat(i,j) += val.
 
void updtmat (ZPeriodicMat &mat, Complex val, int i, int j)
 Update matrix element: mat(i,j) += val.
 
void vmx (const GBMat &mat, const Real *x, Real *y)
 Compute y = A*x.
 
void vmx (const GBMat &mat, const Real *x, Real *y, int nrhs)
 Compute Y = A*X for multiple vectors.
 
void vmx (const GEMat &mat, const Real *x, Real *y)
 Compute y = A*x.
 
void vmx (const GEMat &mat, const Real *x, Real *y, int nrhs)
 Compute Y = A*X for multiple vectors.
 
void vmx (const PBMat &mat, const Real *x, Real *y)
 Compute y = A*x.
 
void vmx (const PeriodicMat &mat, const Real *x, Real *y)
 Compute y = A*x.
 
void vmx (const ZGBMat &mat, const Complex *x, Complex *y)
 Compute y = A*x.
 
void vmx (const ZGEMat &mat, const Complex *x, Complex *y)
 Compute y = A*x.
 
void vmx (const ZPBMat &mat, const Complex *x, Complex *y)
 Compute y = A*x.
 
void vmx (const ZPeriodicMat &mat, const Complex *x, Complex *y)
 Compute y = A*x.
 

Variables

constexpr int JMAX = 20
 Maximum spline order supported (degree + 1)
 

Typedef Documentation

◆ spline1d

Backward-compatible name for Spline1D.

◆ spline2d

Backward-compatible name for Spline2D.

◆ spline2d1d

Backward-compatible name for Spline2D1D.

Function Documentation

◆ basfun()

void orb5x::spclibs::basfun ( Real  x,
const Spline1D &  sp,
Real *  fun,
int  left,
int  nderiv = 1 
)

Evaluate basis functions and derivatives at a point.

Parameters
[in]xCoordinate at which to evaluate, in grid units.
[in]spInitialized spline.
[out]funArray of at least order*nderiv values and derivatives: fun[i + j*order] = jth derivative of ith basis function i = 0, ..., order-1 (basis functions) j = 0, ..., nderiv-1 (derivatives)
[in]leftOne-based interval index, retained from the Fortran interface.
[in]nderivNumber of derivative levels including the value; one computes only values.

◆ bsolve() [1/8]

void orb5x::spclibs::bsolve ( const GBMat &  mat,
Real *  b,
int  nrhs = 1 
)

Solve linear system A*x = b.

Parameters
matFactorized matrix (from factor())
bRight-hand side vector (input), solution vector (output)
nrhsNumber of right-hand sides (default 1)

The matrix must have been factorized with factor() before calling bsolve().

◆ bsolve() [2/8]

void orb5x::spclibs::bsolve ( const GEMat &  mat,
Real *  b,
int  nrhs = 1 
)

Solve linear system A*x = b.

Parameters
matFactorized matrix (from factor())
bRight-hand side vector (input), solution vector (output)
nrhsNumber of right-hand sides (default 1)

The matrix must have been factorized with factor() before calling bsolve().

◆ bsolve() [3/8]

void orb5x::spclibs::bsolve ( const PBMat &  mat,
Real *  b,
int  nrhs = 1 
)

Solve linear system A*x = b.

Parameters
matFactorized matrix (from factor())
bRight-hand side vector (input), solution vector (output)
nrhsNumber of right-hand sides (default 1)

The matrix must have been factorized with factor() before calling bsolve().

◆ bsolve() [4/8]

void orb5x::spclibs::bsolve ( const PeriodicMat &  mat,
Real *  b,
int  nrhs = 1 
)

Solve linear system A*x = b.

Parameters
matFactorized matrix (from factor())
bRight-hand side vector (input), solution vector (output)
nrhsNumber of right-hand sides (default 1)

The matrix must have been factorized with factor() before calling bsolve().

◆ bsolve() [5/8]

void orb5x::spclibs::bsolve ( const ZGBMat &  mat,
Complex *  b,
int  nrhs = 1 
)

Solve linear system A*x = b.

Parameters
matFactorized matrix (from factor())
bRight-hand side vector (input), solution vector (output)
nrhsNumber of right-hand sides (default 1)

The matrix must have been factorized with factor() before calling bsolve().

◆ bsolve() [6/8]

void orb5x::spclibs::bsolve ( const ZGEMat &  mat,
Complex *  b,
int  nrhs = 1 
)

Solve linear system A*x = b.

Parameters
matFactorized matrix (from factor())
bRight-hand side vector (input), solution vector (output)
nrhsNumber of right-hand sides (default 1)

The matrix must have been factorized with factor() before calling bsolve().

◆ bsolve() [7/8]

void orb5x::spclibs::bsolve ( const ZPBMat &  mat,
Complex *  b,
int  nrhs = 1 
)

Solve linear system A*x = b.

Parameters
matFactorized matrix (from factor())
bRight-hand side vector (input), solution vector (output)
nrhsNumber of right-hand sides (default 1)

The matrix must have been factorized with factor() before calling bsolve().

◆ bsolve() [8/8]

void orb5x::spclibs::bsolve ( const ZPeriodicMat &  mat,
Complex *  b,
int  nrhs = 1 
)

Solve linear system A*x = b.

Parameters
matFactorized matrix (from factor())
bRight-hand side vector (input), solution vector (output)
nrhsNumber of right-hand sides (default 1)

The matrix must have been factorized with factor() before calling bsolve().

◆ bsplvb()

void orb5x::spclibs::bsplvb ( const Real *  t,
int  jhigh,
Real  x,
int  left,
Real *  biatx 
)

Evaluate B-spline basis functions at a point.

Evaluates all possibly nonzero B-splines at X of order jhigh with knot sequence T. Uses the recurrence relation:

               X - T(I)               T(I+J+1) - X

B(I,J+1)(X) = --------— * B(I,J)(X) + ------------— * B(I+1,J)(X) T(I+J)-T(I) T(I+J+1)-T(I+1)

Parameters
tKnot sequence (at least left+jhigh elements)
jhighOrder of B-splines to evaluate
xPoint at which to evaluate
leftIndex such that t[left] <= x < t[left+1]
biatxOutput: B-spline values (jhigh elements)

Note: Uses 0-based indexing (Fortran version uses 1-based)

◆ bsplvd()

void orb5x::spclibs::bsplvd ( const Real *  t,
int  k,
Real  x,
int  left,
Real *  a,
Real *  dbiatx,
int  nderiv 
)

Evaluate B-spline basis functions and derivatives at a point.

Computes values at X of all the relevant B-splines of order k, k-1, ..., k+1-nderiv and their derivatives.

Parameters
tKnot sequence (at least left+k elements)
kOrder of B-splines
xPoint at which to evaluate
leftIndex such that t[left] <= x < t[left+1]
aWorkspace array (k x k)
dbiatxOutput: B-spline values and derivatives (k x nderiv) dbiatx[i + m*k] = (m-1)th derivative of (left-k+i+1)th B-spline
nderivNumber of derivatives (including value) to compute

Note: Uses 0-based indexing

◆ bspp2d()

void orb5x::spclibs::bspp2d ( const Real *  t,
const Real *  bcoef,
int  n,
int  k,
Real *  scrtch,
Real *  ppcoef 
)

Convert B-spline coefficients to PPFORM.

Converts B-spline representation to piecewise polynomial form.

Parameters
tKnot sequence
bcoefB-spline coefficients (dim elements)
nNumber of intervals
kOrder
scrtchScratch array (k x k)
ppcoefOutput: PPFORM coefficients (k x n)

◆ calc_integ()

void orb5x::spclibs::calc_integ ( const Spline1D &  sp,
Real *  integ 
)

Calculate integral of each basis function.

Parameters
[in]spInitialized spline, preferably with Gauss quadrature data.
[out]integArray of sp.dim basis integrals in coordinate units.
Note
Without stored Gauss points, a uniform-width approximation is returned.

◆ CompMassMatrix() [1/2]

void orb5x::spclibs::CompMassMatrix ( const Spline1D &  sp,
GBMat &  mat 
)

Compute mass matrix for FEM discretization.

Parameters
[in]spInitialized nonperiodic spline with Gauss quadrature data.
[out]matInitialized general band matrix representing \(M_{ij}=\int B_i(x)B_j(x)\,dx\).

◆ CompMassMatrix() [2/2]

void orb5x::spclibs::CompMassMatrix ( const Spline1D &  sp,
PeriodicMat &  mat 
)

Assemble the finite-element mass matrix with periodic index wrapping.

Parameters
[in]spInitialized periodic spline with Gauss quadrature data.
[out]matInitialized periodic band matrix representing \(M_{ij}=\int B_i(x)B_j(x)\,dx\).

◆ def_basfun()

void orb5x::spclibs::def_basfun ( Real  x,
const Spline1D &  sp,
Real *  fun,
int *  left = nullptr,
int  nderiv = 1 
)

Define basis functions at a point (auto-locates interval)

Parameters
[in]xCoordinate at which to evaluate, in grid units.
[in]spInitialized spline.
[out]funArray of at least order*nderiv values and derivatives.
[out]leftOptional zero-based containing interval.
[in]nderivNumber of derivative levels including the value.

◆ destroy() [1/8]

void orb5x::spclibs::destroy ( GBMat &  mat)

Release numerical storage and reset a matrix descriptor.

Parameters
[in,out]matMatrix to destroy; it is empty on return.

◆ destroy() [2/8]

void orb5x::spclibs::destroy ( GEMat &  mat)

Release numerical storage and reset a matrix descriptor.

Parameters
[in,out]matMatrix to destroy; it is empty on return.

◆ destroy() [3/8]

void orb5x::spclibs::destroy ( PBMat &  mat)

Release numerical storage and reset a matrix descriptor.

Parameters
[in,out]matMatrix to destroy; it is empty on return.

◆ destroy() [4/8]

void orb5x::spclibs::destroy ( PeriodicMat &  mat)

Release numerical storage and reset a matrix descriptor.

Parameters
[in,out]matMatrix to destroy; it is empty on return.

◆ destroy() [5/8]

void orb5x::spclibs::destroy ( ZGBMat &  mat)

Release numerical storage and reset a matrix descriptor.

Parameters
[in,out]matMatrix to destroy; it is empty on return.

◆ destroy() [6/8]

void orb5x::spclibs::destroy ( ZGEMat &  mat)

Release numerical storage and reset a matrix descriptor.

Parameters
[in,out]matMatrix to destroy; it is empty on return.

◆ destroy() [7/8]

void orb5x::spclibs::destroy ( ZPBMat &  mat)

Release numerical storage and reset a matrix descriptor.

Parameters
[in,out]matMatrix to destroy; it is empty on return.

◆ destroy() [8/8]

void orb5x::spclibs::destroy ( ZPeriodicMat &  mat)

Release numerical storage and reset a matrix descriptor.

Parameters
[in,out]matMatrix to destroy; it is empty on return.

◆ destroy_sp() [1/3]

void orb5x::spclibs::destroy_sp ( Spline1D &  sp)

Release all 1-D Views/matrices and reset scalar metadata.

Parameters
[in,out]spDescriptor to return to the uninitialized state.

◆ destroy_sp() [2/3]

void orb5x::spclibs::destroy_sp ( Spline2D &  sp)

Release both one-dimensional factors and all 2-D storage.

Parameters
[in,out]spDescriptor to return to the uninitialized state.

◆ destroy_sp() [3/3]

void orb5x::spclibs::destroy_sp ( Spline2D1D &  sp)

Release all three factors and all 3-D storage.

Parameters
[in,out]spDescriptor to return to the uninitialized state.

◆ determinant() [1/6]

Real orb5x::spclibs::determinant ( const GBMat &  mat)

Compute determinant of factorized matrix.

Parameters
matFactorized matrix
Returns
Determinant value

◆ determinant() [2/6]

Real orb5x::spclibs::determinant ( const GEMat &  mat)

Compute determinant of factorized matrix.

Parameters
matFactorized matrix
Returns
Determinant value

◆ determinant() [3/6]

Real orb5x::spclibs::determinant ( const PBMat &  mat)

Compute determinant of factorized matrix.

Parameters
matFactorized matrix
Returns
Determinant value

◆ determinant() [4/6]

Complex orb5x::spclibs::determinant ( const ZGBMat &  mat)

Compute determinant of factorized matrix.

Parameters
matFactorized matrix
Returns
Determinant value

◆ determinant() [5/6]

Complex orb5x::spclibs::determinant ( const ZGEMat &  mat)

Compute determinant of factorized matrix.

Parameters
matFactorized matrix
Returns
Determinant value

◆ determinant() [6/6]

Complex orb5x::spclibs::determinant ( const ZPBMat &  mat)

Compute determinant of factorized matrix.

Parameters
matFactorized matrix
Returns
Determinant value

◆ factor() [1/8]

int orb5x::spclibs::factor ( GBMat &  mat)

Compute LU factorization of matrix.

Parameters
matMatrix to factorize (modified in place)
Returns
0 on success, non-zero on failure

For GBMat: Uses LAPACK DGBTRF For GEMat: Uses LAPACK DGETRF For PBMat: Uses LAPACK DPBTRF (Cholesky) For PeriodicMat: Uses Woodbury formula with DGBTRF

◆ factor() [2/8]

int orb5x::spclibs::factor ( GEMat &  mat)

Compute LU factorization of matrix.

Parameters
matMatrix to factorize (modified in place)
Returns
0 on success, non-zero on failure

For GBMat: Uses LAPACK DGBTRF For GEMat: Uses LAPACK DGETRF For PBMat: Uses LAPACK DPBTRF (Cholesky) For PeriodicMat: Uses Woodbury formula with DGBTRF

◆ factor() [3/8]

int orb5x::spclibs::factor ( PBMat &  mat)

Compute LU factorization of matrix.

Parameters
matMatrix to factorize (modified in place)
Returns
0 on success, non-zero on failure

For GBMat: Uses LAPACK DGBTRF For GEMat: Uses LAPACK DGETRF For PBMat: Uses LAPACK DPBTRF (Cholesky) For PeriodicMat: Uses Woodbury formula with DGBTRF

◆ factor() [4/8]

int orb5x::spclibs::factor ( PeriodicMat &  mat)

Compute LU factorization of matrix.

Parameters
matMatrix to factorize (modified in place)
Returns
0 on success, non-zero on failure

For GBMat: Uses LAPACK DGBTRF For GEMat: Uses LAPACK DGETRF For PBMat: Uses LAPACK DPBTRF (Cholesky) For PeriodicMat: Uses Woodbury formula with DGBTRF

◆ factor() [5/8]

int orb5x::spclibs::factor ( ZGBMat &  mat)

Compute LU factorization of matrix.

Parameters
matMatrix to factorize (modified in place)
Returns
0 on success, non-zero on failure

For GBMat: Uses LAPACK DGBTRF For GEMat: Uses LAPACK DGETRF For PBMat: Uses LAPACK DPBTRF (Cholesky) For PeriodicMat: Uses Woodbury formula with DGBTRF

◆ factor() [6/8]

int orb5x::spclibs::factor ( ZGEMat &  mat)

Compute LU factorization of matrix.

Parameters
matMatrix to factorize (modified in place)
Returns
0 on success, non-zero on failure

For GBMat: Uses LAPACK DGBTRF For GEMat: Uses LAPACK DGETRF For PBMat: Uses LAPACK DPBTRF (Cholesky) For PeriodicMat: Uses Woodbury formula with DGBTRF

◆ factor() [7/8]

int orb5x::spclibs::factor ( ZPBMat &  mat)

Compute LU factorization of matrix.

Parameters
matMatrix to factorize (modified in place)
Returns
0 on success, non-zero on failure

For GBMat: Uses LAPACK DGBTRF For GEMat: Uses LAPACK DGETRF For PBMat: Uses LAPACK DPBTRF (Cholesky) For PeriodicMat: Uses Woodbury formula with DGBTRF

◆ factor() [8/8]

int orb5x::spclibs::factor ( ZPeriodicMat &  mat)

Compute LU factorization of matrix.

Parameters
matMatrix to factorize (modified in place)
Returns
0 on success, non-zero on failure

For GBMat: Uses LAPACK DGBTRF For GEMat: Uses LAPACK DGETRF For PBMat: Uses LAPACK DPBTRF (Cholesky) For PeriodicMat: Uses Woodbury formula with DGBTRF

◆ gauleg()

void orb5x::spclibs::gauleg ( Real  x1,
Real  x2,
Real *  x,
Real *  w,
int  n 
)

Compute Gauss-Legendre quadrature points and weights.

Computes the n-point Gauss-Legendre quadrature rule on [x1, x2].

Parameters
x1Left endpoint of interval
x2Right endpoint of interval
xOutput: quadrature points (n elements)
wOutput: quadrature weights (n elements)
nNumber of quadrature points

◆ get_dim() [1/2]

void orb5x::spclibs::get_dim ( const Spline1D &  sp,
int &  dim,
int *  nx = nullptr,
int *  nidbas = nullptr 
)

Get dimension information from 1D spline.

Parameters
[in]spInitialized spline descriptor.
[out]dimNumber of independent spline coefficients.
[out]nxOptional number of knot intervals.
[out]nidbasOptional polynomial degree (order-1).

◆ get_dim() [2/2]

void orb5x::spclibs::get_dim ( const Spline2D &  sp,
int  dim[2],
int  nx[2] = nullptr,
int  nidbas[2] = nullptr 
)

Get dimension information from both factors of a 2-D spline.

Parameters
[in]spInitialized tensor-product descriptor.
[out]dimTwo coefficient-space dimensions.
[out]nxOptional interval counts in the two directions.
[out]nidbasOptional polynomial degrees in the two directions.

◆ get_gauss()

void orb5x::spclibs::get_gauss ( const Spline1D &  sp,
int &  n,
int  i = -1,
Real *  x = nullptr,
Real *  w = nullptr 
)

Get Gauss quadrature information from spline.

Parameters
[in]spInitialized spline with optional quadrature storage.
[out]nNumber of Gauss points per interval, possibly zero.
[in]iZero-based interval to copy, or a negative value for count only.
[out]xOptional array of at least n abscissas; written only with w and valid i.
[out]wOptional array of at least n integration weights; written only with x and valid i.

◆ get_splcoef()

void orb5x::spclibs::get_splcoef ( const Spline1D &  sp,
const Real *  bcoef,
Real *  fvals 
)

Get function values from spline coefficients.

Computes fvals = M * bcoef where M is the interpolation matrix.

Parameters
[in]spSpline with its appropriate interpolation matrix initialized.
[in]bcoefArray of sp.dim spline coefficients.
[out]fvalsArray of sp.dim values receiving the matrix product.

◆ getcol() [1/3]

void orb5x::spclibs::getcol ( const GBMat &  mat,
int  j,
Real *  col 
)

Expand one logical matrix column into contiguous storage.

Parameters
[in]matSource matrix.
[in]jZero-based logical column.
[out]colCaller storage with at least mrows elements.

◆ getcol() [2/3]

void orb5x::spclibs::getcol ( const PBMat &  mat,
int  j,
Real *  col 
)

Expand one logical matrix column into contiguous storage.

Parameters
[in]matSource matrix.
[in]jZero-based logical column.
[out]colCaller storage with at least mrows elements.

◆ getcol() [3/3]

void orb5x::spclibs::getcol ( const PeriodicMat &  mat,
int  j,
Real *  col 
)

Expand one logical matrix column into contiguous storage.

Parameters
[in]matSource matrix.
[in]jZero-based logical column.
[out]colCaller storage with at least mrows elements.

◆ getele() [1/6]

Real orb5x::spclibs::getele ( const GBMat &  mat,
int  i,
int  j 
)

Get matrix element.

Parameters
matMatrix
iRow index (0-based)
jColumn index (0-based)
Returns
Matrix element value

◆ getele() [2/6]

Real orb5x::spclibs::getele ( const PBMat &  mat,
int  i,
int  j 
)

Get matrix element.

Parameters
matMatrix
iRow index (0-based)
jColumn index (0-based)
Returns
Matrix element value

◆ getele() [3/6]

Real orb5x::spclibs::getele ( const PeriodicMat &  mat,
int  i,
int  j 
)

Get matrix element.

Parameters
matMatrix
iRow index (0-based)
jColumn index (0-based)
Returns
Matrix element value

◆ getele() [4/6]

Complex orb5x::spclibs::getele ( const ZGBMat &  mat,
int  i,
int  j 
)

Get matrix element.

Parameters
matMatrix
iRow index (0-based)
jColumn index (0-based)
Returns
Matrix element value

◆ getele() [5/6]

Complex orb5x::spclibs::getele ( const ZPBMat &  mat,
int  i,
int  j 
)

Get matrix element.

Parameters
matMatrix
iRow index (0-based)
jColumn index (0-based)
Returns
Matrix element value

◆ getele() [6/6]

Complex orb5x::spclibs::getele ( const ZPeriodicMat &  mat,
int  i,
int  j 
)

Get matrix element.

Parameters
matMatrix
iRow index (0-based)
jColumn index (0-based)
Returns
Matrix element value

◆ getrow() [1/5]

void orb5x::spclibs::getrow ( const GBMat &  mat,
int  i,
Real *  row 
)

Get row of matrix.

Parameters
matMatrix
iRow index (0-based)
rowOutput array (must be pre-allocated with size ncols)

◆ getrow() [2/5]

void orb5x::spclibs::getrow ( const GEMat &  mat,
int  i,
Real *  row 
)

Get row of matrix.

Parameters
matMatrix
iRow index (0-based)
rowOutput array (must be pre-allocated with size ncols)

◆ getrow() [3/5]

void orb5x::spclibs::getrow ( const PBMat &  mat,
int  i,
Real *  row 
)

Get row of matrix.

Parameters
matMatrix
iRow index (0-based)
rowOutput array (must be pre-allocated with size ncols)

◆ getrow() [4/5]

void orb5x::spclibs::getrow ( const PeriodicMat &  mat,
int  i,
Real *  row 
)

Get row of matrix.

Parameters
matMatrix
iRow index (0-based)
rowOutput array (must be pre-allocated with size ncols)

◆ getrow() [5/5]

void orb5x::spclibs::getrow ( const ZPBMat &  mat,
int  i,
Complex *  row 
)

Get row of matrix.

Parameters
matMatrix
iRow index (0-based)
rowOutput array (must be pre-allocated with size ncols)

◆ getvalp() [1/6]

Real * orb5x::spclibs::getvalp ( GBMat &  mat,
int  i,
int  j 
)

Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.

Parameters
[in,out]matMatrix whose physical storage is requested.
[in]iZero-based logical row.
[in]jZero-based logical column.
Returns
Pointer to the stored scalar, or null when (i,j) is not represented.

◆ getvalp() [2/6]

Real * orb5x::spclibs::getvalp ( GEMat &  mat,
int  i,
int  j 
)

Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.

Parameters
[in,out]matMatrix whose physical storage is requested.
[in]iZero-based logical row.
[in]jZero-based logical column.
Returns
Pointer to the stored scalar, or null when (i,j) is not represented.

◆ getvalp() [3/6]

Real * orb5x::spclibs::getvalp ( PBMat &  mat,
int  i,
int  j 
)

Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.

Parameters
[in,out]matMatrix whose physical storage is requested.
[in]iZero-based logical row.
[in]jZero-based logical column.
Returns
Pointer to the stored scalar, or null when (i,j) is not represented.

◆ getvalp() [4/6]

Complex * orb5x::spclibs::getvalp ( ZGBMat &  mat,
int  i,
int  j 
)

Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.

Parameters
[in,out]matMatrix whose physical storage is requested.
[in]iZero-based logical row.
[in]jZero-based logical column.
Returns
Pointer to the stored scalar, or null when (i,j) is not represented.

◆ getvalp() [5/6]

Complex * orb5x::spclibs::getvalp ( ZGEMat &  mat,
int  i,
int  j 
)

Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.

Parameters
[in,out]matMatrix whose physical storage is requested.
[in]iZero-based logical row.
[in]jZero-based logical column.
Returns
Pointer to the stored scalar, or null when (i,j) is not represented.

◆ getvalp() [6/6]

Complex * orb5x::spclibs::getvalp ( ZPBMat &  mat,
int  i,
int  j 
)

Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.

Parameters
[in,out]matMatrix whose physical storage is requested.
[in]iZero-based logical row.
[in]jZero-based logical column.
Returns
Pointer to the stored scalar, or null when (i,j) is not represented.

◆ gridval() [1/3]

void orb5x::spclibs::gridval ( const Spline1D &  sp,
const Real *  xgrid,
int  npts,
const Real *  bcoef,
Real *  fvals,
int  jder = 0 
)

Evaluate spline on a grid of points.

Given spline coefficients bcoef, compute function values on grid.

Parameters
[in]spInitialized spline.
[in]xgridEvaluation coordinates of length npts.
[in]nptsNumber of evaluation coordinates.
[in]bcoefSpline coefficients of length sp.dim.
[out]fvalsEvaluated values or derivatives of length npts.
[in]jderDerivative order; zero evaluates the represented function.

◆ gridval() [2/3]

void orb5x::spclibs::gridval ( const Spline2D &  sp,
const Real *  xgrid1,
int  npts1,
const Real *  xgrid2,
int  npts2,
const Real *  bcoef,
Real *  fvals,
int  jder1 = 0,
int  jder2 = 0 
)

Evaluate a tensor-product spline on a Cartesian product grid.

Parameters
[in]spInitialized two-dimensional descriptor.
[in]xgrid1First-direction coordinates of length npts1.
[in]npts1First-direction point count.
[in]xgrid2Second-direction coordinates of length npts2.
[in]npts2Second-direction point count.
[in]bcoefCoefficients of length sp1.dim*sp2.dim, direction 1 fastest.
[out]fvalsResults of length npts1*npts2, direction 1 fastest.
[in]jder1Derivative order in direction 1.
[in]jder2Derivative order in direction 2.

◆ gridval() [3/3]

void orb5x::spclibs::gridval ( const Spline2D1D &  sp,
const Real *  xgrid1,
int  npts1,
const Real *  xgrid2,
int  npts2,
const Real *  xgrid3,
int  npts3,
const Real *  bcoef,
Real *  fvals,
int  jder1 = 0,
int  jder2 = 0,
int  jder3 = 0 
)

Evaluate 3D spline (2D+1D) on a 3D grid.

Given spline coefficients bcoef, compute function values on 3D grid. Based on Fortran gridval2d1d_3d (bsplines.f90 lines 2613-2753).

Parameters
[in]sp2-D-plus-1-D spline (sp12 for directions 1–2 and sp3 for direction 3).
[in]xgrid1Direction-1 coordinates of length npts1.
[in]npts1Direction-1 point count.
[in]xgrid2Direction-2 coordinates of length npts2.
[in]npts2Direction-2 point count.
[in]xgrid3Direction-3 coordinates of length npts3.
[in]npts3Direction-3 point count.
[in]bcoefdim1*dim2*dim3 coefficients, direction 1 fastest.
[out]fvalsnpts1*npts2*npts3 results, direction 1 fastest.
[in]jder1Derivative order in direction 1.
[in]jder2Derivative order in direction 2.
[in]jder3Derivative order in direction 3.

◆ init() [1/8]

void orb5x::spclibs::init ( int  kl,
int  ku,
int  n,
int  nterms,
GBMat &  mat,
int  kmat = 0,
int  mrows = -1 
)

Initialize a general band matrix.

Parameters
klNumber of subdiagonals
kuNumber of superdiagonals
nMatrix dimension (square matrix)
ntermsNumber of non-zero terms (informational)
matOutput matrix
kmatOptional matrix identifier
mrowsOptional number of rows (defaults to n) Allocate matrix storage and initialize dimensions, bandwidths, identifiers, and pivots.

Referenced by orb5x::Zbmat::allocate_band().

◆ init() [2/8]

void orb5x::spclibs::init ( int  kl,
int  ku,
int  n,
int  nterms,
PeriodicMat &  mat,
int  kmat = 0 
)

Initialize a real periodic band matrix and Woodbury factors.

Parameters
[in]klNumber of subdiagonals.
[in]kuNumber of superdiagonals.
[in]nSquare matrix dimension.
[in]ntermsInformational assembled-term count.
[out]matAllocated periodic descriptor.
[in]kmatOptional caller-defined identifier. Allocate matrix storage and initialize dimensions, bandwidths, identifiers, and pivots.

◆ init() [3/8]

void orb5x::spclibs::init ( int  kl,
int  ku,
int  n,
int  nterms,
ZGBMat &  mat,
int  kmat = 0,
int  mrows = -1 
)

Initialize a general band matrix.

Parameters
klNumber of subdiagonals
kuNumber of superdiagonals
nMatrix dimension (square matrix)
ntermsNumber of non-zero terms (informational)
matOutput matrix
kmatOptional matrix identifier
mrowsOptional number of rows (defaults to n) Allocate matrix storage and initialize dimensions, bandwidths, identifiers, and pivots.

◆ init() [4/8]

void orb5x::spclibs::init ( int  kl,
int  ku,
int  n,
int  nterms,
ZPeriodicMat &  mat,
int  kmat = 0 
)

Initialize a real periodic band matrix and Woodbury factors.

Parameters
[in]klNumber of subdiagonals.
[in]kuNumber of superdiagonals.
[in]nSquare matrix dimension.
[in]ntermsInformational assembled-term count.
[out]matAllocated periodic descriptor.
[in]kmatOptional caller-defined identifier. Allocate matrix storage and initialize dimensions, bandwidths, identifiers, and pivots.

◆ init() [5/8]

void orb5x::spclibs::init ( int  ku,
int  n,
int  nterms,
PBMat &  mat,
int  kmat = 0 
)

Initialize a real symmetric positive-definite band matrix.

Parameters
[in]kuNumber of stored upper superdiagonals.
[in]nSquare matrix dimension.
[in]ntermsInformational assembled-term count.
[out]matAllocated packed-band descriptor.
[in]kmatOptional caller-defined identifier. Allocate matrix storage and initialize dimensions, bandwidths, identifiers, and pivots.

◆ init() [6/8]

void orb5x::spclibs::init ( int  ku,
int  n,
int  nterms,
ZPBMat &  mat,
int  kmat = 0 
)

Initialize a real symmetric positive-definite band matrix.

Parameters
[in]kuNumber of stored upper superdiagonals.
[in]nSquare matrix dimension.
[in]ntermsInformational assembled-term count.
[out]matAllocated packed-band descriptor.
[in]kmatOptional caller-defined identifier. Allocate matrix storage and initialize dimensions, bandwidths, identifiers, and pivots.

◆ init() [7/8]

void orb5x::spclibs::init ( int  n,
int  nterms,
GEMat &  mat,
int  kmat = 0,
int  mrows = -1 
)

Initialize a real general dense matrix.

Parameters
[in]nNumber of columns and default row count.
[in]ntermsInformational assembled-term count.
[out]matAllocated matrix descriptor.
[in]kmatOptional caller-defined identifier.
[in]mrowsOptional row count; negative selects n. Allocate matrix storage and initialize dimensions, bandwidths, identifiers, and pivots.

◆ init() [8/8]

void orb5x::spclibs::init ( int  n,
int  nterms,
ZGEMat &  mat,
int  kmat = 0,
int  mrows = -1 
)

Initialize a real general dense matrix.

Parameters
[in]nNumber of columns and default row count.
[in]ntermsInformational assembled-term count.
[out]matAllocated matrix descriptor.
[in]kmatOptional caller-defined identifier.
[in]mrowsOptional row count; negative selects n. Allocate matrix storage and initialize dimensions, bandwidths, identifiers, and pivots.

◆ interv()

void orb5x::spclibs::interv ( const Real *  xt,
int  lxt,
Real  x,
int &  left,
int &  mflag 
)

Locate interval containing x in a knot sequence.

Given a nondecreasing sequence xt and a value x, finds the largest index left such that xt[left] <= x.

Parameters
xtKnot sequence (lxt elements)
lxtLength of knot sequence
xPoint to locate
leftOutput: index of bracketing value 0 if x < xt[0] i if xt[i] <= x < xt[i+1] lxt-1 if xt[lxt-1] <= x
mflagOutput: indicates position relative to knot sequence -1: x < xt[0] 0: xt[left] <= x < xt[left+1] +1: xt[lxt-1] <= x

Note: Uses 0-based indexing

◆ interv_hint()

void orb5x::spclibs::interv_hint ( const Real *  xt,
int  lxt,
Real  x,
int &  left,
int &  mflag,
int &  ilo 
)

Thread-safe version of interv with explicit previous guess.

Parameters
xtKnot sequence
lxtLength of sequence
xPoint to locate
leftOutput: interval index
mflagOutput: boundary flag
iloPrevious guess for left (updated on output)

◆ is_equid()

bool orb5x::spclibs::is_equid ( const Real *  grid,
int  n 
)

Check if a grid is equidistant.

Parameters
[in]gridGrid coordinates of length n.
[in]nNumber of coordinates.
Returns
true if grid is equidistant (within tolerance)

◆ locintv()

void orb5x::spclibs::locintv ( const Spline1D &  sp,
Real  x,
int &  left 
)

Locate interval containing x in spline knot sequence.

Parameters
[in]spInitialized spline and knot sequence.
[in]xCoordinate to locate; periodic coordinates are wrapped by lperiod.
[out]leftClamped zero-based interval index in [0,nints-1].

◆ maddto() [1/4]

void orb5x::spclibs::maddto ( Real  alpha,
const GBMat &  a,
GBMat &  b 
)

Accumulate B = B + alpha*A without changing storage layout.

Parameters
[in]alphaScalar multiplier.
[in]aSource matrix.
[in,out]bCompatible destination/accumulator matrix.

◆ maddto() [2/4]

void orb5x::spclibs::maddto ( Real  alpha,
const GEMat &  a,
GEMat &  b 
)

Accumulate B = B + alpha*A without changing storage layout.

Parameters
[in]alphaScalar multiplier.
[in]aSource matrix.
[in,out]bCompatible destination/accumulator matrix.

◆ maddto() [3/4]

void orb5x::spclibs::maddto ( Real  alpha,
const PBMat &  a,
PBMat &  b 
)

Accumulate B = B + alpha*A without changing storage layout.

Parameters
[in]alphaScalar multiplier.
[in]aSource matrix.
[in,out]bCompatible destination/accumulator matrix.

◆ maddto() [4/4]

void orb5x::spclibs::maddto ( Real  alpha,
const PeriodicMat &  a,
PeriodicMat &  b 
)

Accumulate B = B + alpha*A without changing storage layout.

Parameters
[in]alphaScalar multiplier.
[in]aSource matrix.
[in,out]bCompatible destination/accumulator matrix.

◆ mcopy() [1/4]

void orb5x::spclibs::mcopy ( const GBMat &  src,
GBMat &  dst 
)

Deep-copy matrix metadata and numerical storage.

Parameters
[in]srcInitialized source matrix.
[out]dstIndependently allocated destination matrix.

◆ mcopy() [2/4]

void orb5x::spclibs::mcopy ( const GEMat &  src,
GEMat &  dst 
)

Deep-copy matrix metadata and numerical storage.

Parameters
[in]srcInitialized source matrix.
[out]dstIndependently allocated destination matrix.

◆ mcopy() [3/4]

void orb5x::spclibs::mcopy ( const PBMat &  src,
PBMat &  dst 
)

Deep-copy matrix metadata and numerical storage.

Parameters
[in]srcInitialized source matrix.
[out]dstIndependently allocated destination matrix.

◆ mcopy() [4/4]

void orb5x::spclibs::mcopy ( const PeriodicMat &  src,
PeriodicMat &  dst 
)

Deep-copy matrix metadata and numerical storage.

Parameters
[in]srcInitialized source matrix.
[out]dstIndependently allocated destination matrix.

◆ ppval()

Real orb5x::spclibs::ppval ( const Real *  t,
const Real *  coef,
int  n,
int  k,
Real  x,
int &  left 
)

Evaluate polynomial in piecewise polynomial form.

Evaluates the piecewise polynomial at point x using the PPFORM coefficients.

Parameters
tBreakpoints (n+1 elements)
coefPPFORM coefficients (k x n, column-major)
nNumber of intervals
kOrder of polynomial
xPoint at which to evaluate
leftHint for interval location
Returns
Value of polynomial at x

◆ putcol() [1/5]

void orb5x::spclibs::putcol ( GBMat &  mat,
int  j,
const Real *  col 
)

Replace one zero-based logical matrix column.

Parameters
[in,out]matMatrix to modify.
[in]jZero-based logical column.
[in]colContiguous input with at least mrows elements.

◆ putcol() [2/5]

void orb5x::spclibs::putcol ( GEMat &  mat,
int  j,
const Real *  col 
)

Replace one zero-based logical matrix column.

Parameters
[in,out]matMatrix to modify.
[in]jZero-based logical column.
[in]colContiguous input with at least mrows elements.

◆ putcol() [3/5]

void orb5x::spclibs::putcol ( PBMat &  mat,
int  j,
const Real *  col 
)

Replace one zero-based logical matrix column.

Parameters
[in,out]matMatrix to modify.
[in]jZero-based logical column.
[in]colContiguous input with at least mrows elements.

◆ putcol() [4/5]

void orb5x::spclibs::putcol ( PeriodicMat &  mat,
int  j,
const Real *  col 
)

Replace one zero-based logical matrix column.

Parameters
[in,out]matMatrix to modify.
[in]jZero-based logical column.
[in]colContiguous input with at least mrows elements.

◆ putcol() [5/5]

void orb5x::spclibs::putcol ( ZPBMat &  mat,
int  j,
const Complex *  col 
)

Replace one zero-based logical matrix column.

Parameters
[in,out]matMatrix to modify.
[in]jZero-based logical column.
[in]colContiguous input with at least mrows elements.

◆ putele() [1/6]

void orb5x::spclibs::putele ( GBMat &  mat,
Real  val,
int  i,
int  j 
)

Assign one zero-based logical matrix element.

Parameters
[in,out]matMatrix to modify.
[in]valNew scalar value.
[in]iZero-based logical row.
[in]jZero-based logical column.

◆ putele() [2/6]

void orb5x::spclibs::putele ( PBMat &  mat,
Real  val,
int  i,
int  j 
)

Assign one zero-based logical matrix element.

Parameters
[in,out]matMatrix to modify.
[in]valNew scalar value.
[in]iZero-based logical row.
[in]jZero-based logical column.

◆ putele() [3/6]

void orb5x::spclibs::putele ( PeriodicMat &  mat,
Real  val,
int  i,
int  j 
)

Assign one zero-based logical matrix element.

Parameters
[in,out]matMatrix to modify.
[in]valNew scalar value.
[in]iZero-based logical row.
[in]jZero-based logical column.

◆ putele() [4/6]

void orb5x::spclibs::putele ( ZGBMat &  mat,
Complex  val,
int  i,
int  j 
)

Assign one zero-based logical matrix element.

Parameters
[in,out]matMatrix to modify.
[in]valNew scalar value.
[in]iZero-based logical row.
[in]jZero-based logical column.

◆ putele() [5/6]

void orb5x::spclibs::putele ( ZPBMat &  mat,
Complex  val,
int  i,
int  j 
)

Assign one zero-based logical matrix element.

Parameters
[in,out]matMatrix to modify.
[in]valNew scalar value.
[in]iZero-based logical row.
[in]jZero-based logical column.

◆ putele() [6/6]

void orb5x::spclibs::putele ( ZPeriodicMat &  mat,
Complex  val,
int  i,
int  j 
)

Assign one zero-based logical matrix element.

Parameters
[in,out]matMatrix to modify.
[in]valNew scalar value.
[in]iZero-based logical row.
[in]jZero-based logical column.

◆ putrow() [1/5]

void orb5x::spclibs::putrow ( GBMat &  mat,
int  i,
const Real *  row 
)

Replace one zero-based logical matrix row.

Parameters
[in,out]matMatrix to modify.
[in]iZero-based logical row.
[in]rowContiguous input with at least ncols elements.

◆ putrow() [2/5]

void orb5x::spclibs::putrow ( GEMat &  mat,
int  i,
const Real *  row 
)

Replace one zero-based logical matrix row.

Parameters
[in,out]matMatrix to modify.
[in]iZero-based logical row.
[in]rowContiguous input with at least ncols elements.

◆ putrow() [3/5]

void orb5x::spclibs::putrow ( PBMat &  mat,
int  i,
const Real *  row 
)

Replace one zero-based logical matrix row.

Parameters
[in,out]matMatrix to modify.
[in]iZero-based logical row.
[in]rowContiguous input with at least ncols elements.

◆ putrow() [4/5]

void orb5x::spclibs::putrow ( PeriodicMat &  mat,
int  i,
const Real *  row 
)

Replace one zero-based logical matrix row.

Parameters
[in,out]matMatrix to modify.
[in]iZero-based logical row.
[in]rowContiguous input with at least ncols elements.

◆ putrow() [5/5]

void orb5x::spclibs::putrow ( ZPBMat &  mat,
int  i,
const Complex *  row 
)

Replace one zero-based logical matrix row.

Parameters
[in,out]matMatrix to modify.
[in]iZero-based logical row.
[in]rowContiguous input with at least ncols elements.

◆ set_splcoef()

void orb5x::spclibs::set_splcoef ( Spline1D &  sp,
const Real *  fvals,
Real *  bcoef 
)

Set spline coefficients from function values.

Computes spline coefficients by interpolation: solve M * bcoef = fvals where M is the interpolation matrix.

Parameters
[in]spSpline with its appropriate periodic or nonperiodic interpolation matrix initialized.
[in]fvalsFunction values at sp.dim interpolation sites.
[out]bcoefArray of sp.dim coefficients; initially receives a copy of fvals and is overwritten by the matrix solve when the matrix exists.

◆ set_spline() [1/3]

void orb5x::spclibs::set_spline ( const int  p[2],
const int  ngauss[2],
const Real *  grid1,
int  ngrid1,
const Real *  grid2,
int  ngrid2,
Spline2D &  sp,
const bool  period[2] = nullptr,
bool  nlppform = true,
const int  nlequid[2] = nullptr 
)

Initialize a 2D spline.

Parameters
[in]pPolynomial degrees [direction 1,direction 2].
[in]ngaussGauss-point counts per interval in the two directions.
[in]grid1First-direction grid edges of length ngrid1.
[in]ngrid1Number of first-direction grid edges.
[in]grid2Second-direction grid edges of length ngrid2.
[in]ngrid2Number of second-direction grid edges.
[out]spInitialized tensor-product descriptor and coefficient View.
[in]periodOptional two-element periodicity flags; null means nonperiodic.
[in]nlppformUse cached piecewise-polynomial basis evaluation.
[in]nlequidOptional two-element equidistance overrides; null auto-detects.
Fortran reference bsplines.f90: two-dimensional set_spline interface.

◆ set_spline() [2/3]

void orb5x::spclibs::set_spline ( const int  p[3],
const int  ngauss[3],
const Real *  grid1,
int  ngrid1,
const Real *  grid2,
int  ngrid2,
const Real *  grid3,
int  ngrid3,
Spline2D1D &  sp,
const bool  period[3] = nullptr,
bool  nlppform = true,
const int  nlequid[3] = nullptr 
)

Initialize a 2D+1D spline.

Parameters
[in]pPolynomial degrees for the three directions.
[in]ngaussGauss-point counts per interval for the three directions.
[in]grid1First-direction grid edges of length ngrid1.
[in]ngrid1Number of first-direction grid edges.
[in]grid2Second-direction grid edges of length ngrid2.
[in]ngrid2Number of second-direction grid edges.
[in]grid3Third-direction grid edges of length ngrid3.
[in]ngrid3Number of third-direction grid edges.
[out]spInitialized 2-D-plus-1-D descriptor and coefficient View.
[in]periodOptional three-element periodicity flags; null means nonperiodic.
[in]nlppformUse cached piecewise-polynomial basis evaluation.
[in]nlequidOptional three-element equidistance overrides; null auto-detects.
Fortran reference bsplines.f90: set_spline2d1d family.

◆ set_spline() [3/3]

void orb5x::spclibs::set_spline ( int  p,
int  ngauss,
const Real *  grid,
int  ngrid,
Spline1D &  sp,
bool  period = false,
bool  nlppform = true,
int  nlequid = -1 
)

Initialize a 1D spline.

Parameters
[in]pPolynomial degree; the stored order is p+1.
[in]ngaussGauss–Legendre points per interval, or zero to omit quadrature.
[in]gridStrictly ordered grid edges of length ngrid.
[in]ngridNumber of grid edges; creates ngrid-1 intervals.
[out]spInitialized descriptor, cached bases, quadrature, integrals, and coefficients.
[in]periodWrap the knot extension and basis indices periodically.
[in]nlppformUse cached piecewise-polynomial basis values during evaluation.
[in]nlequidEquidistance override: negative detects it, zero disables it, and a positive value enables the direct uniform-grid locator.
Fortran reference bsplines.f90: set_spline1d.

◆ updtmat() [1/7]

void orb5x::spclibs::updtmat ( GBMat &  mat,
Real  val,
int  i,
int  j 
)

Update matrix element: mat(i,j) += val.

Parameters
matMatrix to update
valValue to add
iRow index (0-based)
jColumn index (0-based)

◆ updtmat() [2/7]

void orb5x::spclibs::updtmat ( GEMat &  mat,
Real  val,
int  i,
int  j 
)

Update matrix element: mat(i,j) += val.

Parameters
matMatrix to update
valValue to add
iRow index (0-based)
jColumn index (0-based)

◆ updtmat() [3/7]

void orb5x::spclibs::updtmat ( PBMat &  mat,
Real  val,
int  i,
int  j 
)

Update matrix element: mat(i,j) += val.

Parameters
matMatrix to update
valValue to add
iRow index (0-based)
jColumn index (0-based)

◆ updtmat() [4/7]

void orb5x::spclibs::updtmat ( PeriodicMat &  mat,
Real  val,
int  i,
int  j 
)

Update matrix element: mat(i,j) += val.

Parameters
matMatrix to update
valValue to add
iRow index (0-based)
jColumn index (0-based)

◆ updtmat() [5/7]

void orb5x::spclibs::updtmat ( ZGBMat &  mat,
Complex  val,
int  i,
int  j 
)

Update matrix element: mat(i,j) += val.

Parameters
matMatrix to update
valValue to add
iRow index (0-based)
jColumn index (0-based)

◆ updtmat() [6/7]

void orb5x::spclibs::updtmat ( ZPBMat &  mat,
Complex  val,
int  i,
int  j 
)

Update matrix element: mat(i,j) += val.

Parameters
matMatrix to update
valValue to add
iRow index (0-based)
jColumn index (0-based)

◆ updtmat() [7/7]

void orb5x::spclibs::updtmat ( ZPeriodicMat &  mat,
Complex  val,
int  i,
int  j 
)

Update matrix element: mat(i,j) += val.

Parameters
matMatrix to update
valValue to add
iRow index (0-based)
jColumn index (0-based)

◆ vmx() [1/10]

void orb5x::spclibs::vmx ( const GBMat &  mat,
const Real *  x,
Real *  y 
)

Compute y = A*x.

Parameters
matMatrix A
xInput vector
yOutput vector

◆ vmx() [2/10]

void orb5x::spclibs::vmx ( const GBMat &  mat,
const Real *  x,
Real *  y,
int  nrhs 
)

Compute Y = A*X for multiple vectors.

Parameters
matMatrix A
xInput vectors (n x nrhs)
yOutput vectors (n x nrhs)
nrhsNumber of right-hand sides

◆ vmx() [3/10]

void orb5x::spclibs::vmx ( const GEMat &  mat,
const Real *  x,
Real *  y 
)

Compute y = A*x.

Parameters
matMatrix A
xInput vector
yOutput vector

◆ vmx() [4/10]

void orb5x::spclibs::vmx ( const GEMat &  mat,
const Real *  x,
Real *  y,
int  nrhs 
)

Compute Y = A*X for multiple vectors.

Parameters
matMatrix A
xInput vectors (n x nrhs)
yOutput vectors (n x nrhs)
nrhsNumber of right-hand sides

◆ vmx() [5/10]

void orb5x::spclibs::vmx ( const PBMat &  mat,
const Real *  x,
Real *  y 
)

Compute y = A*x.

Parameters
matMatrix A
xInput vector
yOutput vector

◆ vmx() [6/10]

void orb5x::spclibs::vmx ( const PeriodicMat &  mat,
const Real *  x,
Real *  y 
)

Compute y = A*x.

Parameters
matMatrix A
xInput vector
yOutput vector

◆ vmx() [7/10]

void orb5x::spclibs::vmx ( const ZGBMat &  mat,
const Complex *  x,
Complex *  y 
)

Compute y = A*x.

Parameters
matMatrix A
xInput vector
yOutput vector

◆ vmx() [8/10]

void orb5x::spclibs::vmx ( const ZGEMat &  mat,
const Complex *  x,
Complex *  y 
)

Compute y = A*x.

Parameters
matMatrix A
xInput vector
yOutput vector

◆ vmx() [9/10]

void orb5x::spclibs::vmx ( const ZPBMat &  mat,
const Complex *  x,
Complex *  y 
)

Compute y = A*x.

Parameters
matMatrix A
xInput vector
yOutput vector

◆ vmx() [10/10]

void orb5x::spclibs::vmx ( const ZPeriodicMat &  mat,
const Complex *  x,
Complex *  y 
)

Compute y = A*x.

Parameters
matMatrix A
xInput vector
yOutput vector

Variable Documentation

◆ JMAX

constexpr int orb5x::spclibs::JMAX = 20
constexpr

Maximum spline order supported (degree + 1)