Mercurial > repos > public > sbplib_julia
diff RegionIndices/src/RegionIndices.jl @ 277:21e5c1dd6794 boundary_conditions
Add getindex-function for region indices. Update LazyArray tests. NOTE: Not sure if this is the way to go.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Mon, 06 Jan 2020 12:08:00 +0100 |
parents | 11010bb74260 |
children |
line wrap: on
line diff
--- a/RegionIndices/src/RegionIndices.jl Mon Jan 06 11:46:21 2020 +0100 +++ b/RegionIndices/src/RegionIndices.jl Mon Jan 06 12:08:00 2020 +0100 @@ -31,6 +31,7 @@ Base.Int(I::Index) = I.i Base.to_index(I::Index) = Int(I) #How to get this to work for all cases?? +Base.getindex(A::AbstractArray{T,N}, I::NTuple{N,Index}) where {T,N} = A[I...] #Is this ok?? function Index(i::Integer, boundary_width::Integer, dim_size::Integer) return Index{getregion(i,boundary_width,dim_size)}(i)