comparison src/LazyTensors/lazy_tensor_operations.jl @ 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 a0e40d16ba0e
children 73882867c121
comparison
equal deleted inserted replaced
462:c364e2908c6e 463:5d6cbb7bfc23
168 domain_size(tmi::IdentityMapping) = tmi.size 168 domain_size(tmi::IdentityMapping) = tmi.size
169 169
170 apply(tmi::IdentityMapping{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...] 170 apply(tmi::IdentityMapping{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...]
171 apply_transpose(tmi::IdentityMapping{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...] 171 apply_transpose(tmi::IdentityMapping{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...]
172 172
173
174 """
175 InflatedTensorMapping{T,R,D} <: TensorMapping{T,R,D}
176
177 An inflated `TensorMapping` with dimensions added before and afer its actual dimensions.
178 """
173 struct InflatedTensorMapping{T,R,D,D_before,R_middle,D_middle,D_after, TM<:TensorMapping{T,R_middle,D_middle}} <: TensorMapping{T,R,D} 179 struct InflatedTensorMapping{T,R,D,D_before,R_middle,D_middle,D_after, TM<:TensorMapping{T,R_middle,D_middle}} <: TensorMapping{T,R,D}
174 before::IdentityMapping{T,D_before} 180 before::IdentityMapping{T,D_before}
175 tm::TM 181 tm::TM
176 after::IdentityMapping{T,D_after} 182 after::IdentityMapping{T,D_after}
177 183
188 return new{T,R,D,D_before,R_middle,D_middle,D_after, typeof(tm)}(before, tm, after) 194 return new{T,R,D,D_before,R_middle,D_middle,D_after, typeof(tm)}(before, tm, after)
189 end 195 end
190 end 196 end
191 export InflatedTensorMapping 197 export InflatedTensorMapping
192 198
199 """
200 InflatedTensorMapping(before, tm, after)
201
202 The outer product of `before`, `tm` and `after`, where `before` and `after` are `IdentityMapping`s.
203 """
193 """ 204 """
194 InflatedTensorMapping(before,tm) 205 InflatedTensorMapping(before,tm)
195 206
196 Constructs the InflatedTensorMapping where InflatedTensorMapping.after is the empty IdentityMapping 207 Constructs the InflatedTensorMapping where InflatedTensorMapping.after is the empty IdentityMapping
197 """ 208 """