Nz contiguous
elements, arranged is row-order (C-style) format. That is, the offset
of the (ix,iy,iz) element is (ix*(Ny+iy)*Nz+iz). Complex numbers are
stored in the standard format of (real,imaginary) pairs, which the
real element first.
Function prototypes:
Single-precision real:
multi_UBspline_1d_s * create_multi_UBspline_1d_s (Ugrid x_grid, BCtype_s xBC, int num_splines);
multi_UBspline_2d_s * create_multi_UBspline_2d_s (Ugrid x_grid, Ugrid y_grid,
BCtype_s xBC, BCtype_s yBC, int num_splines);
multi_UBspline_3d_s * create_multi_UBspline_3d_s (Ugrid x_grid, Ugrid y_grid, Ugrid z_grid,
BCtype_s xBC, BCtype_s yBC, BCtype_s zBC, int num_splines);
void set_multi_UBspline_1d_s (multi_UBspline_1d_s* spline, int spline_num, float *data);
void set_multi_UBspline_2d_s (multi_UBspline_2d_s* spline, int spline_num, float *data);
void set_multi_UBspline_3d_s (multi_UBspline_3d_s* spline, int spline_num, float *data);
Single-precision complex:
multi_UBspline_1d_c * create_multi_UBspline_1d_c (Ugrid x_grid, BCtype_c xBC, int num_splines);
multi_UBspline_2d_c * create_multi_UBspline_2d_c (Ugrid x_grid, Ugrid y_grid,
BCtype_c xBC, BCtype_c yBC, int num_splines);
multi_UBspline_3d_c * create_multi_UBspline_3d_c (Ugrid x_grid, Ugrid y_grid, Ugrid z_grid,
BCtype_c xBC, BCtype_c yBC, BCtype_c zBC,
int num_splines);
void set_multi_UBspline_1d_c (multi_UBspline_1d_c* spline, int spline_num, complex_float *data);
void set_multi_UBspline_2d_c (multi_UBspline_2d_c* spline, int spline_num, complex_float *data);
void set_multi_UBspline_3d_c (multi_UBspline_3d_c* spline, int spline_num, complex_float *data);
Double-precision real:
multi_UBspline_1d_d * create_multi_UBspline_1d_d (Ugrid x_grid, BCtype_d xBC, int num_splines);
multi_UBspline_2d_d * create_multi_UBspline_2d_d (Ugrid x_grid, Ugrid y_grid,
BCtype_d xBC, BCtype_d yBC, int num_splines);
multi_UBspline_3d_d * create_multi_UBspline_3d_d (Ugrid x_grid, Ugrid y_grid, Ugrid z_grid,
BCtype_d xBC, BCtype_d yBC, BCtype_d zBC, int num_splines);
void set_multi_UBspline_1d_d (multi_UBspline_1d_d* spline, int spline_num, double *data);
void set_multi_UBspline_2d_d (multi_UBspline_2d_d* spline, int spline_num, double *data);
void set_multi_UBspline_3d_d (multi_UBspline_3d_d* spline, int spline_num, double *data);
Double-precision complex:
multi_UBspline_1d_z * create_multi_UBspline_1d_z (Ugrid x_grid, BCtype_z xBC, int num_splines);
multi_UBspline_2d_z * create_multi_UBspline_2d_z (Ugrid x_grid, Ugrid y_grid,
BCtype_z xBC, BCtype_z yBC, int num_splines);
multi_UBspline_3d_z * create_multi_UBspline_3d_z (Ugrid x_grid, Ugrid y_grid, Ugrid z_grid,
BCtype_z xBC, BCtype_z yBC, BCtype_z zBC,
int num_splines);
void set_multi_UBspline_1d_z (multi_UBspline_1d_z* spline, int spline_num, complex_double *data);
void set_multi_UBspline_2d_z (multi_UBspline_2d_z* spline, int spline_num, complex_double *data);
void set_multi_UBspline_3d_z (multi_UBspline_3d_z* spline, int spline_num, complex_double *data);
Spline destruction
The memory used for spline storage can be freed simply by a call to
void
destroy_Bspline (void *spline);
The spline parameter can be a spline of any type and dimension,
uniform or nonuniform.
Spline evaluation
In contrast to the single-spline routines, eval_multi_UBspline_* routines
evaluate all num_splines splines at a given point with a single call.
The prototypes for the functions are very similar to the single-spline prototypes, but the
value, gradient, hessian, and laplacian arguments are now arrays which much be
of sufficicient size to hold the values for all the splines. If the multi-spline object
was created with N splines, the value parameter must be an array of length N.
Similarly, the gradient array must have dimension N*D, where D is the
spline dimensionality (i.e. 1, 2, or 3). Finally the hessian argument must have
dimension N*D*D.
For each of the four datatypes, there are four evaluation routines, depending on
which quantities need to be computed:
- Value only
- Value and gradient
- Value, gradient, and Laplacian
- Value, gradient, and Hessian (matrix of 2nd derivatives)
For consistency, all results are returned through pointers passed to the evaluation
routines. Currently, no bounds checking is done for the sake of speed. The user is
responsible for ensuring that the points passed to the evaluation functions fall within
the grids specified at the time of spline creation.
Function prototypes:
Single-precision real:
1D
inline void
eval_multi_UBspline_1d_s (multi_UBspline_1d_s * restrict spline,
double x, float* restrict val);
inline void
eval_multi_UBspline_1d_s_vg (multi_UBspline_1d_s * restrict spline, double x,
float* restrict val, float* restrict grad);
inline void
eval_multi_UBspline_1d_s_vgl (multi_UBspline_1d_s * restrict spline, double x,
float* restrict val, float* restrict grad, float* restrict lapl);
inline void /* identical to above routine in 1D */
eval_multi_UBspline_1d_s_vgh (multi_UBspline_1d_s * restrict spline, double x,
float* restrict val, float* restrict grad, float* restrict hess);
2D
inline void
eval_multi_UBspline_2d_s (multi_UBspline_2d_s * restrict spline, double x, double y,
float* restrict val);
inline void
eval_multi_UBspline_2d_s_vg (multi_UBspline_2d_s * restrict spline, double x, double y,
float* restrict val, float* restrict grad);
inline void
eval_multi_UBspline_2d_s_vgl (multi_UBspline_2d_s * restrict spline, double x, double y,
float* restrict val, float* restrict grad, float* restrict lapl);
inline void
eval_multi_UBspline_2d_s_vgh (multi_UBspline_2d_s * restrict spline, double x, double y,
float* restrict val, float* restrict grad, float* restrict hess);
3D
inline void
eval_multi_UBspline_3d_s (multi_UBspline_3d_s * restrict spline, double x, double y, double z,
float* restrict val);
inline void
eval_multi_UBspline_3d_s_vg (multi_UBspline_3d_s * restrict spline, double x, double y, double z,
float* restrict val, float* restrict grad);
inline void
eval_multi_UBspline_3d_s_vgl (multi_UBspline_3d_s * restrict spline, double x, double y, double z,
float* restrict val, float* restrict grad, float* restrict lapl);
inline void
eval_multi_UBspline_3d_s_vgh (multi_UBspline_3d_s * restrict spline, double x, double y,
float* restrict val, float* restrict grad, float* restrict hess);
Single-precision complex:
1D
inline void
eval_multi_UBspline_1d_c (multi_UBspline_1d_c * restrict spline,
double x, complex_float* restrict val);
inline void
eval_multi_UBspline_1d_c_vg (multi_UBspline_1d_c * restrict spline, double x,
complex_float* restrict val, complex_float* restrict grad);
inline void
eval_multi_UBspline_1d_c_vgl (multi_UBspline_1d_c * restrict spline, double x,
complex_float* restrict val, complex_float* restrict grad, complex_float* restrict lapl);
inline void /* identical to above routine in 1D */
eval_multi_UBspline_1d_c_vgh (multi_UBspline_1d_c * restrict spline, double x,
complex_float* restrict val, complex_float* restrict grad, complex_float* restrict hess);
2D
inline void
eval_multi_UBspline_2d_c (multi_UBspline_2d_c * restrict spline, double x, double y,
complex_float* restrict val);
inline void
eval_multi_UBspline_2d_c_vg (multi_UBspline_2d_c * restrict spline, double x, double y,
complex_float* restrict val, complex_float* restrict grad);
inline void
eval_multi_UBspline_2d_c_vgl (multi_UBspline_2d_c * restrict spline, double x, double y,
complex_float* restrict val, complex_float* restrict grad, complex_float* restrict lapl);
inline void
eval_multi_UBspline_2d_c_vgh (multi_UBspline_2d_c * restrict spline, double x, double y,
complex_float* restrict val, complex_float* restrict grad, complex_float* restrict hess);
3D
inline void
eval_multi_UBspline_3d_c (multi_UBspline_3d_c * restrict spline, double x, double y, double z,
complex_float* restrict val);
inline void
eval_multi_UBspline_3d_c_vg (multi_UBspline_3d_c * restrict spline, double x, double y, double z,
complex_float* restrict val, complex_float* restrict grad);
inline void
eval_multi_UBspline_3d_c_vgl (multi_UBspline_3d_c * restrict spline, double x, double y, double z,
complex_float* restrict val, complex_float* restrict grad, complex_float* restrict lapl);
inline void
eval_multi_UBspline_3d_c_vgh (multi_UBspline_3d_c * restrict spline, double x, double y,
complex_float* restrict val, complex_float* restrict grad, complex_float* restrict hess);
Double-precision real:
1D
inline void
eval_multi_UBspline_1d_d (multi_UBspline_1d_d * restrict spline,
double x, double* restrict val);
inline void
eval_multi_UBspline_1d_d_vg (multi_UBspline_1d_d * restrict spline, double x,
double* restrict val, double* restrict grad);
inline void
eval_multi_UBspline_1d_d_vgl (multi_UBspline_1d_d * restrict spline, double x,
double* restrict val, double* restrict grad, double* restrict lapl);
inline void /* identical to above routine in 1D */
eval_multi_UBspline_1d_d_vgh (multi_UBspline_1d_d * restrict spline, double x,
double* restrict val, double* restrict grad, double* restrict hess);
2D
inline void
eval_multi_UBspline_2d_d (multi_UBspline_2d_d * restrict spline, double x, double y,
double* restrict val);
inline void
eval_multi_UBspline_2d_d_vg (multi_UBspline_2d_d * restrict spline, double x, double y,
double* restrict val, double* restrict grad);
inline void
eval_multi_UBspline_2d_d_vgl (multi_UBspline_2d_d * restrict spline, double x, double y,
double* restrict val, double* restrict grad, double* restrict lapl);
inline void
eval_multi_UBspline_2d_d_vgh (multi_UBspline_2d_d * restrict spline, double x, double y,
double* restrict val, double* restrict grad, double* restrict hess);
3D
inline void
eval_multi_UBspline_3d_d (multi_UBspline_3d_d * restrict spline, double x, double y, double z,
double* restrict val);
inline void
eval_multi_UBspline_3d_d_vg (multi_UBspline_3d_d * restrict spline, double x, double y, double z,
double* restrict val, double* restrict grad);
inline void
eval_multi_UBspline_3d_d_vgl (multi_UBspline_3d_d * restrict spline, double x, double y, double z,
double* restrict val, double* restrict grad, double* restrict lapl);
inline void
eval_multi_UBspline_3d_d_vgh (multi_UBspline_3d_d * restrict spline, double x, double y,
double* restrict val, double* restrict grad, double* restrict hess);
Double-precision complex:
1D
inline void
eval_multi_UBspline_1d_z (multi_UBspline_1d_z * restrict spline,
double x, complex_double* restrict val);
inline void
eval_multi_UBspline_1d_z_vg (multi_UBspline_1d_z * restrict spline, double x,
complex_double* restrict val, complex_double* restrict grad);
inline void
eval_multi_UBspline_1d_z_vgl (multi_UBspline_1d_z * restrict spline, double x,
complex_double* restrict val, complex_double* restrict grad, complex_double* restrict lapl);
inline void /* identical to above routine in 1D */
eval_multi_UBspline_1d_z_vgh (multi_UBspline_1d_z * restrict spline, double x,
complex_double* restrict val, complex_double* restrict grad, complex_double* restrict hess);
2D
inline void
eval_multi_UBspline_2d_z (multi_UBspline_2d_z * restrict spline, double x, double y,
complex_double* restrict val);
inline void
eval_multi_UBspline_2d_z_vg (multi_UBspline_2d_z * restrict spline, double x, double y,
complex_double* restrict val, complex_double* restrict grad);
inline void
eval_multi_UBspline_2d_z_vgl (multi_UBspline_2d_z * restrict spline, double x, double y,
complex_double* restrict val, complex_double* restrict grad, complex_double* restrict lapl);
inline void
eval_multi_UBspline_2d_z_vgh (multi_UBspline_2d_z * restrict spline, double x, double y,
complex_double* restrict val, complex_double* restrict grad, complex_double* restrict hess);
3D
inline void
eval_multi_UBspline_3d_z (multi_UBspline_3d_z * restrict spline, double x, double y, double z,
complex_double* restrict val);
inline void
eval_multi_UBspline_3d_z_vg (multi_UBspline_3d_z * restrict spline, double x, double y, double z,
complex_double* restrict val, complex_double* restrict grad);
inline void
eval_multi_UBspline_3d_z_vgl (multi_UBspline_3d_z * restrict spline, double x, double y, double z,
complex_double* restrict val, complex_double* restrict grad, complex_double* restrict lapl);
inline void
eval_multi_UBspline_3d_z_vgh (multi_UBspline_3d_z * restrict spline, double x, double y,
complex_double* restrict val, complex_double* restrict grad, complex_double* restrict hess);