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:

  1. axes(::MyBasis) = (Inclusion(mydomain), OneTo(mylength))
  2. grid(::MyBasis, ::Integer)
  3. getindex(::MyBasis, x, ::Integer)
  4. ==(::MyBasis, ::MyBasis)

Optional overloads are:

  1. plan_transform(::MyBasis, sizes::NTuple{N,Int}, region) to plan a transform, for a tensor

product of the specified sizes, similar to plan_fft.

  1. diff(::MyBasis, dims=1) to support differentiation and Derivative.
  2. grammatrix(::MyBasis) to support Q'Q.
  3. ContinuumArrays._sum(::MyBasis, dims) and ContinuumArrays._cumsum(::MyBasis, dims) to support definite and indefinite integeration.
  4. plotgrid(::MyBasis, n...): return n grid points suitable for plotting the basis. The default value for n is 10,000.

Differential Operators

ContinuumArrays.AbsLaplacianType

AbsLaplacian(axis)

represents the positive-definite/negative/absolute-value laplacian operator |Δ| ≡ -Δ on the specified axis.

source

Routines

ContinuumArrays.transformFunction
transform(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))
source
ContinuumArrays.expandFunction
expand(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))
source
expand(v)

finds a natural basis for a quasi-vector and expands in that basis.

source
ContinuumArrays.gridFunction
grid(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,:))
source
ContinuumArrays.plotgridFunction
plotgrid(P, n...)

returns a grid of points suitable for plotting. This may include endpoints or singular points not included in grid. n specifies the number of coefficients.

source

Interal Routines

ContinuumArrays.TransformFactorizationType
TransformFactorization(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].

source
ContinuumArrays.PiecewiseBasisType
PiecewiseBasis(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.

source
ContinuumArrays.MapType

A subtype of Map is used as a one-to-one map between two domains via view. The domain of the map m is axes(m,1) and the range is union(m).

Maps must also overload invmap to give the inverse of the map, which is equivalent to invmap(m)[x] == findfirst(isequal(x), m).

source

```