ScaledArrays
DiffinDiffsBase.ScaledArray
— TypeScaledArray{T,R,N,RA,P} <: AbstractArray{T,N}
Array type that stores data as indices of a range.
Fields
refs::RA<:AbstractArray{R,N}
: an array of indices.pool::P<:AbstractRange
: a range that covers all possible values stored by the array.invpool::Dict{T,R}
: a map from array elements to indices ofpool
.
DiffinDiffsBase.ScaledArray
— TypeScaledArray(x::AbstractArray, start, step[, stop]; reftype=Int32, usepool=true)
ScaledArray(x::AbstractArray, step; reftype=Int32, start, stop, usepool=true)
Construct a ScaledArray
from x
given the step
size. If start
or stop
is not specified, it will be chosen based on the extrema of x
.
Keywords
reftype::Type=Int32
: the element type of fieldrefs
.usepool::Bool=true
: find extrema ofx
based onDataAPI.refpool
.
DiffinDiffsBase.align
— Methodalign(xs::AbstractArray, sa::ScaledArrOrSub)
Convert xs
into a ScaledArray
with a pool
that has the same first element and step size as the pool
from sa
.
DiffinDiffsBase.scale
— Methodscale(sa::ScaledArrOrSub)
Return the step size of the pool
of sa
.