Developer API

The following interfaces are intended for packages that extend PolyChaos. They are versioned contracts, but ordinary applications should construct the concrete measure, basis, quadrature, and tensor types documented in the user guide.

PolyChaos.AbstractMeasure — Type
AbstractMeasure

Developer extension interface for a univariate measure used to define an orthogonal-polynomial family.

Required properties

Concrete subtypes must expose w::Function, dom::Tuple{<:Real,<:Real}, and symmetric::Bool. The weight w(t) must be nonnegative on dom; symmetric must be true only when the measure is symmetric about zero. Generic implementations of issymmetric, Quad, and OrthoPoly read these properties.

Developer API

Use Measure for an ordinary user-defined measure. Subtyping is for package developers that also provide an appropriate recurrence or discretization path.

source
PolyChaos.AbstractCanonicalMeasure — Type
AbstractCanonicalMeasure <: AbstractMeasure

Developer extension interface for a measure with a known canonical orthogonal-polynomial family.

Rules

Subtypes satisfy the AbstractMeasure contract and should be paired with an OrthoPoly(::YourMeasure, deg; Nrec, addQuadrature) method. This lets the generic OrthoPoly(measure, deg) entry point construct the canonical basis without numerical discretization.

source
PolyChaos.AbstractQuad — Type
AbstractQuad{T<:Real}

Developer extension interface for a quadrature rule with real node and weight element type T.

Required properties

Concrete subtypes must provide nodes::AbstractVector{T} and weights::AbstractVector{T} fields of equal length. nw(quad) and integrate(f, quad) use those fields directly. A rule with no nodes should use EmptyQuad instead of a custom empty subtype.

Developer API

This interface is versioned for PolyChaos extensions. It is not a general quadrature interface: external code should use nw or integrate rather than relying on concrete field layout.

source
PolyChaos.AbstractOrthoPoly — Type
AbstractOrthoPoly{M<:AbstractMeasure,Q<:AbstractQuad}

Developer extension interface for a univariate or multivariate orthogonal-polynomial basis.

Required properties

Univariate subtypes must provide deg::Int, recurrence coefficient vectors α and β, measure::M, and quad::Q. length(α) == length(β) >= deg + 1 is required. dim, deg, coeffs, nw, evaluate, and integrate use this contract.

Multivariate subtypes additionally provide uni, ind, and dim; see MultiOrthoPoly for the concrete layout.

Developer API

This is a versioned extension interface. User code should construct one of the documented concrete bases rather than subtype it directly.

source
PolyChaos.AbstractCanonicalOrthoPoly — Type
AbstractCanonicalOrthoPoly{V,M,Q} <: AbstractOrthoPoly{M,Q}

Developer extension interface for a basis associated with an AbstractCanonicalMeasure.

Rules

Subtypes follow the AbstractOrthoPoly field contract. V is the concrete vector type used for both recurrence coefficient vectors. Canonical bases should retain enough recurrence coefficients to satisfy Nrec >= deg + 1 and use EmptyQuad only when addQuadrature = false was requested.

source
PolyChaos.AbstractTensor — Type
AbstractTensor{T<:AbstractOrthoPoly}

Developer extension interface for sparse scalar-product tensors associated with an orthogonal-polynomial basis.

Required properties

Concrete subtypes must provide dim::Int, T::SparseVector, get::Function, and op::T. The get function accepts a basis-index tuple and returns the corresponding scalar product. Generic variance calculations read T directly.

Developer API

Use Tensor for normal construction. Subtyping is reserved for extensions that preserve the stated storage contract.

source
PolyChaos.InconsistencyError — Type
InconsistencyError(message)

Exception thrown when recurrence coefficients, quadrature data, or basis indices violate a PolyChaos consistency requirement.

Arguments

  • message: description of the inconsistent data.

Fields

  • var: descriptive failure message.
source

Generic Interface Guarantees

The generic methods are tested against independent subtypes rather than only PolyChaos's concrete types. An AbstractMeasure subtype supplies w, dom, and symmetric; an AbstractQuad subtype supplies paired nodes and weights; and a univariate AbstractOrthoPoly subtype supplies deg, α, β, measure, and quad. This supports issymmetric, nw, integrate, dim, deg, coeffs, evaluate, computeSP2, and Quad without a concrete PolyChaos basis type.

An AbstractTensor subtype supplies dim, sparse storage T, an index lookup function get, and its basis op, which supports generic PCE variance calculation.