|
ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
|
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 |
| using | spline2d = Spline2D |
| using | spline2d1d = 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) |
| void | bsolve (const PBMat &mat, Real *b, int nrhs=1) |
| void | bsolve (const PeriodicMat &mat, Real *b, int nrhs=1) |
| void | bsolve (const ZGBMat &mat, Complex *b, int nrhs=1) |
| void | bsolve (const ZGEMat &mat, Complex *b, int nrhs=1) |
| void | bsolve (const ZPBMat &mat, Complex *b, int nrhs=1) |
| void | bsolve (const ZPeriodicMat &mat, Complex *b, int nrhs=1) |
| 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) |
| 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) |
| void | destroy (GEMat &mat) |
| void | destroy (PBMat &mat) |
| void | destroy (PeriodicMat &mat) |
| void | destroy (ZGBMat &mat) |
| void | destroy (ZGEMat &mat) |
| void | destroy (ZPBMat &mat) |
| void | destroy (ZPeriodicMat &mat) |
| void | destroy_sp (Spline1D &sp) |
| void | destroy_sp (Spline2D &sp) |
| void | destroy_sp (Spline2D1D &sp) |
| Real | determinant (const GBMat &mat) |
| Compute determinant of factorized matrix. | |
| Real | determinant (const GEMat &mat) |
| Real | determinant (const PBMat &mat) |
| Complex | determinant (const ZGBMat &mat) |
| Complex | determinant (const ZGEMat &mat) |
| Complex | determinant (const ZPBMat &mat) |
| int | factor (GBMat &mat) |
| Compute LU factorization of matrix. | |
| int | factor (GEMat &mat) |
| int | factor (PBMat &mat) |
| int | factor (PeriodicMat &mat) |
| int | factor (ZGBMat &mat) |
| int | factor (ZGEMat &mat) |
| int | factor (ZPBMat &mat) |
| int | factor (ZPeriodicMat &mat) |
| 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 2D 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) |
| Get column of matrix. | |
| void | getcol (const PBMat &mat, int j, Real *col) |
| void | getcol (const PeriodicMat &mat, int j, Real *col) |
| Real | getele (const GBMat &mat, int i, int j) |
| Get matrix element. | |
| Real | getele (const PBMat &mat, int i, int j) |
| Real | getele (const PeriodicMat &mat, int i, int j) |
| Complex | getele (const ZGBMat &mat, int i, int j) |
| Complex | getele (const ZPBMat &mat, int i, int j) |
| Complex | getele (const ZPeriodicMat &mat, int i, int j) |
| void | getrow (const GBMat &mat, int i, Real *row) |
| Get row of matrix. | |
| void | getrow (const GEMat &mat, int i, Real *row) |
| void | getrow (const PBMat &mat, int i, Real *row) |
| void | getrow (const PeriodicMat &mat, int i, Real *row) |
| void | getrow (const ZPBMat &mat, int i, Complex *row) |
| 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) |
| Real * | getvalp (PBMat &mat, int i, int j) |
| Complex * | getvalp (ZGBMat &mat, int i, int j) |
| Complex * | getvalp (ZGEMat &mat, int i, int j) |
| Complex * | getvalp (ZPBMat &mat, int i, int j) |
| 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 2D spline on a 2D 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 periodic band matrix. | |
| void | init (int kl, int ku, int n, int nterms, ZGBMat &mat, int kmat=0, int mrows=-1) |
| void | init (int kl, int ku, int n, int nterms, ZPeriodicMat &mat, int kmat=0) |
| void | init (int ku, int n, int nterms, PBMat &mat, int kmat=0) |
| Initialize a packed band matrix. | |
| void | init (int ku, int n, int nterms, ZPBMat &mat, int kmat=0) |
| void | init (int n, int nterms, GEMat &mat, int kmat=0, int mrows=-1) |
| Initialize a general dense matrix. | |
| void | init (int n, int nterms, ZGEMat &mat, int kmat=0, int mrows=-1) |
| 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) |
| Add matrices: B = B + alpha*A. | |
| void | maddto (Real alpha, const GEMat &a, GEMat &b) |
| void | maddto (Real alpha, const PBMat &a, PBMat &b) |
| void | maddto (Real alpha, const PeriodicMat &a, PeriodicMat &b) |
| void | mcopy (const GBMat &src, GBMat &dst) |
| void | mcopy (const GEMat &src, GEMat &dst) |
| void | mcopy (const PBMat &src, PBMat &dst) |
| void | mcopy (const PeriodicMat &src, PeriodicMat &dst) |
| 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) |
| Set column of matrix. | |
| void | putcol (GEMat &mat, int j, const Real *col) |
| void | putcol (PBMat &mat, int j, const Real *col) |
| void | putcol (PeriodicMat &mat, int j, const Real *col) |
| void | putcol (ZPBMat &mat, int j, const Complex *col) |
| void | putele (GBMat &mat, Real val, int i, int j) |
| Set matrix element. | |
| void | putele (PBMat &mat, Real val, int i, int j) |
| void | putele (PeriodicMat &mat, Real val, int i, int j) |
| void | putele (ZGBMat &mat, Complex val, int i, int j) |
| void | putele (ZPBMat &mat, Complex val, int i, int j) |
| void | putele (ZPeriodicMat &mat, Complex val, int i, int j) |
| void | putrow (GBMat &mat, int i, const Real *row) |
| Set row of matrix. | |
| void | putrow (GEMat &mat, int i, const Real *row) |
| void | putrow (PBMat &mat, int i, const Real *row) |
| void | putrow (PeriodicMat &mat, int i, const Real *row) |
| void | putrow (ZPBMat &mat, int i, const Complex *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) |
| void | updtmat (PBMat &mat, Real val, int i, int j) |
| void | updtmat (PeriodicMat &mat, Real val, int i, int j) |
| void | updtmat (ZGBMat &mat, Complex val, int i, int j) |
| void | updtmat (ZPBMat &mat, Complex val, int i, int j) |
| void | updtmat (ZPeriodicMat &mat, Complex val, int i, int j) |
| 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) |
| void | vmx (const GEMat &mat, const Real *x, Real *y, int nrhs) |
| void | vmx (const PBMat &mat, const Real *x, Real *y) |
| void | vmx (const PeriodicMat &mat, const Real *x, Real *y) |
| void | vmx (const ZGBMat &mat, const Complex *x, Complex *y) |
| void | vmx (const ZGEMat &mat, const Complex *x, Complex *y) |
| void | vmx (const ZPBMat &mat, const Complex *x, Complex *y) |
| void | vmx (const ZPeriodicMat &mat, const Complex *x, Complex *y) |
Variables | |
| constexpr int | JMAX = 20 |
| Maximum spline order supported (degree + 1). | |
| using orb5x::spclibs::spline1d = Spline1D |
| using orb5x::spclibs::spline2d = Spline2D |
| using orb5x::spclibs::spline2d1d = Spline2D1D |
Evaluate basis functions and derivatives at a point.
| x | Point at which to evaluate |
| sp | Spline |
| fun | Output: basis function values and derivatives fun[i + j*order] = jth derivative of ith basis function i = 0, ..., order-1 (basis functions) j = 0, ..., nderiv-1 (derivatives) |
| left | Interval index (1-based as in Fortran) |
| nderiv | Number of derivatives to compute (including function value) |
| void orb5x::spclibs::bsolve | ( | const PeriodicMat & | mat, |
| Real * | b, | ||
| int | nrhs = 1 ) |
| void orb5x::spclibs::bsolve | ( | const ZPeriodicMat & | mat, |
| Complex * | b, | ||
| int | nrhs = 1 ) |
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)
| t | Knot sequence (at least left+jhigh elements) |
| jhigh | Order of B-splines to evaluate |
| x | Point at which to evaluate |
| left | Index such that t[left] <= x < t[left+1] |
| biatx | Output: B-spline values (jhigh elements) |
Note: Uses 0-based indexing (Fortran version uses 1-based)
| 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.
| t | Knot sequence (at least left+k elements) |
| k | Order of B-splines |
| x | Point at which to evaluate |
| left | Index such that t[left] <= x < t[left+1] |
| a | Workspace array (k x k) |
| dbiatx | Output: B-spline values and derivatives (k x nderiv) dbiatx[i + m*k] = (m-1)th derivative of (left-k+i+1)th B-spline |
| nderiv | Number of derivatives (including value) to compute |
Note: Uses 0-based indexing
| 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.
| t | Knot sequence |
| bcoef | B-spline coefficients (dim elements) |
| n | Number of intervals |
| k | Order |
| scrtch | Scratch array (k x k) |
| ppcoef | Output: PPFORM coefficients (k x n) |
Calculate integral of each basis function.
| sp | Spline |
| integ | Output: integrals (sp.dim elements) |
Compute mass matrix for FEM discretization.
| sp | Spline |
| mat | Output: mass matrix |
| void orb5x::spclibs::CompMassMatrix | ( | const Spline1D & | sp, |
| PeriodicMat & | mat ) |
| 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).
| x | Point at which to evaluate |
| sp | Spline |
| fun | Output: basis function values and derivatives |
| left | Output (optional): interval index (0-based) |
| nderiv | Number of derivatives |
| void orb5x::spclibs::destroy | ( | GBMat & | mat | ) |
| void orb5x::spclibs::destroy | ( | GEMat & | mat | ) |
| void orb5x::spclibs::destroy | ( | PBMat & | mat | ) |
| void orb5x::spclibs::destroy | ( | PeriodicMat & | mat | ) |
| void orb5x::spclibs::destroy | ( | ZGBMat & | mat | ) |
| void orb5x::spclibs::destroy | ( | ZGEMat & | mat | ) |
| void orb5x::spclibs::destroy | ( | ZPBMat & | mat | ) |
| void orb5x::spclibs::destroy | ( | ZPeriodicMat & | mat | ) |
| void orb5x::spclibs::destroy_sp | ( | Spline1D & | sp | ) |
| void orb5x::spclibs::destroy_sp | ( | Spline2D & | sp | ) |
| void orb5x::spclibs::destroy_sp | ( | Spline2D1D & | sp | ) |
Compute determinant of factorized matrix.
| mat | Factorized matrix |
| int orb5x::spclibs::factor | ( | GBMat & | mat | ) |
Compute LU factorization of matrix.
| mat | Matrix to factorize (modified in place) |
For GBMat: Uses LAPACK DGBTRF For GEMat: Uses LAPACK DGETRF For PBMat: Uses LAPACK DPBTRF (Cholesky) For PeriodicMat: Uses Woodbury formula with DGBTRF
| int orb5x::spclibs::factor | ( | GEMat & | mat | ) |
| int orb5x::spclibs::factor | ( | PBMat & | mat | ) |
| int orb5x::spclibs::factor | ( | PeriodicMat & | mat | ) |
| int orb5x::spclibs::factor | ( | ZGBMat & | mat | ) |
| int orb5x::spclibs::factor | ( | ZGEMat & | mat | ) |
| int orb5x::spclibs::factor | ( | ZPBMat & | mat | ) |
| int orb5x::spclibs::factor | ( | ZPeriodicMat & | mat | ) |
Compute Gauss-Legendre quadrature points and weights.
Computes the n-point Gauss-Legendre quadrature rule on [x1, x2].
| x1 | Left endpoint of interval |
| x2 | Right endpoint of interval |
| x | Output: quadrature points (n elements) |
| w | Output: quadrature weights (n elements) |
| n | Number of quadrature points |
| void orb5x::spclibs::get_dim | ( | const Spline1D & | sp, |
| int & | dim, | ||
| int * | nx = nullptr, | ||
| int * | nidbas = nullptr ) |
Get dimension information from 1D spline.
| sp | Input spline |
| dim | Output: dimension of spline space |
| nx | Output (optional): number of intervals |
| nidbas | Output (optional): spline degree |
| void orb5x::spclibs::get_dim | ( | const Spline2D & | sp, |
| int | dim[2], | ||
| int | nx[2] = nullptr, | ||
| int | nidbas[2] = nullptr ) |
Get dimension information from 2D spline.
| 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.
| sp | Input spline |
| n | Output: number of Gauss points per interval |
| i | Optional: interval index (0-based) |
| x | Output (if i provided): Gauss points for interval i |
| w | Output (if i provided): Gauss weights for interval i |
Get function values from spline coefficients.
Computes fvals = M * bcoef where M is the interpolation matrix.
| sp | Spline |
| bcoef | Spline coefficients |
| fvals | Output: function values |
| void orb5x::spclibs::getcol | ( | const PeriodicMat & | mat, |
| int | j, | ||
| Real * | col ) |
Get matrix element.
| mat | Matrix |
| i | Row index (0-based) |
| j | Column index (0-based) |
| Real orb5x::spclibs::getele | ( | const PeriodicMat & | mat, |
| int | i, | ||
| int | j ) |
| Complex orb5x::spclibs::getele | ( | const ZPeriodicMat & | mat, |
| int | i, | ||
| int | j ) |
Get row of matrix.
| mat | Matrix |
| i | Row index (0-based) |
| row | Output array (must be pre-allocated with size ncols) |
| void orb5x::spclibs::getrow | ( | const PeriodicMat & | mat, |
| int | i, | ||
| Real * | row ) |
Get pointer to matrix value for element (i,j) Used for direct access to storage for assembly.
| 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.
| sp | Spline |
| xgrid | Grid of points (npts points) |
| npts | Number of grid points |
| bcoef | Spline coefficients (sp.dim elements) |
| fvals | Output: function values at grid points |
| jder | Derivative order to compute (default 0 = function value) |
| 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 2D spline on a 2D grid.
| 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).
| sp | 2D+1D spline (sp12 for first two dimensions, sp3 for third) |
| xgrid1 | Grid points in direction 1 (npts1 points) |
| npts1 | Number of grid points in direction 1 |
| xgrid2 | Grid points in direction 2 (npts2 points) |
| npts2 | Number of grid points in direction 2 |
| xgrid3 | Grid points in direction 3 (npts3 points) |
| npts3 | Number of grid points in direction 3 |
| bcoef | Spline coefficients (dim1 * dim2 * dim3 elements, row-major) |
| fvals | Output: function values at grid points (npts1 * npts2 * npts3, row-major) |
| jder1 | Derivative order in direction 1 (default 0) |
| jder2 | Derivative order in direction 2 (default 0) |
| jder3 | Derivative order in direction 3 (default 0) |
| 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.
| kl | Number of subdiagonals |
| ku | Number of superdiagonals |
| n | Matrix dimension (square matrix) |
| nterms | Number of non-zero terms (informational) |
| mat | Output matrix |
| kmat | Optional matrix identifier |
| mrows | Optional number of rows (defaults to n) |
Referenced by orb5x::Zbmat::allocate_band().
| void orb5x::spclibs::init | ( | int | kl, |
| int | ku, | ||
| int | n, | ||
| int | nterms, | ||
| PeriodicMat & | mat, | ||
| int | kmat = 0 ) |
Initialize a periodic band matrix.
| void orb5x::spclibs::init | ( | int | kl, |
| int | ku, | ||
| int | n, | ||
| int | nterms, | ||
| ZGBMat & | mat, | ||
| int | kmat = 0, | ||
| int | mrows = -1 ) |
| void orb5x::spclibs::init | ( | int | kl, |
| int | ku, | ||
| int | n, | ||
| int | nterms, | ||
| ZPeriodicMat & | mat, | ||
| int | kmat = 0 ) |
| void orb5x::spclibs::init | ( | int | ku, |
| int | n, | ||
| int | nterms, | ||
| PBMat & | mat, | ||
| int | kmat = 0 ) |
Initialize a packed band matrix.
| void orb5x::spclibs::init | ( | int | ku, |
| int | n, | ||
| int | nterms, | ||
| ZPBMat & | mat, | ||
| int | kmat = 0 ) |
| void orb5x::spclibs::init | ( | int | n, |
| int | nterms, | ||
| GEMat & | mat, | ||
| int | kmat = 0, | ||
| int | mrows = -1 ) |
Initialize a general dense matrix.
| void orb5x::spclibs::init | ( | int | n, |
| int | nterms, | ||
| ZGEMat & | mat, | ||
| int | kmat = 0, | ||
| int | mrows = -1 ) |
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.
| xt | Knot sequence (lxt elements) |
| lxt | Length of knot sequence |
| x | Point to locate |
| left | Output: index of bracketing value 0 if x < xt[0] i if xt[i] <= x < xt[i+1] lxt-1 if xt[lxt-1] <= x |
| mflag | Output: 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
| 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.
| xt | Knot sequence |
| lxt | Length of sequence |
| x | Point to locate |
| left | Output: interval index |
| mflag | Output: boundary flag |
| ilo | Previous guess for left (updated on output) |
| bool orb5x::spclibs::is_equid | ( | const Real * | grid, |
| int | n ) |
Check if a grid is equidistant.
| grid | Grid points |
| n | Number of grid points |
Locate interval containing x in spline knot sequence.
| sp | Spline |
| x | Point to locate |
| left | Output: interval index (0-based, 0 to nints-1) |
Add matrices: B = B + alpha*A.
| void orb5x::spclibs::maddto | ( | Real | alpha, |
| const PeriodicMat & | a, | ||
| PeriodicMat & | b ) |
| void orb5x::spclibs::mcopy | ( | const PeriodicMat & | src, |
| PeriodicMat & | dst ) |
Evaluate polynomial in piecewise polynomial form.
Evaluates the piecewise polynomial at point x using the PPFORM coefficients.
| t | Breakpoints (n+1 elements) |
| coef | PPFORM coefficients (k x n, column-major) |
| n | Number of intervals |
| k | Order of polynomial |
| x | Point at which to evaluate |
| left | Hint for interval location |
| void orb5x::spclibs::putcol | ( | PeriodicMat & | mat, |
| int | j, | ||
| const Real * | col ) |
| void orb5x::spclibs::putele | ( | PeriodicMat & | mat, |
| Real | val, | ||
| int | i, | ||
| int | j ) |
| void orb5x::spclibs::putele | ( | ZPeriodicMat & | mat, |
| Complex | val, | ||
| int | i, | ||
| int | j ) |
| void orb5x::spclibs::putrow | ( | PeriodicMat & | mat, |
| int | i, | ||
| const Real * | row ) |
Set spline coefficients from function values.
Computes spline coefficients by interpolation: solve M * bcoef = fvals where M is the interpolation matrix.
| sp | Spline (must have interpolation matrix set up) |
| fvals | Function values at interpolation sites |
| bcoef | Output: spline coefficients |
| 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.
| p | Degrees in each direction (p[0], p[1]) |
| ngauss | Number of Gauss points in each direction |
| grid1 | Grid points in direction 1 |
| ngrid1 | Number of grid points in direction 1 |
| grid2 | Grid points in direction 2 |
| ngrid2 | Number of grid points in direction 2 |
| sp | Output: initialized 2D spline |
| period | Periodicity flags for each direction |
| nlppform | Use PPFORM for evaluation |
| nlequid | Equidistant flags (-1 for auto-detect) |
| 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.
| p | Degrees in each direction (p[0], p[1], p[2]) |
| ngauss | Number of Gauss points in each direction |
| grid1,grid2,grid3 | Grid points in each direction |
| ngrid1,ngrid2,ngrid3 | Number of grid points |
| sp | Output: initialized 2D+1D spline |
| period | Periodicity flags |
| nlppform | Use PPFORM |
| nlequid | Equidistant flags |
| 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.
| p | Spline degree (order = p + 1) |
| ngauss | Number of Gauss quadrature points per interval (0 to skip) |
| grid | Grid points (nints+1 points defining nints intervals) |
| ngrid | Number of grid points |
| sp | Output: initialized spline |
| period | Whether the spline is periodic |
| nlppform | Whether to use PPFORM for evaluation (default true) |
| nlequid | Whether the grid is equidistant (auto-detected if not specified) |
Update matrix element: mat(i,j) += val.
| mat | Matrix to update |
| val | Value to add |
| i | Row index (0-based) |
| j | Column index (0-based) |
| void orb5x::spclibs::updtmat | ( | PeriodicMat & | mat, |
| Real | val, | ||
| int | i, | ||
| int | j ) |
| void orb5x::spclibs::updtmat | ( | ZPeriodicMat & | mat, |
| Complex | val, | ||
| int | i, | ||
| int | j ) |
Compute y = A*x.
| mat | Matrix A |
| x | Input vector |
| y | Output vector |
Compute Y = A*X for multiple vectors.
| mat | Matrix A |
| x | Input vectors (n x nrhs) |
| y | Output vectors (n x nrhs) |
| nrhs | Number of right-hand sides |
| void orb5x::spclibs::vmx | ( | const PeriodicMat & | mat, |
| const Real * | x, | ||
| Real * | y ) |
| void orb5x::spclibs::vmx | ( | const ZPeriodicMat & | mat, |
| const Complex * | x, | ||
| Complex * | y ) |
|
constexpr |
Maximum spline order supported (degree + 1).