finesse.cmatrix.CCSMatrix.add_diagonal_elements

CCSMatrix.add_diagonal_elements(self, SuiteSparse_long Neqs, SuiteSparse_long index, unicode name, is_diagonal=True)

Adds a submatrix to the matrix along its diagonal. This defines what equations exist in the matrix, the submatrix values default to 1, but a diagonal view is returned that allows them to be modified. Before other submatrices can be added to the matrix the diagonal must be specfied and how many equations it represents.

Parameters

Neqs : Py_ssize_t

Number of equations this submatrix represents

_index : long

Subcolumn index

name : unicode

Name used to indentify this coupling in the matrix for debugging