diff src/LazyTensors/lazy_tensor_operations.jl @ 434:648a36ebac99 feature/lazy_identity

Change name from LazyIdentity to IdentityMapping
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 19 Oct 2020 09:51:56 +0200
parents 7327a3e41df0
children 00c317c9ccfb 27e0e256e5d9
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl	Mon Oct 19 09:50:16 2020 +0200
+++ b/src/LazyTensors/lazy_tensor_operations.jl	Mon Oct 19 09:51:56 2020 +0200
@@ -148,21 +148,21 @@
 
 
 """
-    LazyIdentity{T,D} <: TensorMapping{T,D,D}
+    IdentityMapping{T,D} <: TensorMapping{T,D,D}
 
 The lazy identity TensorMapping for a given size. Usefull for building up higher dimensional tensor mappings from lower
 dimensional ones through outer products. Also used in the Implementation for InflatedTensorMapping.
 """
-struct LazyIdentity{T,D} <: TensorMapping{T,D,D}
+struct IdentityMapping{T,D} <: TensorMapping{T,D,D}
     size::NTuple{D,Int}
 end
-export LazyIdentity
+export IdentityMapping
 
-LazyIdentity{T}(size::NTuple{D,Int}) where {T,D} = LazyIdentity{T,D}(size)
+IdentityMapping{T}(size::NTuple{D,Int}) where {T,D} = IdentityMapping{T,D}(size)
 
-range_size(tmi::LazyIdentity) = tmi.size
-domain_size(tmi::LazyIdentity) = tmi.size
+range_size(tmi::IdentityMapping) = tmi.size
+domain_size(tmi::IdentityMapping) = tmi.size
 
-apply(tmi::LazyIdentity{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...]
-apply_transpose(tmi::LazyIdentity{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...]
+apply(tmi::IdentityMapping{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...]
+apply_transpose(tmi::IdentityMapping{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...]