Mercurial > repos > public > sbplib_julia
diff src/LazyTensors/lazy_tensor_operations.jl @ 1098:6f51160c7ca7 feature/dissipation_operators
Merge refactor/sbpoperators/inflation
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 10 May 2022 21:15:55 +0200 |
parents | 95464a1af340 2278730f9cee |
children | 6567e38b05ca 102ebdaf7c11 |
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl Tue May 10 21:14:38 2022 +0200 +++ b/src/LazyTensors/lazy_tensor_operations.jl Tue May 10 21:15:55 2022 +0200 @@ -269,13 +269,22 @@ LazyOuterProduct(tms::Vararg{LazyTensor}) = foldl(LazyOuterProduct, tms) -# REVIEW: Address TODO below + """ - inflate(tm, sz, dir) + inflate(tm::LazyTensor, sz, dir) + +Inflate `tm` such that it gets the size `sz` in all directions except `dir`. +Here `sz[dir]` is ignored and replaced with the range and domains size of +`tm`. -Inflate `tm` with identity tensors in all directions `d` for `d != dir`. +An example of when this operation is useful is when extending a one +dimensional difference operator `D` to a 2D grid of a ceratin size. In that +case we could have -# TODO: Describe when it is useful +```julia +Dx = inflate(D, (10,10), 1) +Dy = inflate(D, (10,10), 2) +``` """ function inflate(tm::LazyTensor, sz, dir) Is = IdentityTensor{eltype(tm)}.(sz)