Skip to content
Joris Gillis edited this page Apr 4, 2023 · 2 revisions

Standard documentation for diag:

 Get the diagonal of a matrix or construct a diagonal.

::

 diag(DM A) -> DM
 diag(SX A) -> SX
 diag(MX A) -> MX

When the input is square, the diagonal elements are returned. If the input is vector-like, a diagonal matrix is constructed with it.

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

Doc source: https://github.com/casadi/casadi/blob/develop/casadi/core/generic_matrix.hpp#L596

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/generic_matrix.hpp#L596-L598

Extra documentation

To edit, see writing tips.

Clone this wiki locally