Mercurial > repos > public > sbplib_julia
comparison LazyTensors/src/lazy_tensor_operations.jl @ 275:591609cdcd9b boundary_conditions
Dispatch TensorMappingTranspose on region indices. Update tests.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Mon, 06 Jan 2020 11:05:19 +0100 |
parents | 11010bb74260 |
children | 79d350003339 |
comparison
equal
deleted
inserted
replaced
274:11010bb74260 | 275:591609cdcd9b |
---|---|
42 | 42 |
43 # # TBD: Should this be implemented on a type by type basis or through a trait to provide earlier errors? | 43 # # TBD: Should this be implemented on a type by type basis or through a trait to provide earlier errors? |
44 Base.adjoint(tm::TensorMapping) = LazyTensorMappingTranspose(tm) | 44 Base.adjoint(tm::TensorMapping) = LazyTensorMappingTranspose(tm) |
45 Base.adjoint(tmt::LazyTensorMappingTranspose) = tmt.tm | 45 Base.adjoint(tmt::LazyTensorMappingTranspose) = tmt.tm |
46 | 46 |
47 apply(tmt::LazyTensorMappingTranspose{T,R,D}, v::AbstractArray{T,R}, I::NTuple{D,Int}) where {T,R,D} = apply_transpose(tmt.tm, v, I) | 47 apply(tmt::LazyTensorMappingTranspose{T,R,D}, v::AbstractArray{T,R}, I::NTuple{D,Index{<:Region}}) where {T,R,D} = apply_transpose(tmt.tm, v, I) |
48 apply_transpose(tmt::LazyTensorMappingTranspose{T,R,D}, v::AbstractArray{T,D}, I::NTuple{R,Int}) where {T,R,D} = apply(tmt.tm, v, I) | 48 apply_transpose(tmt::LazyTensorMappingTranspose{T,R,D}, v::AbstractArray{T,D}, I::NTuple{R,Index{<:Region}}) where {T,R,D} = apply(tmt.tm, v, I) |
49 | 49 |
50 range_size(tmt::LazyTensorMappingTranspose{T,R,D}, d_size::NTuple{R,Integer}) where {T,R,D} = domain_size(tmt.tm, d_size) | 50 range_size(tmt::LazyTensorMappingTranspose{T,R,D}, d_size::NTuple{R,Integer}) where {T,R,D} = domain_size(tmt.tm, d_size) |
51 domain_size(tmt::LazyTensorMappingTranspose{T,R,D}, r_size::NTuple{D,Integer}) where {T,R,D} = range_size(tmt.tm, r_size) | 51 domain_size(tmt::LazyTensorMappingTranspose{T,R,D}, r_size::NTuple{D,Integer}) where {T,R,D} = range_size(tmt.tm, r_size) |
52 | 52 |
53 | 53 |