Mercurial > repos > public > sbplib_julia
diff RegionIndices/src/RegionIndices.jl @ 274:11010bb74260 boundary_conditions
Dispatch getindex for TensorMappingApplication on region indices. Dispatch apply
for TensorMappingBinaryOperation on region indices. Update tests. Update todo
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Mon, 06 Jan 2020 10:54:48 +0100 |
parents | 6bce42abf43d |
children | 21e5c1dd6794 |
line wrap: on
line diff
--- a/RegionIndices/src/RegionIndices.jl Mon Jan 06 10:48:38 2020 +0100 +++ b/RegionIndices/src/RegionIndices.jl Mon Jan 06 10:54:48 2020 +0100 @@ -30,6 +30,7 @@ Base.convert(::Type{CartesianIndex}, I::NTuple{N,Index} where N) = CartesianIndex(convert.(Int, I)) Base.Int(I::Index) = I.i +Base.to_index(I::Index) = Int(I) #How to get this to work for all cases?? function Index(i::Integer, boundary_width::Integer, dim_size::Integer) return Index{getregion(i,boundary_width,dim_size)}(i)