TensorSpline

Tensor-product spline over multiple dimensions.


Declaration

classdef TensorSpline < CAAnnotatedClass

Overview

TensorSpline is the multidimensional extension of BSpline. It stores one spline degree and one knot vector per dimension, together with a tensor-product coefficient array.

The represented spline is

\[f(x_1,\ldots,x_d) = x_{\mathrm{Mean}} + x_{\mathrm{Std}} \sum_{j_1=1}^{M_1} \cdots \sum_{j_d=1}^{M_d} \xi_{j_1,\ldots,j_d} \prod_{k=1}^{d} B_{j_k,S_k}(x_k;\tau_k),\]

where each \(\tau_k\) is the knot vector for one coordinate direction. Evaluation is pointwise on matching-size query arrays: paired column vectors evaluate paired sample locations, while matching ndgrid arrays evaluate a tensor-product lattice.

Basic usage

Use TensorSpline.fromKnotPoints(...) when you already have knot vectors and tensor-product coefficients and want to evaluate the resulting spline on matching-size query arrays. The low-level TensorSpline(...) constructor is the cheap solved-state constructor used directly by persistence and other internal bootstrap paths.

knotPoints = {[0;0;0;0;1;1;1;1], [0;0;0;0;1;1;1;1]};
xi = randn(16,1);
spline = TensorSpline.fromKnotPoints(knotPoints, xi, S=[3 3]);

[Xq,Yq] = ndgrid(linspace(0,1,40), linspace(0,1,40));
F = spline(Xq, Yq);

Topics

  • Create a spline
    • TensorSpline Create a tensor-product spline from canonical solved state.
    • fromKnotPoints Create a tensor-product spline from numeric knot vectors and coefficients.
  • Inspect spline properties
    • K Spline order in each tensor dimension.
    • S Polynomial degree in each tensor dimension.
    • basisSize Number of basis functions in each dimension.
    • domain Minimum and maximum values of the spline domain in each dimension.
    • knotAxes Knot-axis objects defining the spline basis.
    • knotPoints Knot vectors defining the spline basis.
    • numDimensions Number of tensor dimensions.
    • xMean Mean added back to zero-order evaluations.
    • xStd Multiplicative scale applied to evaluations.
    • xi Tensor-product spline coefficients reshaped to basisSize.
  • Evaluate the spline
    • feval Evaluate a tensor spline at matching-size query arrays.
    • subsref Evaluate the tensor spline with function-call syntax or defer to built-in indexing.
    • valueAtPoints Evaluate the tensor spline or a mixed partial derivative.
  • Transform the spline
    • cumsum Return the indefinite integral along one tensor dimension.
    • diff Return a tensor spline representing mixed partial derivatives.
    • mtimes Multiply tensor-spline outputs by a scalar.
    • plus Add a scalar offset to tensor-spline outputs.
    • power Raise tensor-spline values to a positive scalar power by refitting support values.
    • roots Return real roots of a one-dimensional tensor spline within its domain.
    • sqrt Return a tensor spline approximation to the square root of the spline output.
  • Build spline bases