Mercurial > repos > public > sbplib_julia
diff ext/SbplibSparseArraysExt.jl @ 1708:8787b2f9f5f8 feature/lazy_tensors/sparse_conversions
Add docstrings
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 04 Sep 2024 22:47:41 +0200 |
parents | 3e9c3986930d |
children |
line wrap: on
line diff
--- a/ext/SbplibSparseArraysExt.jl Mon Sep 02 15:35:54 2024 +0200 +++ b/ext/SbplibSparseArraysExt.jl Wed Sep 04 22:47:41 2024 +0200 @@ -6,6 +6,14 @@ using SparseArrays using Tokens +""" + sparse(t::LazyTensor) + +The sparse matrix representation of `t`. + +If `L` is a `LazyTensor` and `v` a tensor, then `A = sparse(L)` is constructed +so that `A*reshape(v,:) == reshape(L*v,:)`. +""" function SparseArrays.sparse(t::LazyTensor) v = ArrayToken(:v, prod(domain_size(t)))