Internals
NNLS
submodule
This submodule is derived from a fork of the NonNegLeastSquares.jl
package.
DECAES.NNLS.apply_householder!
DECAES.NNLS.compute_dual!
DECAES.NNLS.construct_householder!
DECAES.NNLS.nnls
DECAES.NNLS.orthogonal_rotmat
DECAES.NNLS.solve_triangular_system!
DECAES.NNLS.unsafe_nnls!
DECAES.NNLS.apply_householder!
— MethodCONSTRUCTION AND/OR APPLICATION OF A SINGLE HOUSEHOLDER TRANSFORMATION Q = I + U*(U**T)/B
The original version of this code was developed by Charles L. Lawson and Richard J. Hanson at Jet Propulsion Laboratory 1973 JUN 12, and published in the book "SOLVING LEAST SQUARES PROBLEMS", Prentice-HalL, 1974. Revised FEB 1995 to accompany reprinting of the book by SIAM.
DECAES.NNLS.compute_dual!
— MethodCOMPUTE COMPONENTS OF THE DUAL (NEGATIVE GRADIENT) VECTOR W().
DECAES.NNLS.construct_householder!
— MethodCONSTRUCTION AND/OR APPLICATION OF A SINGLE HOUSEHOLDER TRANSFORMATION Q = I + U*(U**T)/B
The original version of this code was developed by Charles L. Lawson and Richard J. Hanson at Jet Propulsion Laboratory 1973 JUN 12, and published in the book "SOLVING LEAST SQUARES PROBLEMS", Prentice-HalL, 1974. Revised FEB 1995 to accompany reprinting of the book by SIAM.
DECAES.NNLS.nnls
— Methodx = nnls(A, b; ...)
Solves non-negative least-squares problem by the active set method of Lawson & Hanson (1974).
Optional arguments:
- max_iter: maximum number of iterations (counts inner loop iterations)
References:
- Lawson, C.L. and R.J. Hanson, Solving Least-Squares Problems
- Prentice-Hall, Chapter 23, p. 161, 1974
DECAES.NNLS.orthogonal_rotmat
— MethodCOMPUTE ORTHOGONAL ROTATION MATRIX The original version of this code was developed by Charles L. Lawson and Richard J. Hanson at Jet Propulsion Laboratory 1973 JUN 12, and published in the book "SOLVING LEAST SQUARES PROBLEMS", Prentice-HalL, 1974. Revised FEB 1995 to accompany reprinting of the book by SIAM.
COMPUTE MATRIX (C, S) SO THAT (C, S)(A) = (SQRT(A**2+B**2))
(-S,C) (-S,C)(B) ( 0 )
COMPUTE SIG = SQRT(A**2+B**2)
SIG IS COMPUTED LAST TO ALLOW FOR THE POSSIBILITY THAT
SIG MAY BE IN THE SAME LOCATION AS A OR B .
DECAES.NNLS.solve_triangular_system!
— MethodThe original version of this code was developed by Charles L. Lawson and Richard J. Hanson at Jet Propulsion Laboratory 1973 JUN 15, and published in the book "SOLVING LEAST SQUARES PROBLEMS", Prentice-HalL, 1974. Revised FEB 1995 to accompany reprinting of the book by SIAM.
DECAES.NNLS.unsafe_nnls!
— MethodAlgorithm NNLS: NONNEGATIVE LEAST SQUARES
The original version of this code was developed by Charles L. Lawson and Richard J. Hanson at Jet Propulsion Laboratory 1973 JUN 15, and published in the book "SOLVING LEAST SQUARES PROBLEMS", Prentice-HalL, 1974. Revised FEB 1995 to accompany reprinting of the book by SIAM.
GIVEN AN M BY N MATRIX, A, AND AN M-VECTOR, B, COMPUTE AN N-VECTOR, X, THAT SOLVES THE LEAST SQUARES PROBLEM A * X = B SUBJECT TO X .GE. 0
NormalHermiteSplines
submodule
This submodule is derived from a fork of the NormalHermiteSplines.jl
package.
DECAES.NormalHermiteSplines.NormalSpline
DECAES.NormalHermiteSplines.RK_H0
DECAES.NormalHermiteSplines.RK_H1
DECAES.NormalHermiteSplines.RK_H2
DECAES.NormalHermiteSplines._estimate_cond
DECAES.NormalHermiteSplines.construct
DECAES.NormalHermiteSplines.construct
DECAES.NormalHermiteSplines.estimate_accuracy
DECAES.NormalHermiteSplines.estimate_cond
DECAES.NormalHermiteSplines.estimate_epsilon
DECAES.NormalHermiteSplines.estimate_epsilon
DECAES.NormalHermiteSplines.estimate_epsilon
DECAES.NormalHermiteSplines.estimate_epsilon
DECAES.NormalHermiteSplines.evaluate
DECAES.NormalHermiteSplines.evaluate
DECAES.NormalHermiteSplines.evaluate
DECAES.NormalHermiteSplines.evaluate_derivative
DECAES.NormalHermiteSplines.evaluate_gradient
DECAES.NormalHermiteSplines.evaluate_one
DECAES.NormalHermiteSplines.get_cond
DECAES.NormalHermiteSplines.get_cond
DECAES.NormalHermiteSplines.get_epsilon
DECAES.NormalHermiteSplines.interpolate
DECAES.NormalHermiteSplines.interpolate
DECAES.NormalHermiteSplines.interpolate
DECAES.NormalHermiteSplines.interpolate
DECAES.NormalHermiteSplines.prepare
DECAES.NormalHermiteSplines.prepare
DECAES.NormalHermiteSplines.prepare
DECAES.NormalHermiteSplines.prepare
DECAES.NormalHermiteSplines.NormalSpline
— Typestruct NormalSpline{n, T <: Real, RK <: ReproducingKernel_0} <: AbstractNormalSpline{n,T,RK}
Define a structure containing full information of a normal spline
Fields
_kernel
: a reproducing kernel spline was built with_nodes
: transformed function value nodes_values
: function values at interpolation nodes_d_nodes
: transformed function directional derivative nodes_d_dirs
: normalized derivative directions_d_values
: function directional derivative values_mu
: spline coefficients_rhs
: right-hand side of the problemgram * mu = rhs
_gram
: Gram matrix of the problemgram * mu = rhs
_chol
: Cholesky factorization of the Gram matrix_cond
: estimation of the Gram matrix condition number_min_bound
: minimal bounds of the original node locations area_max_bound
: maximal bounds of the original node locations area_scale
: factor of transforming the original node locations into unit hypercube
DECAES.NormalHermiteSplines.RK_H0
— Typestruct RK_H0{T} <: ReproducingKernel_0
Defines a type of reproducing kernel of Bessel Potential space $H^{n/2 + 1/2}_ε (R^n)$ ('Basic Matérn kernel'):
\[V(\eta , \xi, \varepsilon) = \exp (-\varepsilon |\xi - \eta|) \, .\]
Fields
ε::T
: 'scaling parameter' from the Bessel Potential space definition, it may be omitted in the struct constructor otherwise it must be greater than zero
DECAES.NormalHermiteSplines.RK_H1
— Typestruct RK_H1{T} <: ReproducingKernel_1
Defines a type of reproducing kernel of Bessel Potential space $H^{n/2 + 3/2}_ε (R^n)$ ('Linear Matérn kernel'):
\[V(\eta , \xi, \varepsilon) = \exp (-\varepsilon |\xi - \eta|) (1 + \varepsilon |\xi - \eta|) \, .\]
Fields
ε::T
: 'scaling parameter' from the Bessel Potential space definition, it may be omitted in the struct constructor otherwise it must be greater than zero
DECAES.NormalHermiteSplines.RK_H2
— Typestruct RK_H2{T} <: ReproducingKernel_2
Defines a type of reproducing kernel of Bessel Potential space $H^{n/2 + 5/2}_ε (R^n)$ ('Quadratic Matérn kernel'):
\[V(\eta , \xi, \varepsilon) = \exp (-\varepsilon |\xi - \eta|) (3 + 3\varepsilon |\xi - \eta| + \varepsilon ^2 |\xi - \eta| ^2 ) \, .\]
Fields
ε::T
: 'scaling parameter' from the Bessel Potential space definition, it may be omitted in the struct constructor otherwise it must be greater than zero
DECAES.NormalHermiteSplines._estimate_cond
— MethodGet estimation of the Gram matrix condition number Brás, C.P., Hager, W.W. & Júdice, J.J. An investigation of feasible descent algorithms for estimating the condition number of a matrix. TOP 20, 791–809 (2012). https://link.springer.com/article/10.1007/s11750-010-0161-9
DECAES.NormalHermiteSplines.construct
— Methodconstruct(spline::AbstractNormalSpline{n,T,RK}, values::AbstractVector{T}, d_values::AbstractVector{T}) where {n, T <: Real, RK <: ReproducingKernel_1}
Construct the spline by calculating its coefficients and completely initializing the NormalSpline
object.
Arguments
spline
: the partly initializedNormalSpline
object returned byprepare
function.values
: function values atnodes
nodes.d_values
: function directional derivative values atd_nodes
nodes.
Returns
- The completely initialized
NormalSpline
object that can be passed toevaluate
function to interpolate the data to required points.
DECAES.NormalHermiteSplines.construct
— Methodconstruct(spline::AbstractNormalSpline{n,T,RK}, values::AbstractVector{T}) where {n, T <: Real, RK <: ReproducingKernel_0}
Construct the spline by calculating its coefficients and completely initializing the NormalSpline
object.
Arguments
spline
: the partly initializedNormalSpline
object returned byprepare
function.values
: function values atnodes
nodes.
Returns
- The completely initialized
NormalSpline
object that can be passed toevaluate
function to interpolate the data to required points.
DECAES.NormalHermiteSplines.estimate_accuracy
— Methodestimate_accuracy(spline::AbstractNormalSpline{n,T,RK}) where {n, T <: Real, RK <: ReproducingKernel_0}
Assess accuracy of interpolation results by analyzing residuals.
Arguments
spline
: theNormalSpline
object returned byconstruct
orinterpolate
function.
Returns
- An estimation of the number of significant digits in the interpolation result.
DECAES.NormalHermiteSplines.estimate_cond
— Methodestimate_cond(spline::AbstractNormalSpline{n,T,RK}) where {n, T <: Real, RK <: ReproducingKernel_0}
Get an estimation of the Gram matrix condition number. It needs the spline
object is prepared and requires O(N^2) operations. (C. Brás, W. Hager, J. Júdice, An investigation of feasible descent algorithms for estimating the condition number of a matrix. TOP Vol.20, No.3, 2012.)
Arguments
spline
: theNormalSpline
object returned byprepare
,construct
orinterpolate
function.
Returns
- An estimation of the Gram matrix condition number.
DECAES.NormalHermiteSplines.estimate_epsilon
— Methodestimate_epsilon(nodes::AbstractMatrix{T}, kernel::RK = RK_H0()) where {T <: Real, RK <: ReproducingKernel_0}
Get the estimation of the 'scaling parameter' of Bessel Potential space the spline being built in. It coincides with the result returned by get_epsilon
function.
Arguments
nodes
: The function value nodes. This should be ann×n_1
matrix, wheren
is dimension of the sampled space andn₁
is the number of function value nodes. It means that each column in the matrix defines one node.kernel
: reproducing kernel of Bessel potential space the normal spline will be constructed in. It must be a struct object of the following type:RK_H0
if the spline is constructing as a continuous function,RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- Estimation of
ε
.
DECAES.NormalHermiteSplines.estimate_epsilon
— Methodestimate_epsilon(nodes::AbstractVector{T}, kernel::RK = RK_H0()) where {T <: Real, RK <: ReproducingKernel_0}
Get an the estimation of the 'scaling parameter' of Bessel Potential space the 1D spline is being built in. It coincides with the result returned by get_epsilon
function.
Arguments
nodes
: The function value nodes.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H0
if the spline is constructing as a continuous function,RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- Estimation of
ε
.
DECAES.NormalHermiteSplines.estimate_epsilon
— Methodestimate_epsilon(nodes::AbstractMatrix{T}, d_nodes::AbstractMatrix{T}, kernel::RK = RK_H1()) where {T <: Real, RK <: ReproducingKernel_1}
Get an the estimation of the 'scaling parameter' of Bessel Potential space the spline being built in. It coincides with the result returned by get_epsilon
function.
Arguments
nodes
: The function value nodes. This should be ann×n_1
matrix, wheren
is dimension of the sampled space andn₁
is the number of function value nodes. It means that each column in the matrix defines one node.d_nodes
: The function directional derivative nodes. This should be ann×n_2
matrix, wheren
is dimension of the sampled space andn₂
is the number of function directional derivative nodes.kernel
: reproducing kernel of Bessel potential space the normal spline will be constructed in. It must be a struct object of the following type:RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- Estimation of
ε
.
DECAES.NormalHermiteSplines.estimate_epsilon
— Methodestimate_epsilon(nodes::AbstractVector{T}, d_nodes::AbstractVector{T}, kernel::RK = RK_H1()) where {T <: Real, RK <: ReproducingKernel_1}
Get an the estimation of the 'scaling parameter' of Bessel Potential space the 1D spline is being built in. It coincides with the result returned by get_epsilon
function.
Arguments
nodes
: The function value nodes.d_nodes
: The function derivative nodes.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- Estimation of
ε
.
DECAES.NormalHermiteSplines.evaluate
— Methodevaluate(spline::AbstractNormalSpline{1,T,RK}, point::T) where {T <: Real, RK <: ReproducingKernel_0}
Evaluate the 1D spline value at the point
location.
Arguments
spline
: theNormalSpline
object returned byinterpolate
orconstruct
function.point
: location at which spline value is evaluating.
Returns
- Spline value at the
point
location.
DECAES.NormalHermiteSplines.evaluate
— Methodevaluate(spline::AbstractNormalSpline{n,T,RK}, points::AbstractMatrix{T}) where {n, T <: Real, RK <: ReproducingKernel_0}
Evaluate the spline values at the locations defined in points
.
Arguments
spline: the
NormalSplineobject returned by
interpolateor
construct` function.points
: locations at which spline values are evaluating. This should be ann×m
matrix, wheren
is dimension of the sampled space andm
is the number of locations where spline values are evaluating. It means that each column in the matrix defines one location.
Returns
Vector{T}
of the spline values at the locations defined inpoints
.
DECAES.NormalHermiteSplines.evaluate
— Methodevaluate(spline::AbstractNormalSpline{n,T,RK}, points::AbstractVector{T}) where {n, T <: Real, RK <: ReproducingKernel_0}
Evaluate the 1D spline values/value at the points
locations.
Arguments
spline
: theNormalSpline
object returned byinterpolate
orconstruct
function.points
: locations at which spline values are evaluating. This should be a vector of sizem
wherem
is the number of evaluating points.
Returns
- Spline value at the
point
location.
DECAES.NormalHermiteSplines.evaluate_derivative
— Methodevaluate_derivative(spline::AbstractNormalSpline{1,T,RK}, point::T) where {T <: Real, RK <: ReproducingKernel_0}
Evaluate the 1D spline derivative at the point
location.
Arguments
spline
: theNormalSpline
object returned byinterpolate
orconstruct
function.point
: location at which spline derivative is evaluating.
Note: Derivative of spline built with reproducing kernel RK_H0 does not exist at the spline nodes.
Returns
- The spline derivative value at the
point
location.
DECAES.NormalHermiteSplines.evaluate_gradient
— Methodevaluate_gradient(spline::AbstractNormalSpline{n,T,RK}, point::AbstractVector{T}) where {n, T <: Real, RK <: ReproducingKernel_0}
Evaluate gradient of the spline at the location defined in point
.
Arguments
spline
: theNormalSpline
object returned byinterpolate
orconstruct
function.point
: location at which gradient value is evaluating. This should be a vector of sizen
, wheren
is dimension of the sampled space.
Note: Gradient of spline built with reproducing kernel RK_H0 does not exist at the spline nodes.
Returns
Vector{T}
- gradient of the spline at the location defined inpoint
.
DECAES.NormalHermiteSplines.evaluate_one
— Methodevaluate_one(spline::AbstractNormalSpline{n,T,RK}, point::AbstractVector{T}) where {n, T <: Real, RK <: ReproducingKernel_0}
Evaluate the spline value at the point
location.
Arguments
spline
: theNormalSpline
object returned byinterpolate
orconstruct
function.point
: location at which spline value is evaluating. This should be a vector of sizen
, wheren
is dimension of the sampled space.
Returns
- The spline value at the location defined in
point
.
DECAES.NormalHermiteSplines.get_cond
— Methodget_cond(nodes::AbstractMatrix{T}, d_nodes::AbstractMatrix{T}, d_dirs::AbstractMatrix{T}, kernel::RK = RK_H1()) where {T <: Real, RK <: ReproducingKernel_1}
Get a value of the Gram matrix spectral condition number. It is obtained by means of the matrix SVD decomposition and requires $O(N^3)$ operations.
Arguments
nodes
: The function value nodes. This should be ann×n_1
matrix, wheren
is dimension of the sampled space andn₁
is the number of function value nodes. It means that each column in the matrix defines one node.d_nodes
: The function directional derivatives nodes. This should be ann×n_2
matrix, wheren
is dimension of the sampled space andn₂
is the number of function directional derivative nodes.d_dirs
: Directions of the function directional derivatives. This should be ann×n_2
matrix, wheren
is dimension of the sampled space andn₂
is the number of function directional derivative nodes. It means that each column in the matrix defines one direction of the function directional derivative.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- A value of the Gram matrix spectral condition number.
DECAES.NormalHermiteSplines.get_cond
— Methodget_cond(nodes::AbstractMatrix{T}, kernel::RK = RK_H0()) where {T <: Real, RK <: ReproducingKernel_0}
Get a value of the Gram matrix spectral condition number. It is obtained by means of the matrix SVD decomposition and requires $O(N^3)$ operations.
Arguments
nodes
: The function value nodes. This should be ann×n_1
matrix, wheren
is dimension of the sampled space andn₁
is the number of function value nodes. It means that each column in the matrix defines one node.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H0
if the spline is constructing as a continuous function,RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- A value of the Gram matrix spectral condition number.
DECAES.NormalHermiteSplines.get_epsilon
— Methodget_epsilon(spline::AbstractNormalSpline{n,T,RK}) where {n, T <: Real, RK <: ReproducingKernel_0}
Get the 'scaling parameter' of Bessel Potential space the spline was built in.
Arguments
spline
: theNormalSpline
object returned byprepare
,construct
orinterpolate
function.
Returns
- The 'scaling parameter'
ε
.
DECAES.NormalHermiteSplines.interpolate
— Methodinterpolate(nodes::AbstractVector{T}, values::AbstractVector{T}, d_nodes::AbstractVector{T}, d_values::AbstractVector{T}, kernel::RK = RK_H1()) where {T <: Real, RK <: ReproducingKernel_1}
Prepare and construct the 1D interpolating normal spline.
Arguments
nodes
: function value interpolation nodes. This should be ann₁
vector wheren₁
is the number of function value nodes.values
: function values atnodes
nodes.d_nodes
: The function derivatives nodes. This should be ann₂
vector wheren₂
is the number of function derivatives nodes.d_values
: function derivative values atd_nodes
nodes.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- The completely initialized
NormalSpline
object that can be passed toevaluate
function.
DECAES.NormalHermiteSplines.interpolate
— Methodinterpolate(nodes::AbstractMatrix{T}, values::AbstractVector{T}, d_nodes::AbstractMatrix{T}, d_dirs::AbstractMatrix{T}, d_values::AbstractVector{T}, kernel::RK = RK_H1()) where {T <: Real, RK <: ReproducingKernel_1}
Prepare and construct the spline.
Arguments
nodes
: The function value nodes. This should be ann×n_1
matrix, wheren
is dimension of the sampled space andn₁
is the number of function value nodes. It means that each column in the matrix defines one node.values
: function values atnodes
nodes.d_nodes
: The function directional derivative nodes. This should be ann×n_2
matrix, wheren
is dimension of the sampled space andn₂
is the number of function directional derivative nodes.d_dirs
: Directions of the function directional derivatives. This should be ann×n_2
matrix, wheren
is dimension of the sampled space andn₂
is the number of function directional derivative nodes. It means that each column in the matrix defines one direction of the function directional derivative.d_values
: function directional derivative values atd_nodes
nodes.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- The completely initialized
NormalSpline
object that can be passed toevaluate
function.
DECAES.NormalHermiteSplines.interpolate
— Methodinterpolate(nodes::AbstractMatrix{T}, values::AbstractVector{T}, kernel::RK = RK_H0()) where {T <: Real, RK <: ReproducingKernel_0}
Prepare and construct the spline.
Arguments
nodes
: The function value nodes. This should be ann×n_1
matrix, wheren
is dimension of the sampled space andn₁
is the number of function value nodes. It means that each column in the matrix defines one node.values
: function values atnodes
nodes.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H0
if the spline is constructing as a continuous function,RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- The completely initialized
NormalSpline
object that can be passed toevaluate
function.
DECAES.NormalHermiteSplines.interpolate
— Methodinterpolate(nodes::AbstractVector{T}, values::AbstractVector{T}, kernel::RK = RK_H0()) where {T <: Real, RK <: ReproducingKernel_0}
Prepare and construct the 1D spline.
Arguments
nodes
: function value interpolation nodes. This should be ann₁
vector wheren₁
is the number of function value nodes.values
: function values atn₁
interpolation nodes.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H0
if the spline is constructing as a continuous function,RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- The completely initialized
NormalSpline
object that can be passed toevaluate
function.
DECAES.NormalHermiteSplines.prepare
— Methodprepare(nodes::AbstractMatrix{T}, kernel::RK = RK_H0()) where {T <: Real, RK <: ReproducingKernel_0}
Prepare the spline by constructing and factoring a Gram matrix of the interpolation problem. Initialize the NormalSpline
object.
Arguments
nodes
: The function value nodes. This should be ann×n_1
matrix, wheren
is dimension of the sampled space andn₁
is the number of function value nodes. It means that each column in the matrix defines one node.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H0
if the spline is constructing as a continuous function,RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- The partly initialized
NormalSpline
object that must be passed toconstruct
function in order to complete the spline initialization.
DECAES.NormalHermiteSplines.prepare
— Methodprepare(nodes::AbstractVector{T}, kernel::RK = RK_H0()) where {T <: Real, RK <: ReproducingKernel_0}
Prepare the 1D spline by constructing and factoring a Gram matrix of the interpolation problem. Initialize the NormalSpline
object.
Arguments
nodes
: function value interpolation nodes. This should be ann₁
vector wheren₁
is the number of function value nodes.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H0
if the spline is constructing as a continuous function,RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- The partly initialized
NormalSpline
object that must be passed toconstruct
function in order to complete the spline initialization.
DECAES.NormalHermiteSplines.prepare
— Methodprepare(nodes::AbstractMatrix{T}, d_nodes::AbstractMatrix{T}, d_dirs::AbstractMatrix{T}, kernel::RK = RK_H1()) where {T <: Real, RK <: ReproducingKernel_1}
Prepare the spline by constructing and factoring a Gram matrix of the interpolation problem. Initialize the NormalSpline
object.
Arguments
nodes
: The function value nodes. This should be ann×n_1
matrix, wheren
is dimension of the sampled space andn₁
is the number of function value nodes. It means that each column in the matrix defines one node.d_nodes
: The function directional derivatives nodes. This should be ann×n_2
matrix, wheren
is dimension of the sampled space andn₂
is the number of function directional derivative nodes.d_dirs
: Directions of the function directional derivatives. This should be ann×n_2
matrix, wheren
is dimension of the sampled space andn₂
is the number of function directional derivative nodes. It means that each column in the matrix defines one direction of the function directional derivative.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- The partly initialized
NormalSpline
object that must be passed toconstruct
function in order to complete the spline initialization.
DECAES.NormalHermiteSplines.prepare
— Methodprepare(nodes::AbstractVector{T}, d_nodes::AbstractVector{T}, kernel::RK = RK_H1()) where {T <: Real, RK <: ReproducingKernel_1}
Prepare the 1D interpolating normal spline by constructing and factoring a Gram matrix of the problem. Initialize the NormalSpline
object.
Arguments
nodes
: function value interpolation nodes. This should be ann₁
vector wheren₁
is the number of function value nodes.d_nodes
: The function derivatives nodes. This should be ann₂
vector wheren₂
is the number of function derivatives nodes.kernel
: reproducing kernel of Bessel potential space the normal spline is constructed in. It must be a struct object of the following type:RK_H1
if the spline is constructing as a differentiable function,RK_H2
if the spline is constructing as a twice differentiable function.
Returns
- The partly initialized
NormalSpline
object that must be passed toconstruct
function in order to complete the spline initialization.
LinearAlgebra.cholesky!
— MethodLinearAlgebra.cholesky!(C::ElasticCholesky, v::AbstractVector{T}) where {T}
Update the Cholesky factorization C
as if the column v
(and by symmetry, the corresponding row vᵀ
) were inserted into the underlying matrix A
. Specifically, let L
be the lower-triangular cholesky factor of A
such that A = LLᵀ
, and let v = [d; γ]
such that the new matrix A⁺
is given by
A⁺ = [A d]
[dᵀ γ].
Then, the corresponding updated cholesky factor L⁺
of ⁺
is:
L⁺ = [L 0]
[eᵀ α]
where e = L⁻¹d
, α = √τ
, and τ = γ - e⋅e > 0
. If τ ≤ 0
, then A⁺
is not positive definite.
See: https://igorkohan.github.io/NormalHermiteSplines.jl/dev/Normal-Splines-Method/#Algorithms-for-updating-Cholesky-factorization