Methods list
LazyGrids.LazyGrids
LazyGrids.AbstractGrid
LazyGrids.GridAR
LazyGrids.GridAV
LazyGrids.GridOT
LazyGrids.GridSL
LazyGrids.GridUR
LazyGrids.btime
LazyGrids.ndgrid
LazyGrids.ndgrid
LazyGrids.ndgrid_array
LazyGrids.@timeo
Methods usage
LazyGrids.LazyGrids
— ModuleLazyGrids
Module for representing grids in a lazy way.
LazyGrids.AbstractGrid
— TypeAbstractGrid{T,d,D} <: AbstractArray{T,D}
Abstract type for representing the d
th component of of a D
-dimensional ndgrid(v₁, v₂, ...)
where 1 ≤ d ≤ D
and where eltype(v_d) = T
.
LazyGrids.GridAR
— TypeGridAR{T,d,D,S} <: AbstractGrid{T,d,D}
The d
th component of D
-dimensional ndgrid(v₁, v₂, ...)
where 1 ≤ d ≤ D
and v_d
is an AbstractRange
.
LazyGrids.GridAV
— TypeGridAV{T,d,D} <: AbstractGrid{T,d,D}
The d
th component of D
-dimensional ndgrid(v₁, v₂, ...)
where 1 ≤ d ≤ D
and v_d
is an AbstractVector
.
LazyGrids.GridOT
— TypeGridOT{T,d,D} <: AbstractArray{T,D}
The d
th component of D
-dimensional ndgrid(1:M, 1:N, ...)
where 1 ≤ d ≤ D
.
LazyGrids.GridSL
— TypeGridSL{T,d,D} <: AbstractGrid{T,d,D}
The d
th component of D
-dimensional ndgrid(v₁, v₂, ...)
where 1 ≤ d ≤ D
and v_d
is a StepRangeLen
.
LazyGrids.GridUR
— TypeGridUR{T,d,D} <: AbstractGrid{T,d,D}
The d
th component of D
-dimensional ndgrid(a:b, c:d, ...)
where 1 ≤ d ≤ D
.
LazyGrids.btime
— Methodbtime(t ; unit::Symbol, digits::Int)
Pretty-print the @benchmark output for non-interactive use with Literate. Returns a string so that Literate will capture the output.
unit
is:ms
by default, for reporting in ms. Or useμs
.digits
is 1 by default.
LazyGrids.ndgrid
— Method(xg, yg, ...) = ndgrid(M, N, ...)
Shorthand for ndgrid(1:M, 1:N, ...)
.
Example
julia> ndgrid(2,3)
([1 1 1; 2 2 2], [1 2 3; 1 2 3])
LazyGrids.ndgrid
— Method(xg, yg, ...) = ndgrid(v1, v2, ...)
Construct ndgrid
tuple for AbstractVector
inputs. Each output has a lazy grid type (subtype of AbstractGrid
) according to the corresponding input vector type.
Examples
julia> xg, yg = ndgrid(1:3, [:a, :b])
([1 1; 2 2; 3 3], [:a :b; :a :b; :a :b])
julia> xg
3×2 LazyGrids.GridUR{Int64, 1, 2}:
1 1
2 2
3 3
julia> yg
3×2 LazyGrids.GridAV{Symbol, 2, 2}:
:a :b
:a :b
:a :b
LazyGrids.ndgrid_array
— Method(xg, yg, ...) = ndgrid_array(v1, v2, ...)
Method to construct a tuple of (dense) Array
s from a set of vectors.
This tuple can use a lot of memory so should be avoided in general! It is provided mainly for testing and timing comparisons.
Each input should be an AbstractVector
of some type. The corresponding output Array will have the same element type.
This method provides similar functionality as Matlab's ndarray
function but is more general because the vectors can be any type.
Examples
julia> ndgrid_array(1:3, 1:2)
([1 1; 2 2; 3 3], [1 2; 1 2; 1 2])
julia> ndgrid(1:3, [:a,:b])
([1 1; 2 2; 3 3], [:a :b; :a :b; :a :b])
LazyGrids.@timeo
— Macro@timeo
A version of @time
that shows the timing only, not the computed values. Returns a string so that Literate will capture the output.