diff src/LazyTensors/lazy_tensor_operations.jl @ 1089:2278730f9cee refactor/sbpoperators/inflation

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 10 May 2022 20:24:20 +0200
parents 62f321caa964 2e606d4c0ab1
children 6f51160c7ca7 f1c2a4fa0ee1
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl	Tue May 10 20:21:15 2022 +0200
+++ b/src/LazyTensors/lazy_tensor_operations.jl	Tue May 10 20:24:20 2022 +0200
@@ -98,7 +98,6 @@
     apply_transpose(c.t2, c.t1'*v, I...)
 end
 
-
 """
     TensorComposition(tm, tmi::IdentityTensor)
     TensorComposition(tmi::IdentityTensor, tm)
@@ -120,6 +119,8 @@
     return tmi
 end
 
+Base.:*(a::T, tm::LazyTensor{T}) where T = TensorComposition(ScalingTensor{T,range_dim(tm)}(a,range_size(tm)), tm)
+Base.:*(tm::LazyTensor{T}, a::T) where T = a*tm
 
 """
     InflatedTensor{T,R,D} <: LazyTensor{T,R,D}