BasisFunctions.ProductIndices
β TypeKnown types of product indices.
BasisFunctions.π£
β ConstantGenerate a synthesis operator of a dictionary by indexing π£ with that dictionary.
BasisFunctions.AbstractBasisFunction
β TypeThe supertype of functions that can be associated with a dictionary or a family of basis functions.
BasisFunctions.AbstractIntegerIndex
β TypeAn AbstractIntegerIndex
represents an integer that is being used as an index in the BasisFunctions package.
The type implements basic functionality of integers such that one can do computations with the indices.
BasisFunctions.AbstractOperator
β TypeAn AbstractOperator
is the supertype of all objects that map between function spaces.
BasisFunctions.AbstractShiftedIndex
β TypeA ShiftedIndex{S}
is a linear index shifted by S
. Thus, its value starts at 1-S
and ranges up to n-S
. A typical case is S=1
.
BasisFunctions.AbstractSolverOperator
β TypeSupertype of all dictionary solver operators. A solver operator typically implements an efficient algorithm to apply the inverse of an operator. Examples include a solver based on QR or SVD factorizations.
A solver operator stores the operator it has inverted.
BasisFunctions.ArrayOperator
β TypeAn ArrayOperator
combines an AbstractArray
with a source and destination dictionary.
From the 'AbstractArray' we expect that mul!
, size
, copy
, diag
, isdiag
, inv
, getindex
, adjoint
, conj
are implemented where possible.
BasisFunctions.BasisFunction
β TypeA BasisFunction
is one element of a dictionary.
BasisFunctions.BlockDiagonalOperator
β TypeA BlockDiagonalOperator has a block matrix structure like a BlockOperator, but with only blocks on the diagonal.
BasisFunctions.BlockOperator
β TypeA BlockOperator has a block matrix structure, where each block is an operator, and it acts on multiple sets.
A BlockOperator is row-like if it only has one row of blocks. In that case, the destination of the operator is not necessarily a multidict.
A BlockOperator is column-like if it only has one column of blocks. In that case, the source set of the operator is not necessarily a multidict.
BasisFunctions.ChebyshevT
β TypeA basis of Chebyshev polynomials of the first kind on the interval [-1,1]
.
BasisFunctions.ChebyshevTPolynomial
β TypeA Chebyshev polynomial of the first kind.
BasisFunctions.ChebyshevU
β TypeA basis of Chebyshev polynomials of the second kind on the interval [-1,1]
.
BasisFunctions.ChebyshevUPolynomial
β TypeA Chebyshev polynomial of the second kind
BasisFunctions.CirculantOperator
β TypeA circulant operator.
BasisFunctions.ComplexifiedDict
β TypeA 'ComplexifiedDict' is a dictionary for which the coefficient type is the complex version of the original dictionary. It is obtained by calling promote
or ensure_coefficienttype
on a dictionary or dictionaries.
BasisFunctions.CompositeDict
β TypeCompositeDict
is the abstract supertype of a dictionary that consists of several subdictionaries. The CompositeDict
type defines common routines for indexing and iteration.
The representation of a CompositeDict
is a BlockVector
. The outer array of this BlockVector
adopts the structure of the components of the CompositeDict
: if the components are stored in a tuple, the outer array will be a tuple. If the components are stored in an array, the outer array will be an array as well.
CompositeDict's that store components in an array can have a large number of components. However, for good efficiency they should have the same type. Tuples are suitable to hold mixed-type components with good efficiency, however in this case there can't be too many.
The concrete subtypes differ in what evaluation means. Examples include:
- MultiDict, where evaluation is the sum of the evaluation of the subsets
- PiecewiseDict, where evaluation depends on the location of the evaluation point
BasisFunctions.CompositeOperator
β TypeA CompositeOperator
consists of a sequence of operators that are applied consecutively.
Whenever possible, scratch space is allocated to hold intermediate results.
BasisFunctions.ConcreteDerivedDict
β TypeFor testing purposes we define a concrete subset of DerivedDict. This set should pass all interface tests and be functionally equivalent to the underlying set.
BasisFunctions.CosineSeries
β TypeCosine series on the interval [0,1]
.
BasisFunctions.DefaultNativeIndex
β TypeIf a dictionary does not have a native index, we use the DefaultNativeIndex
type to distinguish between linear and native indices. However, the default native index simply wraps the integer linear index.
BasisFunctions.DelinearizationOperator
β TypeThe inverse of a LinearizationOperator.
BasisFunctions.DenseMatrixOperator
β TypeA dense matrix operator
BasisFunctions.DenseSubdict
β TypeA DenseSubdict
is a large subset of a dictionary. Operators associated with the subset are implemented in terms of corresponding operators on the underlying dictionary. This often leads to an explicit extension to the full set, but it can take advantage of possible fast implementations for the underlying dictionary. For large subsets this is more efficient than iterating over the individual elements.
BasisFunctions.DerivedDict
β TypeA DerivedDict
is a dictionary that inherits most of its behaviour from an underlying dictionary.
The abstract type for derived dictionaries implements the interface of a dictionary using composition and delegation. Concrete derived dictionaries may override functions to specialize behaviour. For example, a mapped dictionary may override the evaluation routine to apply the map first.
BasisFunctions.DesynthesisOperator
β TypeThe desynthesis operator does the inverse of the synthesis operator: it maps an expansion in a dictionary to an expansion in the corresponding discrete set.
BasisFunctions.DiagonalOperator
β TypeA diagonal operator.
BasisFunctions.Dictionary
β TypeA Dictionary{S,T}
is an ordered family of functions, in which each function maps a variable of type S
to a variable of type T
. The dictionary can be thought of as an array, where the elements are functions that map S
to T
.
A Dictionary{S,T}
has domain type S
and codomain type T
. The domain type corresponds to the type of a domain in the DomainSets.jl
package, and it is the type of the expected argument to the elements of the dictionary. The codomain type is the type of the output.
Each dictionary is ordered via its index set: the ordering is determined by the iterator of the index set. A dictionary d
can be indexed in several ways:
- the linear index is a positive natural number between
1
andlength(d)
- the native index is an index that more closely corresponds to the conventional mathematical notation of the dictionary, if that differs from linear indexing. For example, polynomials may have degree ranging from
0
tolength(d)-1
. Fourier series may have negative frequencies.
Some dictionaries define other types of indices, such as multilinear and product indices. See CompositeDictionary
and ProductDictionary
. There is always a bijection between the different types of index sets supported by a dictionary.
A dictionary is the basic building block of the package. They can support several operations, such as interpolation, evaluation, differentiation and others. This functionality is made available using a specific interface. See the documentation of the features for a description of that interface and the syntax.
BasisFunctions.DictionaryOperator
β TypeDictionaryOperator
represents any linear operator that maps coefficients of a source set to coefficients of a destination set. Typically, source and destination are of type Dictionary
. The action of the operator is defined by providing a method for apply!.
The dimension of an operator are like a matrix: (length(dest),length(src))
.
Source and destination should at least implement the following:
length
size
eltype
The element type should be equal for src and dest.
BasisFunctions.DictionarySolverOperator
β TypeSupertype of all dictionary solver operators. A solver operator typically implements an efficient algorithm to apply the inverse of an operator. Examples include a solver based on QR or SVD factorizations.
A solver operator stores the operator it has inverted.
BasisFunctions.DictionaryValueIterator
β TypeSupertype of iterators over the pointwise evaluation of a dictionary.
The value iterator depends on a point x
in the support of the dictionary, and iterates over all the function values of the elements of the dictionary in that point. Value iterators can be useful if the computation of all elements is required and computing them in one go is more efficient than computing them one by one independently.
For example, orthogonal polynomial iterators may implement the three-term recurrence relation. The command '[val for val in pointvalues(ops, x)]' may be more efficient than '[eval_element(dict, i, x) for i in eachindex(dict)]'
BasisFunctions.DiscreteArrayDictionary
β TypeA DiscreteArrayDictionary{N,T}
describes the linear space of arrays of finite size size(d)
with element type T
.
BasisFunctions.DiscreteDictionary
β TypeA DiscreteDictionary{I,T}
is a dictionary where I
is a discrete type, e.g., the integers. Expansions in this discrete set typically constitute a vector space.
The elements of the set are the Euclidean unit vectors, with a finite index set.
BasisFunctions.DiscreteMultiArrayDictionary
β TypeA DiscreteMultiArrayDictionary{A,T}
describes the linear space of multi-arrays with element type T
.
BasisFunctions.DiscreteOrthogonalDual
β TypeDiscrete orthogonal dual type: duality with respect to the discrete measure of the dictionary.
BasisFunctions.DiscreteVectorDictionary
β TypeA DiscreteVectorDictionary{T}
describes the linear space of vectors of finite length n
with element type T
.
BasisFunctions.DomainSupportDict
β TypeAdd a support and measure to a dictionary.
BasisFunctions.DualType
β TypeSupertype of trait types which define a kind of duality.
BasisFunctions.Expansion
β TypeAn Expansion
describes a function using its expansion coefficients in a certain dictionary.
An expansion acts both like an array, the array of coefficients, and like a function.
Parameters:
- D is the dictionary.
- C is the type of the expansion coefficients
BasisFunctions.FFTIndexList
β TypeFFTIndexList
defines the map from native indices to linear indices for a finite Fourier basis, when the indices are ordered in the way they are expected in the FFT routine.
BasisFunctions.FlatTensorProductDict
β TypeA flat tensor product dict has N
scalar components.
BasisFunctions.Fourier
β TypeA Fourier basis on the interval [0,1]
. The basis functions are given by exp(2 Ο i k)
, with k
ranging from -N
to N
for Fourier series of odd length (2N+1
) and from -N+1
to N
for even length. In the latter case, the highest frequency basis function corresponding to frequency N
is a cosine.
The basis functions are ordered the way they are expected by a typical FFT implementation. The frequencies k are in the following order:
0 1 2 3 ... N -N -N+1 ... -2 -1,
for odd length and
0 1 2 3 ... N -N+1 ... -2 -1,
for even length.
The Fourier basis is orthonormal with respect to a continuous measure (for odd length Fourier bases only) and a discrete measure.
BasisFunctions.FourierLike
β TypeSupertype of various Fourier-like basis functions.
BasisFunctions.FunOperator
β TypeWrap an operator and return an expansion rather than coefficients.
BasisFunctions.FunctionOperator
β TypeA FunctionOperator applies a given function to the set of coefficients and returns the result.
BasisFunctions.FunctionSpace
β TypeA FunctionSpace{S,T}
is the supertype of all function spaces. The space contains functions that map type S
to type T
. Thus, S
is the domaintype and T
is the codomain type.
BasisFunctions.GenericCompositeOperator
β TypeA GenericCompositeOperator
contains a list of operators that are applied consecutively to any input. It is a generic operator.
BasisFunctions.GenericDictValueIterator
β TypeIterate over the values of a dictionary at a point.
BasisFunctions.GenericFunctionSpace
β TypeGenericFunctionSpace
is a generic function space for functions about which we have no additional information apart from their domain and codomain types.
BasisFunctions.GenericGridWeight
β TypeA generic weighted discrete measure, associated with a set of points and weights.
BasisFunctions.GenericIdentityOperator
β TypeThe generic identity operator does nothing to the function it is applied to.
BasisFunctions.GenericMappedDict
β TypeConcrete mapped dictionary for any dictionary and any map.
BasisFunctions.GenericOPS
β TypeA generic orthogonal polynomial sequence is determined by its recurrence coefficients. The GenericOPS
type stores the coefficients A_n
, B_n
and C_n
from the recurrence relation in the following form:
p_{n+1}(x) = (A_n x + B_n) * p_n(x) - C_n * p_{n-1}(x).
p_{-1} = 0, p_0 = p0
BasisFunctions.GenericSolverOperator
β TypeA GenericSolverOperator wraps around a generic solver type.
BasisFunctions.GenericWeight
β TypeA measure on a general domain with a general weight function dΟ = w(x) dx
.
BasisFunctions.GramDual
β TypeDuality defined by the inverse of the Gram matrix with a given measure.
BasisFunctions.GridBasis
β TypeA GridBasis
is a discrete basis that is associated with a grid.
The domain of the grid basis is the index set of the grid.
BasisFunctions.GridSampling
β TypeA GridSampling
is an operator that maps a function to its samples in a grid.
BasisFunctions.GridWeight
β TypeDiscrete weights associated with a grid.
BasisFunctions.Hermite
β TypeA basis of the classicale Hermite polynomials. These polynomials are orthogonal on the real line (-β,β)
with respect to the weight function w(x)=exp(-x^2)
.
BasisFunctions.HorizontalBandedMatrix
β TypeA 2D array where every row contains equal elements.
The top row starts at index offset, the second row at step+offset.
BasisFunctions.HorizontalBandedOperator
β TypeA banded operator of which every row contains equal elements.
The top row starts at index offset, the second row at step+offset.
BasisFunctions.IdentityOperator
β TypeThe identity operator
BasisFunctions.IndexExtension
β TypeAn IndexExtension
embeds coefficients in a larger set based on their indices.
BasisFunctions.IndexList
β TypeThe type IndexList
implements a map from linear indices to another family of indices, and vice-versa.
It is implemented as an abstract vector. Hence, the functionality of vectors is available. This also means that the dimension of an index list is always a vector, whose length equals that of the dictionary it corresponds to. Still, in several cases one may index the list with other kinds of indices.
Concrete subtypes should implement:
getindex(l::MyIndexList, idx::Int)
-> this is the map from linear indices to native indiceslinear_index(l::MyIndexList, idxn::MyIndex)
-> this is the inverse mapsize(l::MyIndexList)
BasisFunctions.IndexMatrix
β TypeAn IndexMatrix selects/restricts a subset of coefficients based on their indices.
BasisFunctions.IndexRestriction
β TypeAn IndexRestriction selects a subset of coefficients based on their indices.
BasisFunctions.Jacobi
β TypeA basis of the classical Jacobi polynomials on the interval [-1,1]
. These polynomials are orthogonal with respect to the weight function
w(x) = (1-x)^Ξ± (1+x)^Ξ².
BasisFunctions.L2
β TypeThe space of Lebesgue integrable functions.
BasisFunctions.Laguerre
β TypeA basis of the classicale Laguerre polynomials. These polynomials are orthogonal on the positive halfline [0,β)
with respect to the weight function w(x)=exp(-x)
.
BasisFunctions.Legendre
β TypeA basis of Legendre polynomials on the interval [-1,1]
. These classical polynomials are orthogonal with respect to the weight function w(x) = 1
.
BasisFunctions.LinearizationOperator
β TypeAn operator that calls linearize on a native representation of a set, returning a Vector with the length of the set. For example, one can not apply a matrix to a non-arraylike representation, hence the representation has to be linearized first.
BasisFunctions.MappedChebyshev
β TypeMapped Chebyshev polynomials.
BasisFunctions.MappedDict
β TypeA MappedDict
has a dictionary and a map. The domain of the dictionary is mapped to a different one. Evaluating the MappedDict
in a point uses the inverse map to evaluate the underlying dictionary element in the corresponding point.
BasisFunctions.MappedFourier
β TypeSpecific type for affinely mapped Fourier functions.
BasisFunctions.MatrixOperator
β TypeA MatrixOperator
is a wrapper around an abstract matrix type.
BasisFunctions.MeasureSpace
β TypeA function space equipped with a measure.
The measure ΞΌ
induces a bilinear form (f,g) = int(f, g, dΞΌ)
and possibly a (semi)norm or inner product. This depends on the properties of the measure.
BasisFunctions.Monomial
β TypeA monomial basis function x^i
.
BasisFunctions.Monomials
β TypeA basis of the monomials x^i
.
BasisFunctions.MultiDict
β TypeA MultiDict
is the concatenation of several dictionaries. The components are contained in an indexable set, such as a tuple or an array. In case of an array, the number of dictionaries may be large.
The native representation of a MultiDict
is a BlockVector
, of which each element is the native representation of the corresponding element of the multidict.
Evaluation of an expansion at a point is defined by summing the evaluation of all functions in the set at that point.
BasisFunctions.MultilinearIndexIterator
β TypeA MultilinearIndexIterator
iterates over a sequence of linear indices. Each index is a tuple, where the first entry refers to the linear index, and the second entry is the linear index.
This resembles the Flatten
iterator in Base
, but the latter would yield only the second entry. For example, the composite indices of (1:5,1:3)
are:
(1,1), (1,2), (1,3), (1,4), (1,5), (2,1), (2,2), (2,3).
In contrast, the Flatten
iterator in Base would yield:
1, 2, 3, 4, 5, 1, 2, 3
BasisFunctions.MultilinearIndexList
β TypeMultiLinearIndexList
is a list of indices suitable for use as the ordering of a dictionary with composite structure.
BasisFunctions.MultiplicationOperator
β TypeA MultiplicationOperator is defined by a (matrix-like) object that multiplies coefficients. The multiplication is in-place if type parameter INPLACE is true, otherwise it is not in-place.
BasisFunctions.MyDictionary
β TypeMyDictionary
is a custom dictionary type that illustrates the minimal functionality required to implement a dictionary.
BasisFunctions.NativeIndex
β TypeA native index is distinguishable from a linear index by its type, but otherwise it simply wraps an integer and it acts like an integer.
BasisFunctions.NativeIndexList
β TypeThe native index list is an identity map from integers to themselves, wrapped in a NativeIndex{S}
for some symbol S
.
BasisFunctions.OPSValueIterator
β TypeIterate over the values of an orthogonal polynomial sequence using the recurrence relation.
BasisFunctions.OpDict
β TypeA concrete operated dict with a generic operator.
BasisFunctions.OperatedDict
β TypeAn OperatedDict
represents a set that is acted on by an operator, for example the differentiation operator. The OperatedDict
has the dimension of the source set of the operator, but each basis function is acted on by the operator.
In practice the operator D
acts on the coefficients. Thus, an expansion in an OperatedDict
with coefficients c
corresponds to an expansion in the underlying dictionary with coefficients Dc
. If D
represents differentiation, then the OperatedDict
effectively represents the dictionary of derivatives of the underlying dictionary elements.
BasisFunctions.OperatorSum
β TypeA linear combination of operators: val1 * op1 + val2 * op2.
BasisFunctions.OrthogonalDual
β TypeOrthogonal dual type: duality with respect to the continuous measure of the dictionary.
BasisFunctions.OrthogonalPolynomials
β TypeOrthogonalPolynomials
is the abstract supertype of all univariate orthogonal polynomials.
BasisFunctions.ParamDict
β TypeA ParamDict
is a dictionary combined with a map, which is the parameterization of some domain that is the image of the support of the dictionary.
If Ξ©
is a domain, parameterized by the function ΞΊ : P β Ξ©
, then the ParamDict
is a dictionary defined on P
, with each point t β P
identified with x = ΞΊ(t) β Ξ©
. The ParamDict
acts like any other dictionary on P
.
Note the difference with a MappedDict
, which is defined on Ξ©
. Operations on mapped dictionaries require an easily invertible map.
BasisFunctions.Partition
β TypeA partition divides a region into several subregions. The main algorithm of every partition is deciding in which subregion a given point x lies, implemented by the partition_index
function.
The intent of a partition is to be combined with a function set on each subregion, effectively creating a piecewise function.
The pieces of a partition have an index ranging from 1 to length(partition).
BasisFunctions.PartitionPiece
β TypeA PartitionPiece represents a piece of a partition - it essentially combines a partition and an index into that partition. It is constructed by indexing a partition.
BasisFunctions.PeriodicSincFunctions
β TypeA basis of shifted periodic sinc functions on [0,1]
.
The space of this basis is the same as that of Fourier series, except that expansions are real-valued by default.
BasisFunctions.PiecewiseConstants
β TypeA dictionary of piecewise constant functions on [0,1]
.
BasisFunctions.PiecewiseDict
β TypeA PiecewiseDict
has a dictionary for each piece in a partition. Its representation is a BlockVector
containing the expansions of all dictionaries combined.
BasisFunctions.PiecewiseInterval
β TypeA PiecewiseInterval is a subdivision of an interval into a number of subintervals. The subintervals are determined by a set of breakpoints $t_i$, $i=0,...,n$. The main interval is $[t_0,t_n]$. The subintervals always contain the right endpoint, i.e. the first subinterval is $[t_0,t_1]$, the second is the halfopen interval $(t_1,t_2]$ and so on until the n-th interval $(t_{n-1},t_n]$.
BasisFunctions.Polynomial
β TypeSupertype of polynomial basis functions.
BasisFunctions.PolynomialBasis
β TypePolynomialBasis is the abstract supertype of all univariate polynomials.
BasisFunctions.PolynomialDegree
β TypeThe native index of a polynomial basis is the degree, which starts from 0 rather than from 1.
BasisFunctions.ProductIndexList
β TypeProductIndexList
is a list of product indices, suitable for use as the ordering of a dictionary with tensor product structure.
BasisFunctions.ProductSpace
β TypeA product function space.
BasisFunctions.ProjectionMatrix
β TypeA rectangular matrix
BasisFunctions.ProjectionSampling
β TypeA ProjectionSampling
is an operator that maps a function to its inner products with a projection basis.
BasisFunctions.QuadratureMeasure
β TypeA discrete measure that represents a quadrature rule.
BasisFunctions.ScalarMappedDict
β TypeConcrete mapped dictionary for any dictionary with a scalar map.
BasisFunctions.ScaledDict
β TypeA scaled dictionary (by a diagonal operator).
BasisFunctions.ScaledEntry
β TypeA vector of the form [1,1,...,1,V1,1,...1]
.
BasisFunctions.ScalingOperator
β TypeScaling by a scalar value
BasisFunctions.SincIndex
β TypeIndices of translated sinc functions start at 0.
BasisFunctions.SineSeries
β TypeSine series on the interval [0,1]
.
BasisFunctions.Span
β TypeThe span of a dictionary is the set of all possible expansions in that dictionary, with coefficient eltype determined uniquely by the dictionary.
The span of a dictionary is a function space, mapping S
to T
. Here, S
is the domain type of the dictionary and T
is the codomain type.
BasisFunctions.SparseMatrixOperator
β TypeA sparse matrix operator
BasisFunctions.SparseSubdict
β TypeA SparseSubdict
is a subset of a dictionary with a small number of indices. The difference with a regular function subset is that operators on a small set are implemented by iterating explicitly over the indices, and not in terms of an operator on the full underlying set.
BasisFunctions.Subdictionary
β TypeA Subdictionary
is an abstract subset of a dictionary. It is characterized by the underlying larger dictionary, and a subcollection of its indices.
BasisFunctions.SynthesisOperator
β TypeThe synthesis operator maps a discrete set of coefficients to a function in the span of a dictionary.
BasisFunctions.SynthesisOperatorGenerator
β TypeObject that can be indexed with a dictionary to construct a synthesis operator.
BasisFunctions.TensorProductDict
β TypeSupertype of tensor product dictionaries.
BasisFunctions.TensorProductOperator
β TypeA TensorProductOperator represents the tensor product of other operators.
struct TensorProductOperator{T} <: DictionaryOperator{T}
BasisFunctions.TrigSeries
β TypeA trigonometric series consists of sines and cosines on the interval [0,1]
.
The span of TrigSeries(n)
is the same as that of Fourier(n)
. To that end, TrigSeries(n)
has ceil(n/2)
cosine and floor(n/2)
sine functions.
BasisFunctions.TupleProductDict
β Typestruct TupleProductDict{N,DT,S,T} <: Dictionary{S,T}
Parameters:
- DT is a tuple of types, representing the (possibly different) types of the dicts.
- N is the dimension of the product (equal to the length of the DT tuple)
- S is the domain type
- T is the codomain type.
BasisFunctions.TypedFunction
β TypeA typed function is a function that maps an argument of type S
to type T
.
BasisFunctions.TypedGridWeight
β TypeA typed grid weight knows the types of the grid and the points, which may be helpful in dispatch.
BasisFunctions.UniformGridWeight
β TypeA discrete measure with all weights equal to one.
BasisFunctions.VerticalBandedMatrix
β TypeA 2D array every column contains equal elements.
The top column starts at index offset, the second column at step+offset.
BasisFunctions.VerticalBandedOperator
β TypeA banded operator of which every column contains equal elements.
The top column starts at index offset, the second column at step+offset.
BasisFunctions.WeightedDict
β TypeA WeightedDict
represents some function f(x) times an existing dictionary.
BasisFunctions.ZeroOperator
β TypeThe zero operator maps everything to zero.
Base.diff
β MethodThe diffentiated dictionary
Base.isreal
β MethodAre the functions in the dictionary real-valued?
Base.zeros
β MethodReturn a set of zero coefficients in the native format of the set.
BasisFunctions.Adest
β MethodSuggest a suitable dest dictionary for a given matrix.
BasisFunctions.Asrc
β MethodSuggest a suitable src dictionary for a given matrix.
BasisFunctions.HalfRangeChebyshevIIkind
β MethodCreates the (normalized) half range Chebyshev polynomials of the second kind.
These orthonormal polynomials (p_k(t))
on [-1,1] are orthogonal with respect to the weight
w(t) = [(1-t)(t-m(T))]^{1/2}
with
m(T) = 1-2cosec^2(pi/(2T))
They appear in the context of Fourier extensions. There, an odd function f(x)
on [-1,1]
is approximated with a sine series in x
on [-T,T]
.
See also HalfRangeChebyshevIkind
BasisFunctions.HalfRangeChebyshevIkind
β MethodCreates the (normalized) half range Chebyshev polynomials of the first kind.
These orthonormal polynomials (p_k(t))
on [-1,1] are orthogonal with respect to the weight
w(t) = [(1-t)(t-m(T))]^{-1/2}
with
m(T) = 1-2cosec^2(pi/(2T))
They appear in the context of Fourier extensions. There, an even function f(x)
on [-1,1]
is approximated with a cosine series in x
on [-T,T]
. By the cosine mapping
y = m(x) = cos(pi/T x)
this problem is transformed. The Fourier Extension problem on f
is then equivalent with the approximation of f(m^{-1}(y))
with orthogonal polynomials (q_k(y))
on [cos(pi/T),1]
By another mapping the interval [cos(pi/T),1]
is mapped to [-1,1]
and the polynomials (q_k(y))
are mapped to the polynomials (p_k(t))
See Huybrechs 2010, On the Fourier Extension of nonperiodic functions Adcock, Huybrechs, Vaquero 2014, On the numerical stability of Fourier Extension
The indicator_function_nodes
refer to the boundary points of the domain of the function f(x)
is approximated on. It is assumed that indicator_function_nodes
has the form
[-1,b_1,a_2,b_2, ..., a_n, 1 ] with -1<b_1<a_2<b_2<...<a_n<1.
By default it is the vector [-1.,1.].
See also HalfRangeChebyshevIkind
BasisFunctions.adaptive_stieltjes
β MethodCalculates the first n
recurrence coefficients (Ξ±_k
) and (Ξ²_k
) of the monic orthogonal polynomials up to the tolerance tol
given a quadrature rule my_quadrature_rule
with a relative degree of exactness
d(M)/M = Ξ΄ + O(1/M) as M goes to infinity
with d(M) the degree of exactness. Thus Ξ΄ is 2 for Gaussian quadrature.
See equation page 101 from Gautschi's book, "Orthogonal Polynomials and Computation"
BasisFunctions.antidifferentiation
β FunctionThe antidifferentiation function returns an operator that can be used to find the antiderivative of a function in the dictionary, with the result an expansion in a second dictionary.
See also: differentiation
.
BasisFunctions.apply_multiple
β MethodApply an operator multiple times, to each column of the given argument.
BasisFunctions.approx_length
β MethodSuggest a suitable size, close to n
, to resize the given dictionary.
BasisFunctions.approximate_native_size
β MethodCompute the native size best corresponding to the given linear size.
BasisFunctions.approximation
β MethodThe approximation
function returns an operator that can be used to approximate a function in the function set. This operator maps a grid to a set of coefficients.
BasisFunctions.approximation
β MethodThe 2-argument approximation exists to allow you to transform any Dictionary coefficients to any other Dictionary coefficients, including Discrete Grid Spaces. If a transform exists, the transform is used.
BasisFunctions.can_allocate_output
β MethodCan an operator allocate storage for its expected output?
BasisFunctions.chebyshev_eval
β MethodEvaluate the Chebyshev polynomial of degree k
in the point x β [-1,1]
.
BasisFunctions.coefficienttype
β MethodThe type of the expansion coefficients in a dictionary.
BasisFunctions.compatible_coefficients
β MethodCheck whether a set of coefficients is compatible with the function set.
BasisFunctions.containertype
β MethodWhat is the type of the coefficient vector of the dictionary?
BasisFunctions.conversion
β Functionconversion(::Type{T}, src::Dictionary, dest::Dictionary; options...)
Construct an operator with element type T
that converts coefficients from the source dictionary to coefficients of the destination dictionary.
The conversion is often exact, but this can not always be achieved with certainty. For example, it is hard to know in advance whether converting to evaluations in a grid is invertible.
BasisFunctions.conversion_to_compatible_dicts
β MethodIf two dictionaries are compatible, then they have to be convertible to a common dictionary.
BasisFunctions.deduce_eltype
β MethodFind a suitable element type for a dictionary operator with the given construct arguments.
BasisFunctions.delinearize_coefficients
β MethodConvert a linear set of coefficients back to the native representation of the dictionary.
BasisFunctions.derivative_dict
β MethodA dictionary in the same span as the differentiated dictionary
BasisFunctions.differentiation
β FunctionThe differentation function returns an operator that can be used to differentiate a function in the dictionary, with the result as an expansion in a second dictionary.
The differentiation operator is efficient for some combinations of source and destination dictionary. If a dictionary supports at least one differentiation operator, than hasderivative(dict)
is true and derivative_dict(dict)
returns the destination dictionary.
The order of the differentation can be passed as an optional second argument.
Examples are:
differentiation(Ξ¦::Dictionary)
This will use the default destination dictionary, order 1 and dimension 1. Another example is:
differentiation(Ξ¦, 1)
or
differentiation(Ξ¦, (0,1))
BasisFunctions.differentiation_dict
β MethodA dictionary that evaluates in the same way as the diffentiated dictionary,
but constructed using the `derivative_dict` and a transformation matrix that maps the coefficients.
BasisFunctions.difforder
β MethodDetermine the order of differentiation from the arguments given by the user.
BasisFunctions.dimensions
β MethodThe length and size of a dictionary may not be enough to uniquely determine the size of the dictionary, if it has additional internal structure. The output of dimensions is such that resize(dict, dimensions(dict)) == dict
.
BasisFunctions.dirichlet_kernel
β MethodShifts of the Dirichlet kernel.
BasisFunctions.dirichlet_kernel
β MethodThe Dirichlet kernel is the periodic sinc function.
BasisFunctions.discrete_set
β MethodWhich discrete dictionary matches the coefficients of the given dictionary?
BasisFunctions.discretemeasure
β MethodConstruct a discrete measure with the given points (and optionally weights).
BasisFunctions.dual
β MethodReturn the dictionary dual to dict
in the sense defined by the dual type.
BasisFunctions.ensure_coefficienttype
β MethodEnsure that the dictionary (or dictionaries) have coefficient type T
or wider.
BasisFunctions.ensure_prectype
β MethodEnsure that the dictionary has precision type T
or a wider type.
BasisFunctions.eval_element
β MethodA member function of a dictionary is evaluated using the eval_element
routine. It takes as arguments the dictionary, the index of the member function and the point in which to evaluate.
This function performs bounds checking on the index and also checks whether the point x lies inside the support of the function. A BoundsError
is thrown for an index out of bounds. The value 0
is returned when x is outside the support.
After the check on the index, the function calls unsafe_eval_element1.
This function checks whether x
lies in the support, and then calls unsafe_eval_element
. The latter function should be implemented by a concrete dictionary. Any user who wants to avoid the bounds check or the support check can intercept eval_element
or unsafe_eval_element1
respectively.
BasisFunctions.eval_element_derivative
β MethodThis function is exactly like eval_element
, but it evaluates the derivative of the element instead.
BasisFunctions.eval_element_extension
β MethodEvaluate a member function with a boundscheck on the index, but without checking the support of the function.
BasisFunctions.eval_expansion
β MethodEvaluate an expansion given by the set of coefficients in the point x.
BasisFunctions.evaluation_matrix
β FunctionCompute the evaluation matrix of the given dict on the given set of points.
BasisFunctions.expansion
β Methodexpansion(dict::Dictionary, coefficients)
An expansion of a dictionary with given coefficients.
BasisFunctions.extensionsize
β MethodReturn a suitable length to extend to, for example one such that the corresponding grids are nested and function evaluations can be shared. The default is twice the length of the current set.
BasisFunctions.first_moment
β MethodReturn the first moment, i.e., the integral of the weight function.
BasisFunctions.gauss_rule
β MethodCompute the Gaussian quadrature rule using the roots of the orthogonal polynomial.
BasisFunctions.gauss_weights_from_points
β MethodCompute the weights of Gaussian quadrature rule from the given roots of the orthogonal polynomial and using the formula:
w_j = 1 / \sum_{k=0}^{n-1} p_k(x_j)^2
This formula only holds for the orthonormal polynomials.
BasisFunctions.hasantiderivative
β MethodDoes the dictionary implement an antiderivative?
BasisFunctions.hasconstant
β MethodDoes the span of the dictionary contain the constant function?
BasisFunctions.hasderivative
β MethodDoes the dictionary implement a differentiation operator? An optional second argument may specify an exact order of the derivative.
BasisFunctions.hasextension
β MethodDoes the dictionary support extension and restriction operators?
BasisFunctions.hasinterpolationgrid
β MethodDoes the dictionary have an associated interpolation grid?
BasisFunctions.hastransform
β MethodDoes the dictionary have a transform associated with some space?
BasisFunctions.hasx
β MethodDoes the span of the dictionary contain the function f(x)=x
on its support?
BasisFunctions.in_support
β MethodDoes the given point lie inside the support of the given function or dictionary?
BasisFunctions.index_set_tensorproduct
β MethodReturn a list of all tensor product indices (1:s+1)^n.
BasisFunctions.index_set_total_degree
β MethodReturn a list of all indices of total degree at most s, in n dimensions.
BasisFunctions.indexable_list
β MethodReturn true if the set is indexable and has elements whose type is a subtype of T.
BasisFunctions.isbasis
β MethodIs the dictionary a (truncation of a) basis?
BasisFunctions.isbiorthogonal
β MethodIs the dictionary biorthogonal (with respect to the given measure)?
BasisFunctions.iscompatiblegrid
β MethodIs the grid compatible with the dictionary for efficient use?
BasisFunctions.isefficient
β MethodTrue if the action of the operator has a better computational complexity than the corresponding matrix-vector product.
BasisFunctions.isidentity
β MethodIs the operator (knowingly) an identity operator?
BasisFunctions.isinplace
β MethodIs the action of the operator in-place?
BasisFunctions.isorthogonal
β MethodIs the dictionary orthogonal (with respect to the given measure)?
BasisFunctions.isorthonormal
β MethodIs the dictionary orthonormal (with respect to the given measure)?
BasisFunctions.linear_index
β MethodCompute the linear index corresponding to the given index.
BasisFunctions.linear_size
β MethodCompute the linear size corresponding to the given native size.
BasisFunctions.linearize_coefficients
β MethodConvert the set of coefficients in the native format of the dictionary to a linear list in a vector.
BasisFunctions.mapped_expansion
β MethodMap the expansion using the given map.
BasisFunctions.matrix_by_mul
β MethodObtain a dense matrix copy of A
using matrix-vector products.
BasisFunctions.measuresampling
β Methodmeasuresampling(grid::AbstractGrid, ::Array, measure::Weight)
Return an array with a weight function of a measure evaluated on a grid.
BasisFunctions.mixedgram
β MethodCompute the mixed Gram matrix corresponding to two dictionaries. The matrix has elements given by the inner products between the elements of the dictionaries, relative to the given measure.
BasisFunctions.modified_chebyshev!
β FunctionModified Chebyshev Algorithm
see chebyshev
Ο
, Οzero
, and Οmone
are vectors of size or larger then 2n
n
is the number of coefficients required and os
is the offset, i.e., the initial index that can be used in Ο
, Οzero
, and Οmone
.
BasisFunctions.modified_chebyshev
β MethodModified Chebyshev Algorithm
Implements the map of the modified moments
\mu_k = \int p_k(x) dΞ»(x), k=0,...,2N-1
where (p_k) are some monic orthogonal polynomials satisfying the recurrence relation
p_{k+1}(t) = a_k(t_k)p_k(t) - b_kp{k-1}(t)
p_0(t) = 1, p_{-1}(t) = 0
to the first recurrence coefficients (Ξ±k), (Ξ²k), with k=0,...,N-1, such that the monic polynomials (q_k) satisfying
q_{k+1}(t) = Ξ±_k(t_k)q_k(t) - Ξ²_kq{k-1}(t)
q_0(t) = 1, q_{-1}(t) = 0
are orthogonal with respect to the measure Ξ».
By default a, and b are zero vectors and therefore the moments are assumed to be
\mu_k = \int x^k dΞ»(x), k=0,...,2N-1
This procedure is however not stable.
See e.g. Gautschi's book, "Orthogonal Polynomials and Computation". Algorithm 2.1, p77
Note: The vectors used have indices starting at 1
(such that Ξ±_n
above is given by Ξ±[n+1]
). The last value is Ξ±_{n-1} = Ξ±[n]
.
BasisFunctions.moment
β MethodCompute the moment of the given basisfunction, i.e. the integral on its support.
BasisFunctions.monic_recurrence_coefficients
β MethodReturn the recurrence coefficients Ξ±_n
and Ξ²_n
for the monic orthogonal polynomials (i.e., with leading order coefficient 1
). The recurrence relation is
p_{n+1}(x) = (x-Ξ±_n)p_n(x) - Ξ²_n p_{n-1}(x).
The result is a vector with indices starting at 1
(such that Ξ±_n
above is given by Ξ±[n+1]
). The last value is Ξ±_{n-1} = Ξ±[n]
.
BasisFunctions.monic_recurrence_eval
β MethodEvaluate the three-term recurrence relation for monic orthogonal polynomials
p_{n+1}(x) = (x-Ξ±_n)p_n(x) - Ξ²_n p_{n-1}(x).
BasisFunctions.monic_to_orthonormal_recurrence_coefficients!
β MethodSee monic_to_orthonormal_recurrence_coefficients
BasisFunctions.monic_to_orthonormal_recurrence_coefficients
β MethodTransforms the N
recurrence coefficients (Ξ±k) and (Ξ²k) of monic orthogonal polynomials (p_k), which satisfy the three-term recurrence relation
p_{k+1}(t) = (t-Ξ±_k)p_k(t)-Ξ²_kp_{k-1}(t)
to the N-1
first recurrence coefficients (ak), (bk), and (ck) the associated monic polynomials (qk), such that
q_{k+1}(t) = (a_kt+b_k)q_k(t)-c_kq_{k-1}(t)
BasisFunctions.multilinear_index
β MethodCompute the multilinear index corresponding to the given index.
BasisFunctions.native_coefficients
β MethodPromote the given coefficients to the native representation of the dictionary.
BasisFunctions.native_index
β MethodCompute the native index corresponding to the given index.
BasisFunctions.offsets_linear_index
β MethodConvert the given index into a multilinear index based on offsets.
BasisFunctions.offsets_multilinear_index
β MethodConvert a linear index into a multilinear index using the offsets information
BasisFunctions.ordering
β MethodDictionaries are ordered lists. Their ordering is defined by the way their index sets are ordered.
The ordering
of a dictionary returns a list-like object that can be indexed with integers between 1
and length(dict)
. This operation returns the corresponding native index. This defines the ordering of the native index set of the dictionary.
BasisFunctions.partition_index
β MethodReturn the index of the region in which the given point x lies.
BasisFunctions.project
β FunctionProject the function onto the space spanned by the given dictionary.
BasisFunctions.promote_coefficienttype
β MethodPromote the coefficient type of the dictionaries to a common type.
BasisFunctions.promote_domaintype
β MethodPromote the domain type of the dictionaries to a common type.
BasisFunctions.recurrence_eval
β MethodEvaluate an orthogonal polynomial using the three term recurrence relation. The recurrence relation is assumed to have the form: ''' p{n+1}(x) = (An x + Bn) * pn(x) - Cn * p{n-1}(x) p{-1} = 0; p0 = p0 ''' with the coefficients implemented by the rec_An
, rec_Bn
and rec_Cn
functions and with the initial value implemented with the p0
function. This is the convention followed by the DLMF, see http://dlmf.nist.gov/18.9#i
.
BasisFunctions.recurrence_eval_derivative
β MethodEvaluate the derivative of an orthogonal polynomial, based on taking the derivative of the three-term recurrence relation (see recurrence_eval
).
BasisFunctions.recurrence_eval_orthonormal!
β MethodEvaluate all the orthonormal polynomials in the sequence in the given point x
, using the three-term recurrence relation.
The implementation is based on Gautschi, 2004, Theorem 1.29, p. 12.
BasisFunctions.restrictionsize
β MethodReturn a suitable length to restrict to, for example one such that the corresponding grids are nested and function evaluations can be shared. The default is half the length of the current set.
BasisFunctions.sample
β FunctionSample the function f on the given grid.
BasisFunctions.sampling_normalization
β MethodReturn a normalization for a sampling operator on a grid. The normalization ensures a norm equivalence between the continuous norm of the function space associated with the measure, and the discrete norm of the sampling vector.
In practice, this amounts to a diagonal scaling with the square roots of the weights of a quadrature rule on the grid that is exact on the span of the dictionary in the space.
BasisFunctions.shift
β MethodShift an expansion to the right by delta.
BasisFunctions.spd_matrix_sqrt
β MethodCompute the square root of a symmetric and positive definite matrix.
BasisFunctions.split_interval
β MethodMake a piecewise function set from a one-dimensional function set, by inserting the point x in the support of the original set. This yields a PiecewiseDict on the partition [left(set), x, right(set)].
The original set is duplicated and rescaled to the two subintervals.
BasisFunctions.stieltjes!
β MethodIn-place Stieltjes Algorithm
see stieltjes
p0
, p1
, p2
, and scratch
are vectors of size N
BasisFunctions.stieltjes
β MethodStieltjes Algorithm
Given nodes (tk) and weights (wk) of a quadrature rule, the Stieltjes Algorithm calculates the N first recurrence coefficients of the monic polynomials (p_k) satisfying
p_{k+1}(t) = (t-a_k)p_k(t)-b_kp_{k-1}(t)
p_0(t) = 1, p_{-1}(t) = 0
and orthogonal with respect to the inner product induced by the quadrature
\sum w_k p_m(t_k)q_n(t_k) = \delta_{m,n}
See e.g. Gautschi's book, "Orthogonal Polynomials and Computation" and its accompanying code https://www.cs.purdue.edu/archives/2002/wxg/codes/OPQ.html
Note: The vectors used have indices starting at 1
(such that a_n
above is given by a[n+1]
). The last value is a_{n-1} = a[n]
.
BasisFunctions.subeltype
β MethodReturn the type of the elements of x
.
BasisFunctions.tensorproduct
β MethodCreate a tensor product of the supplied arguments.
The function tensorproduct
applies some simplifications and does not necessarily return a Product type.
A tensorproduct(a)
with just a single element returns a
.
For integer n
, tensorproduct(a, n)
becomes tensorproduct(a, a, ..., a)
. A type-safe variant is tensorproduct(a, Val{N})
.
BasisFunctions.tocoefficientformat
β MethodTransform a
to a coefficient vector for the given dictionary.
BasisFunctions.uniformweights
β MethodGenerate uniform weights for the given grid.
BasisFunctions.unsafe_offsets
β MethodPass the internal offsets
vector of the composite dict. This is not safe because the vector is not copied, hence its components could be changed. That would affect the original composite dictionary. Use with care.
BasisFunctions.verify_size
β MethodVerify that size(A) == (length(dest),length(src)) ?
BasisFunctions.widen_prectype
β MethodWiden the type such that its precision type matches U
.
BasisFunctions.wrap_operator
β MethodThe function wrap_operator returns an operator with the given source and destination, and with the action of the given operator.
DomainIntegrals.support
β MethodReturn the support of the idx-th basis function. Default is support of the dictionary.
DomainSets.FunctionMaps.codomaintype
β MethodThe type of the elements of the codomain of the dictionary.
DomainSets.FunctionMaps.domaintype
β MethodThe type of the elements of the domain of the dictionary.
GridArrays.:β
β MethodMap a dictionary to a domain
GridArrays.rescale
β MethodRescale a function set to an interval [a,b].
LinearAlgebra.diag
β MethodReturn the diagonal element op[i,i] of the operator.
LinearAlgebra.diag
β MethodReturn the diagonal of the operator.
LinearAlgebra.isdiag
β MethodIs the operator diagonal?