TensorizedBasis
Each multi-index $\mu = [\mu_1,\mu_2,\ldots,\mu_M]$ encodes a tensorized basis function for the parameter space of the form $H_\mu = \prod_{k=1}^M H_k$ where the $H_k$ are the orthogonal polynomials. The TensorizedBasis collects all information necessary to evaluate those basis functions, i.e. the set of multi-indices and the triple products of the form $(y_mH_\mu, H_\lambda)$ for each $m$ and $\mu, \lambda$ in the set of multi-indices as a sparse matrix. There are analytic formulas to evaluate these triple products in terms of recurrence coefficients, but it makes sense to store them for faster evaluation times.
ExtendableASGFEM.TensorizedBasis
— TypeTensorizedBasis(
OBT::Type{<:OrthogonalPolynomialType},
M,
order,
maxorder;
...
) -> TensorizedBasis{Float64, ONBasis{T, OBT, npoly, nquad}} where {T<:Real, OBT<:OrthogonalPolynomialType, npoly, nquad}
TensorizedBasis(
OBT::Type{<:OrthogonalPolynomialType},
M,
order,
maxorder,
maxquadorder;
T,
multi_indices
) -> TensorizedBasis{Float64, ONBasis{T, OBT, npoly, nquad}} where {T<:Real, OBT<:OrthogonalPolynomialType, npoly, nquad}
constructor for a tensorized basis for the given OrthogonalPolynomialType. If no multi-indices are provided it automatically generates all multi-indices up to support length M and polynomial order maxorder.
ExtendableASGFEM.TensorizedBasis
— Typestruct TensorizedBasis{T<:Real, ONBType<:ONBasis, MIType}
Structure that stores information of a tensorized orthogonal for a certain set of multi-indices.
Base.show
— Methodshow(io::IO, TB::TensorizedBasis)
shows information on the tensorized basis.
ExtendableASGFEM.distribution
— Methoddistribution(TB::TensorizedBasis{T, ONBT}) -> Any
returns distribution associated to the orthogonal basis
ExtendableASGFEM.evaluate
— Methodevaluate(TB::TensorizedBasis{T}, j) -> Any
evaluates the basis function for the j-th multi-index at the sample that was set with set_sample.
ExtendableASGFEM.get_coupling_coefficient
— Methodget_coupling_coefficient(
TB::TensorizedBasis{T},
m,
j,
k
) -> Any
returns the triple products between $y_m$ and $H_j$ and $H_k$ for two multi-indices j
and k
.
ExtendableASGFEM.get_multiindex
— Methodget_multiindex(TB::TensorizedBasis, j) -> Any
returns the j-th multi-index.
ExtendableASGFEM.maxlength_multiindices
— Methodmaxlength_multiindices(TB::TensorizedBasis{T, ONBT}) -> Any
returns the maximal length of the stored multi-indices
ExtendableASGFEM.num_multiindices
— Methodnum_multiindices(TB::TensorizedBasis) -> Int64
returns the number of multi-indices
ExtendableASGFEM.sample_distribution
— Methodsample_distribution(
TB::TensorizedBasis,
nsamples;
M,
Mweights
) -> Tuple{Matrix{Float64}, Any}
Generate samples and weights for the distribution of the ON basis that the tensorized basis is based upon (that can be used for a Monte-Carlo estimator).
ExtendableASGFEM.set_sample!
— Methodset_sample!(
TB::TensorizedBasis,
x;
normalize
) -> Array{Vector{T}, 1} where T<:Real
evaluates all basis functions at sample vector x; call this before using evaluate!