Vector types
This sections contains a list of the different supported vector types accompanied with the functions specific to those types.
Compact vectors
The abstract type for vectors with a finite number of non-zero elements is
InfiniteVectors.AbstractFiniteNZInfiniteVector — TypeAbstractFiniteNZInfiniteVector{T} <: BiInfiniteVector{T}Instance of BiInfiniteVector that implements eachnonzeroindex(vec).
Also hascompactsupport(vec) == true
CompactInfiniteVector
There are two types that support compact vectors. The second one is fully typed.
InfiniteVectors.CompactInfiniteVector — Typemutable struct CompactInfiniteVector{T} <: AbstractFiniteNZInfiniteVector{T}A CompactInfiniteVector contains a sequence of nonzero elements starting at a given offset.
CompactInfiniteVector(a::AbstractVector{T}, offset = 0)Construct a CompactInfiniteVector with indices starting at offset.
Examples
julia> CompactInfiniteVector(1:3,-1)
CompactInfiniteVector{Int64} with indices ℤ:
[ …, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, … ]InfiniteVectors.FixedInfiniteVector — Typestruct FixedInfiniteVector{L,OFS,T} <: AbstractFiniteNZInfiniteVector{T}A FixedInfiniteVector is a fully typed sequence of nonzero elements starting at a given offset.
FixedInfiniteVector(a::AbstractVector{T}, offset = 0)Construct a FixedInfiniteVector with indices starting at offset.
Examples
julia> FixedInfiniteVector(1:3,-1)
FixedInfiniteVector{3,-1,Int64} with indices ℤ:
[ …, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, … ]For the dirac delta a special constructor is present.
InfiniteVectors.δ — Functionδ(n::Int)Construct Dirac delts, i.e., a bi-infinite vector with δ(k)=1, if k=n, and δ(k)=0, otherwise.
Functions specific to compact vectors
InfiniteVectors.eachnonzeroindex — Functioneachnonzeroindex(vec)Indices of vec that contain non-zero elements. This function can be called if
hascompactsupport(vec) == trueInfiniteVectors.subvector — Functionsubvector(vec::CompactInfiniteVector) = vec.subvecThe vector of values at eachnonzeroindex
subvector(vec::AbstractPeriodicInfiniteVector)The vector that goes from 0 to P-1, where P is the period of vec"
InfiniteVectors.support — Functionsupport(vec::CompactInfiniteVector)The minimum and maximum index of the non-zero elements
Periodic vectors
InfiniteVectors.AbstractPeriodicInfiniteVector — Typeabstract type AbstractPeriodicInfiniteVector{T} <: BiInfiniteVector{T} endA doubly infinite vector that has a period.
InfiniteVectors.PeriodicInfiniteVector — Typemutable struct PeriodicInfiniteVector{T} <: AbstractPeriodicInfiniteVector{T}A doubly infinite vector that has a period.
PeriodicInfiniteVector(a::AbstractVector{T})
Construct a PeriodicInfiniteVector. The first element of a becomes the element at index zero, the second one at index 1.
Examples
julia> PeriodicInfiniteVector(1:3)
PeriodicInfiniteVector{Int64} with indices ℤ:
[ …, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, … ]Functions specific to periodic vectors
InfiniteVectors.period — Functionperiod(vec::AbstractPeriodicInfiniteVector)The period of the periodic vector.