Methods
This section includes the methods implemented in BernsteinExpansions.jl
.
Implicit Form
Functions to compute the implicit Bernstein form of univariate and multivariate monomials.
BernsteinExpansions.univariate
— Functionunivariate(m::AbstractMonomialLike, l::Integer, dom::Interval)
Compute the Bernstein coefficients of a univariate monomial over an interval.
Input
m
– monomial in one variablel
– degree of the Bernstein polynomialdom
– interval domain of the Bernstein expansion
Output
An l+1
-dimensional vector that corresponds to the Bernstein expansion of order l
of the monomial m
.
Notes
For experimental purposes, different variations of the algorithm are available in the internal function _univariate!
. By dispatching on any of the following values, you can choose between:
fastmath
: Uses the@fastmath
. This is the fastest implementation.fastpow
: Usesfastpow
fromDiffEqBase.jl
. This is the second fastest implementation.base
: Uses^
from Julia. This is the slowest implementation, but it's accuracy is guaranteed to be within an<= 1 ulp
for all possible input values.
Algorithm
TODO: add description (ref Smith's PhD thesis).
BernsteinExpansions.multivariate
— Functionmultivariate(m::AbstractMonomialLike, l::AbstractVector{Int}, dom::IntervalBox{N}) where {N}
Compute the Bernstein coefficients of a multivariate monomial.
Input
m
– monomial in several variablesl
– vector of degrees of the Bernstein polynomial for each variabledom
– multi-dimensional interval domain of the Bernstein expansion
Output
A vector of vectors holding the Bernstein coefficients implicitly.
Algorithm
TODO: add description (ref Smith's PhD thesis). ```