Methods list

Methods usage

LazyGrids.AbstractGridType
AbstractGrid{T,d,D} <: AbstractArray{T,D}

Abstract type for representing the dth component of of a D-dimensional ndgrid(v₁, v₂, ...) where 1 ≤ d ≤ D and where eltype(v_d) = T.

source
LazyGrids.GridARType
GridAR{T,d,D,S} <: AbstractGrid{T,d,D}

The dth component of D-dimensional ndgrid(v₁, v₂, ...) where 1 ≤ d ≤ D and v_d is an AbstractRange.

source
LazyGrids.GridAVType
GridAV{T,d,D} <: AbstractGrid{T,d,D}

The dth component of D-dimensional ndgrid(v₁, v₂, ...) where 1 ≤ d ≤ D and v_d is an AbstractVector.

source
LazyGrids.GridOTType
GridOT{T,d,D} <: AbstractArray{T,D}

The dth component of D-dimensional ndgrid(1:M, 1:N, ...) where 1 ≤ d ≤ D.

source
LazyGrids.GridSLType
GridSL{T,d,D} <: AbstractGrid{T,d,D}

The dth component of D-dimensional ndgrid(v₁, v₂, ...) where 1 ≤ d ≤ D and v_d is a StepRangeLen.

source
LazyGrids.GridURType
GridUR{T,d,D} <: AbstractGrid{T,d,D}

The dth component of D-dimensional ndgrid(a:b, c:d, ...) where 1 ≤ d ≤ D.

source
LazyGrids.btimeMethod
btime(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.
source
LazyGrids.ndgridMethod
(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])
source
LazyGrids.ndgridMethod
(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
source
LazyGrids.ndgrid_arrayMethod
(xg, yg, ...) = ndgrid_array(v1, v2, ...)

Method to construct a tuple of (dense) Arrays 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])
source
LazyGrids.@timeoMacro
@timeo

A version of @time that shows the timing only, not the computed values. Returns a string so that Literate will capture the output.

source