# 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 and`Derivative`

.`grammatrix(::MyBasis)`

to support`Q'Q`

.`ContinuumArrays._sum(::MyBasis, dims)`

and`ContinuumArrays._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`

— Function`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))`

`ContinuumArrays.expand`

— Function`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))`

`expand(v)`

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

`ContinuumArrays.grid`

— Function`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,:))
```

## Interal Routines

`ContinuumArrays.TransformFactorization`

— Type`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]`

.

`ContinuumArrays.AbstractConcatBasis`

— Type`AbstractConcatBasis`

is an abstract type representing a block diagonal basis but with modified axes.

`ContinuumArrays.MulPlan`

— Type`MulPlan(matrix, dims)`

Takes a matrix and supports it applied to different dimensions.

`ContinuumArrays.PiecewiseBasis`

— Type`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.

`ContinuumArrays.MappedFactorization`

— Type`MappedFactorization(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`

— Function`basis(v)`

gives a basis for expanding given quasi-vector.

`ContinuumArrays.InvPlan`

— Type`InvPlan(factorization, dims)`

Takes a factorization and supports it applied to different dimensions.

`ContinuumArrays.VcatBasis`

— Type`VcatBasis`

is an analogue of `Basis`

that vcats the values.

`ContinuumArrays.WeightedFactorization`

— Type`WeightedFactorization(w, F)`

weights a factorization `F`

by `w`

.

`ContinuumArrays.HvcatBasis`

— Type`VcatBasis`

is an analogue of `Basis`

that hvcats the values, so they are matrix valued.

`ContinuumArrays.ProjectionFactorization`

— Type`ProjectionFactorization(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]`

```