comparison 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
comparison
equal deleted inserted replaced
273:babc4288e6a6 274:11010bb74260
28 28
29 Base.convert(::Type{T}, i::Index{R,T} where R) where T = i.i 29 Base.convert(::Type{T}, i::Index{R,T} where R) where T = i.i
30 Base.convert(::Type{CartesianIndex}, I::NTuple{N,Index} where N) = CartesianIndex(convert.(Int, I)) 30 Base.convert(::Type{CartesianIndex}, I::NTuple{N,Index} where N) = CartesianIndex(convert.(Int, I))
31 31
32 Base.Int(I::Index) = I.i 32 Base.Int(I::Index) = I.i
33 Base.to_index(I::Index) = Int(I) #How to get this to work for all cases??
33 34
34 function Index(i::Integer, boundary_width::Integer, dim_size::Integer) 35 function Index(i::Integer, boundary_width::Integer, dim_size::Integer)
35 return Index{getregion(i,boundary_width,dim_size)}(i) 36 return Index{getregion(i,boundary_width,dim_size)}(i)
36 end 37 end
37 38