transiflow.CrsMatrix

class CrsMatrix(coA=None, jcoA=None, begA=None, compress=True, m=None, n=None)

Bases: object

Compressed sparse row matrix used for assembly of the internal matrices. Can also be used for debugging purposes

assemble()

Assemble the matrix after using the setter to assign values.

compress()

Remove zeros and merge duplicate entries, which may occur in the case of periodic boundary conditions.

property dtype

Shape of the matrix

dump(name)

Dump the matrix to a file.

property m

Row dimension of the matrix

matvec(x)

Return $y = A x$

property n

Column dimension of the matrix

property shape

Shape of the matrix

show(dof=None)

Use vsm to show the structure of the matrix. vsm can currently be found in the mrilu directory of I-EMIC.

solve(rhs)

Solve a system using the self.lu property

to_coo()

Convert the matrix to coordinate format.

Returns:
coAarray_like

Values

icoAarray_like

Row indices

jcoAarray_like

Column indices

to_dense()

Convert the matrix to a dense matrix.

Returns:
Aarray_like

Dense matrix

transpose()

Return the transpose of the matrix.

Returns:
BCrsMatrix

Transpose of the matrix

\[\]