Skip to content
Joris Gillis edited this page Sep 16, 2022 · 2 revisions

Standard documentation for Sparsity.find:

 [INTERNAL] 

 find(self, bool ind1) -> [int]

Get the location of all non-zero elements as they would appear in a Dense matrix.

A : DenseMatrix 4 x 3 B : SparseMatrix 4 x 3 , 5 structural non-zeros

k = A.find() A[k] will contain the elements of A that are non-zero in B

Inverse of nonzeros.

Extra doc: https://github.com/casadi/casadi/wiki/L_da

Doc source: https://github.com/casadi/casadi/blob/develop/casadi/core/sparsity.hpp#L933

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/sparsity.cpp#L711-L715

Extra documentation

To edit, see writing tips.

Clone this wiki locally