Chebyshev Interpolation Methods

MultivariateChebyshev.chebyshev_transformFunction
chebyshev_transform(
    x::AbstractVecOrMat,
    a::Union{AbstractVector, Number} = -1.0,
    b::Union{AbstractVector, Number} = 1.0,
    )

Transform input x from standard domain [-1, 1] to general hyper-rectangular domain.

source
MultivariateChebyshev.chebyshev_inverse_transformFunction
chebyshev_inverse_transform(
    y::AbstractVecOrMat,
    a::Union{AbstractVector, Number} = -1.0,
    b::Union{AbstractVector, Number} = 1.0,
    )

Transform input y from general hyper-rectangular domain to standard domain [-1, 1].

source
MultivariateChebyshev.chebyshev_pointsFunction
chebyshev_points(degrees::AbstractVector{<:Integer})

Calculate the Chebyshev points of second kind used for interpolation.

degree is a list if integers. Each entry represents the maximum polynomial degree per dimension, length(degrees) corresponds to the number of dimensions

Note that Chebyshev points of second represent the extrema of Chebyshev polynomials of first kind.

source
MultivariateChebyshev.chebyshev_multi_pointsFunction

Calculate multivariate Chebyshev points on a standard domain [-1,1].

degree is a list if integers. Each entry represents the maximum polynomial degree per dimension, length(degrees) corresponds to the number of dimensions

Returns a matrix of size (N, D).

Number of rows N equals product over all (Nd + 1) where Nd is the maximum polynomial degree in dimension d (d=1...D) and D is the number of dimensions of the tensor, i.e. number of axes of Array.

source
MultivariateChebyshev.chebyshev_polynomialsFunction

Calculate the Chebyshev polynomials T0(x), ..., TN(x) for up to maximum degree N equal to max_degree.

Input x can be a float or a vector in the range [-1, 1] (element-wise).

Returns a float if input x is a float or a vector if input x is a vector.

source
MultivariateChebyshev.chebyshev_batch_callFunction
chebyshev_batch_call(
   C::AbstractArray,
   x::AbstractMatrix,
   )

Calculate

z = [...[C * T(xD)] * ...] * T(x1)

for a tensor C and input points x.

T(xd) are Chebyshev polynomials to degree Nd.

Input C is an n-dim Array with suitable size. size(C) .- 1 specifies the maximum polynomial degrees per dimension.

Input x is a matrix of size (N, D). First dimension N represents batch size and second dimension D represents number of dimensions of tensor.

Returns a vector of size (N,).

This is the basic operation for calibration and and interpolation.

Re-shaping is to ensure proper broadcast in multiplication.

source
chebyshev_batch_call(
   C::AbstractArray,
   x::AbstractMatrix,
   matmul::Function,
   )

Calculate

z = [...[C * T(xD)] * ...] * T(x1)

for a tensor C and input points x.

T(xd) are Chebyshev polynomials to degree Nd.

Input C is an n-dim Array with suitable size. size(C) .- 1 specifies the maximum polynomial degrees per dimension.

Input x is a matrix of size (N, D). First dimension N represents batch size and second dimension D represents number of dimensions of tensor.

Input matmul is a Python-like matmul function with multiplication along the last two dimension and broadcasting along the remaining first dimensions.

Returns a vector of size (N,).

source
MultivariateChebyshev.chebyshev_coefficientsFunction
chebyshev_coefficients(
    degrees::AbstractVector{<:Integer},
    multi_points::AbstractMatrix,
    values::AbstractVector,
    matmul::Union{Function, Nothing} = nothing,
    )

Calculate coefficients of Chebyshev basis functions.

degree is a list if integers. Each entry represents the maximum polynomial degree per dimension, length(degrees) corresponds to the number of dimensions.

multi_points is a matrix of multivariate Chebyshev points on a standard domain [-1,1].

values is a vector representing the target function values for each D-dimensional multivariate Chebyshev point on the transformed domain of the tagret function.

matmul may be a Python-like matmul function. Alternatively, batchmul is used for tensor multiplication.

Method returns an Array of size degrees .+ 1.

source
MultivariateChebyshev.chebyshev_interpolationFunction

Calcuate multivariate Chebyshev interpolation.

Input y is a matrix of size (N, D) where N is batch size and D is the number of dimensions. Input is assumed from general hyper-rectangular domain.

coeff is an n-dim array representing the calibrated Chebyshev tensor coefficients.

a and b are float or vector representing the lower and upper boundaries of the interpolation domain. If a or b is an array then we require length(a|b) and equal to size(y)[end].

matmul may be a Python-like matmul function. Alternatively, batchmul is used for tensor multiplication.

Method returns a vector of size (N,).

source