EigenMatrix

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

Bases: dolfin.cpp.la.GenericMatrix

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

Copy constructor.

Parameters:EigenMatrix & A (const) –
assign()

Assignment operator.

Parameters:GenericMatrix & A (const) –
Return type:const GenericMatrix &
compress()

Compress matrix (eliminate all zeros from a sparse matrix)

Return type:void
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()

Return reference to Eigen matrix (const version)

Return type:const eigen_matrix_type &
resize()

Resize matrix to M x N.

Parameters:
  • M (std::size_t) –
  • N (std::size_t) –
Return type:

void

sparray()

Return a scipy.sparse representation of Matrix

thisown

The membership flag

zero()

Set all entries to zero and keep any sparse structure.

Return type:void