Mercurial > repos > public > sbplib_julia
diff src/LazyTensors/lazy_tensor_operations.jl @ 462:c364e2908c6e feature/inflated_tensormapping
Implement InflatedTensorMapping where one of before and after are missing.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 21 Oct 2020 22:06:26 +0200 |
parents | 41f9cb6ee5a7 |
children | 5d6cbb7bfc23 |
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl Wed Oct 21 20:57:38 2020 +0200 +++ b/src/LazyTensors/lazy_tensor_operations.jl Wed Oct 21 22:06:26 2020 +0200 @@ -190,7 +190,27 @@ end export InflatedTensorMapping -# TODO: Implement constructors where one of `before` or `after` is missing +""" + InflatedTensorMapping(before,tm) + +Constructs the InflatedTensorMapping where InflatedTensorMapping.after is the empty IdentityMapping +""" +InflatedTensorMapping(before::IdentityMapping, tm::TensorMapping{T}) where T = InflatedTensorMapping(before,tm,IdentityMapping{T}()) + +""" + InflatedTensorMapping(tm,after) + +Constructs the InflatedTensorMapping where InflatedTensorMapping.before is the empty IdentityMapping +""" +InflatedTensorMapping(tm::TensorMapping{T}, after::IdentityMapping) where T = InflatedTensorMapping(IdentityMapping{T}(),tm,after) + +""" + InflatedTensorMapping(I1,I2) + +Specialized constructor for InflatedTensorMapping where `I1`,`I2` are IdentityMappings (required to resolve ambiguities). +Calls InflatedTensorMapping(before, tm) +""" +InflatedTensorMapping(I1::IdentityMapping{T}, I2::IdentityMapping{T}) where T = InflatedTensorMapping(I1,I2,IdentityMapping{T}()) # TODO: Implement syntax and constructors for products of different combinations of InflatedTensorMapping and IdentityMapping