ContinuumArrays.jl
A Julia package for working with bases as quasi-arrays
The Basis interface
To add your own bases, subtype Basis
and overload the following routines:
axes(::MyBasis) = (Inclusion(mydomain), OneTo(mylength))
grid(::MyBasis, ::Integer)
getindex(::MyBasis, x, ::Integer)
==(::MyBasis, ::MyBasis)
Optional overloads are:
plan_transform(::MyBasis, sizes::NTuple{N,Int}, region)
to plan a transform, for a tensor
product of the specified sizes, similar to plan_fft
.
diff(::MyBasis, dims=1)
to support differentiation andDerivative
.grammatrix(::MyBasis)
to supportQ'Q
.ContinuumArrays._sum(::MyBasis, dims)
andContinuumArrays._cumsum(::MyBasis, dims)
to support definite and indefinite integeration.
Routines
ContinuumArrays.Derivative
— TypeDerivative(axis)
represents the differentiation (or finite-differences) operator on the specified axis.
ContinuumArrays.transform
— Functiontransform(A, f)
finds the coefficients of a function f
expanded in a basis defined as the columns of a quasi matrix A
. It is equivalent to
A \ f.(axes(A,1))
ContinuumArrays.expand
— Functionexpand(A, f)
expands a function f
im a basis defined as the columns of a quasi matrix A
. It is equivalent to
A / A \ f.(axes(A,1))
expand(v)
finds a natural basis for a quasi-vector and expands in that basis.
ContinuumArrays.grid
— Functiongrid(P, n...)
Creates a grid of points. if n
is unspecified it will be sufficient number of points to determine size(P,2)
coefficients. If n
is an integer or Block
its enough points to determine n
coefficients. If n
is a tuple then it returns a tuple of grids corresponding to a tensor-product. That is, a 5⨱6 2D transform would be
(x,y) = grid(P, (5,6))
plan_transform(P, (5,6)) * f.(x, y')
and a 5×6×7 3D transform would be
(x,y,z) = grid(P, (5,6,7))
plan_transform(P, (5,6,7)) * f.(x, y', reshape(z,1,1,:))
Interal Routines
ContinuumArrays.TransformFactorization
— TypeTransformFactorization(grid, plan)
associates a planned transform with a grid. That is, if F
is a TransformFactorization
, then F \ f
is equivalent to F.plan * f[F.grid]
.
ContinuumArrays.AbstractConcatBasis
— TypeAbstractConcatBasis
is an abstract type representing a block diagonal basis but with modified axes.
ContinuumArrays.MulPlan
— TypeMulPlan(matrix, dims)
Takes a matrix and supports it applied to different dimensions.
ContinuumArrays.PiecewiseBasis
— TypePiecewiseBasis(args...)
is an analogue of Basis
that takes the union of the first axis, and the second axis is a blocked concatenatation of args. If there is overlap, it uses the first in order.
ContinuumArrays.MappedFactorization
— TypeMappedFactorization(F, map)
remaps a factorization to a different domain. That is, if M
is a MappedFactorization
then M \ f
is equivalent to F \ f[map]
ContinuumArrays.basis
— Functionbasis(v)
gives a basis for expanding given quasi-vector.
ContinuumArrays.InvPlan
— TypeInvPlan(factorization, dims)
Takes a factorization and supports it applied to different dimensions.
ContinuumArrays.VcatBasis
— TypeVcatBasis
is an analogue of Basis
that vcats the values.
ContinuumArrays.WeightedFactorization
— TypeWeightedFactorization(w, F)
weights a factorization F
by w
.
ContinuumArrays.HvcatBasis
— TypeVcatBasis
is an analogue of Basis
that hvcats the values, so they are matrix valued.
ContinuumArrays.ProjectionFactorization
— TypeProjectionFactorization(F, inds)
projects a factorization to a subset of coefficients. That is, if P
is a ProjectionFactorization
then P \ f
is equivalent to (F \ f)[inds]
```