changeset 463:5d6cbb7bfc23 feature/inflated_tensormapping

Merge documentation of InflatedTensorMapping
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 22 Oct 2020 10:02:36 +0200
parents c364e2908c6e (diff) a0e40d16ba0e (current diff)
children 73882867c121
files src/LazyTensors/lazy_tensor_operations.jl
diffstat 1 files changed, 22 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl	Wed Oct 21 22:02:07 2020 +0200
+++ b/src/LazyTensors/lazy_tensor_operations.jl	Thu Oct 22 10:02:36 2020 +0200
@@ -197,12 +197,31 @@
 export InflatedTensorMapping
 
 """
-    InflatedTensorMapping(before, tm, after)
+InflatedTensorMapping(before, tm, after)
 
 The outer product of `before`, `tm` and `after`, where `before` and `after` are `IdentityMapping`s.
 """
-InflatedTensorMapping(::IdentityMapping, ::TensorMapping, ::IdentityMapping)
-# 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