Mercurial > repos > public > sbplib_julia
comparison src/Grids/tensor_grid.jl @ 1849:1a8d80a62056 feature/jet_aqua
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 10 Jan 2025 23:02:36 +0100 |
parents | 054447ac4b0e |
children | 516eaabf1169 |
comparison
equal
deleted
inserted
replaced
1821:a57cd6fa4ecb | 1849:1a8d80a62056 |
---|---|
45 Base.IteratorSize(::Type{<:TensorGrid{<:Any, D}}) where D = Base.HasShape{D}() | 45 Base.IteratorSize(::Type{<:TensorGrid{<:Any, D}}) where D = Base.HasShape{D}() |
46 Base.length(g::TensorGrid) = prod(length, g.grids) | 46 Base.length(g::TensorGrid) = prod(length, g.grids) |
47 Base.size(g::TensorGrid) = LazyTensors.concatenate_tuples(size.(g.grids)...) | 47 Base.size(g::TensorGrid) = LazyTensors.concatenate_tuples(size.(g.grids)...) |
48 Base.size(g::TensorGrid, d) = size(g)[d] | 48 Base.size(g::TensorGrid, d) = size(g)[d] |
49 | 49 |
50 function spacing(g::TensorGrid) | |
51 relevant_grids = filter(g->!isa(g,ZeroDimGrid),g.grids) | |
52 return spacing.(relevant_grids) | |
53 end | |
50 | 54 |
51 function min_spacing(g::TensorGrid) | 55 function min_spacing(g::TensorGrid) |
52 relevant_grids = filter(g->!isa(g,ZeroDimGrid),g.grids) | 56 relevant_grids = filter(g->!isa(g,ZeroDimGrid),g.grids) |
53 d = min_spacing.(relevant_grids) | 57 d = min_spacing.(relevant_grids) |
54 return minimum(d) | 58 return minimum(d) |