# EigenMatrix¶

class dolfin.cpp.la.EigenMatrix(*args)

This class provides a sparse matrix class based on Eigen. It is a simple wrapper for Eigen::SparseMatrix implementing the GenericMatrix interface.

The interface is intentionally simple. For advanced usage, access the underlying Eigen matrix and use the standard Eigen interface which is documented at http://eigen.tuxfamily.org

• EigenMatrix()

Create empty matrix

• EigenMatrix(M, N)

Create M x N matrix

• EigenMatrix(A)

Copy constructor

assign()

• operator=(A)

Assignment operator

• operator=(A)

Assignment operator

compress()

Compress matrix (eliminate all zeros from a sparse matrix)

data(deepcopy=True)

Return arrays to underlaying compresssed row/column storage data

This method is only available for the Eigen linear algebra backend.

Arguments
deepcopy
Return a copy of the data. If set to False a reference to the Matrix need to be kept, otherwise the data will be destroyed together with the destruction of the Matrix
mat()

• mat()

Return reference to Eigen matrix (const version)

• mat()

Return reference to Eigen matrix (non-const version)

resize()

Resize matrix to M x N

sparray()

Return a scipy.sparse representation of Matrix

thisown

The membership flag

zero()