Mercurial > repos > public > sbplib_julia
changeset 518:a5caa934b35f feature/boundary_ops
Add getindex specialized for TensorMappings with zero range dim. Remove some unused type parameters.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Tue, 24 Nov 2020 18:47:42 +0100 |
parents | 2edacece1637 |
children | 51e4bf6ab755 |
files | src/LazyTensors/lazy_tensor_operations.jl |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl Tue Nov 24 18:30:25 2020 +0100 +++ b/src/LazyTensors/lazy_tensor_operations.jl Tue Nov 24 18:47:42 2020 +0100 @@ -15,9 +15,9 @@ export LazyTensorMappingApplication # TODO: Go through and remove unneccerary type parameters on functions - -Base.getindex(ta::LazyTensorMappingApplication{T,R,D}, I::Vararg{Index,R}) where {T,R,D} = apply(ta.t, ta.o, I...) -Base.getindex(ta::LazyTensorMappingApplication{T,R,D}, I::Vararg{Int,R}) where {T,R,D} = apply(ta.t, ta.o, Index{Unknown}.(I)...) +Base.getindex(ta::LazyTensorMappingApplication{T,0}, I::Index) where T = apply(ta.t, ta.o, I) +Base.getindex(ta::LazyTensorMappingApplication{T,R}, I::Vararg{Index,R}) where {T,R} = apply(ta.t, ta.o, I...) +Base.getindex(ta::LazyTensorMappingApplication{T,R}, I::Vararg{Int,R}) where {T,R} = apply(ta.t, ta.o, Index{Unknown}.(I)...) Base.size(ta::LazyTensorMappingApplication) = range_size(ta.t) # TODO: What else is needed to implement the AbstractArray interface?