csc_matrix.py#

Define the CSCmatrix class.

class openmdao.matrices.csc_matrix.CSCMatrix(submats)[source]

Bases: COOMatrix

Sparse matrix in Compressed Col Storage format.

Parameters:
submatsdict

Dictionary of sub-jacobian data keyed by (row_name, col_name).

Attributes:
_coo_to_csc_mapndarray of int

Single array of size nnz. Entry i holds the CSC data index for COO entry i. Multiple COO entries may map to the same CSC index when duplicate (row, col) pairs exist across subjacs.

_has_within_subjac_duplicatesdict

Maps subjac key to bool. True if that subjac has duplicate (row, col) entries within its own COO slice, requiring np.add.at instead of +=.

Methods

dump(msginfo)

Dump the matrix to stdout.

todense()

Return a dense version of the matrix.

transpose()

Transpose the matrix.

__init__(submats)[source]

Initialize all attributes.

dump(msginfo)[source]

Dump the matrix to stdout.

Parameters:
msginfostr

Message info.

todense()[source]

Return a dense version of the matrix.

Returns:
ndarray

Dense array representation of the matrix.

transpose()[source]

Transpose the matrix.

Returns:
csr_matrix

Transposed matrix.