Mercurial > repos > public > sbplib_julia
view ext/DiffinitiveSparseArrayKitExt.jl @ 1998:6dd00ea0511a feature/grids/manifolds
Add check if the logical coordinates are in the parameter space when calling a chart
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 25 Apr 2025 08:28:34 +0200 |
parents | 471a948cd2b2 |
children |
line wrap: on
line source
module DiffinitiveSparseArrayKitExt using Diffinitive using Diffinitive.LazyTensors using SparseArrayKit using Tokens """ SparseArray(t::LazyTensor) The sparse tensor representation of `t` with range dimensions to the left and domain dimensions to the right. If `L` is a `LazyTensor` with range and domain dimension 2 and `v` a 2-tensor, then `A = SparseArray(t)` is constructed so that `∑ₖ∑ₗA[i,j,k,l]*v[k,l] == L*v`. """ function SparseArrayKit.SparseArray(t::LazyTensor) v = ArrayToken(:v, domain_size(t)...) return Tokens._to_tensor(t*v, range_size(t), domain_size(t)) end end