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

Standard documentation for Sparsity.sub:

 Get a set of elements.

 sub(self, [int] rr, Sparsity sp, bool ind1) -> (Sparsity , [int] OUTPUT)
 sub(self, [int] rr, [int] cc, bool ind1) -> (Sparsity , [int] OUTPUT)

Returns the sparsity of the corresponding elements, with a mapping such that submatrix[k] = originalmatrix[mapping[k]]

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

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

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/sparsity.cpp#L305-L308

.......

::

 sub(self, [int] rr, Sparsity sp, bool ind1)

Get a set of elements.

Returns the sparsity of the corresponding elements, with a mapping such that submatrix[k] = originalmatrix[mapping[k]]

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

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

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/sparsity.cpp#L305-L308

.............

.......

::

 sub(self, [int] rr, [int] cc, bool ind1)

Get a submatrix.

Returns the sparsity of the submatrix, with a mapping such that

submatrix[k] = originalmatrix[mapping[k]]

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

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

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/sparsity.cpp#L310-L313

.............

Extra documentation

To edit, see writing tips.

Clone this wiki locally