Function Dune::XT::LA::eye_matrix

Function template Dune::XT::LA::eye_matrix

template<class MatrixType>
int Dune::XT::LA::eye_matrix(MatrixType &matrix)

Overwrites the given matrix with the identity (zeros off-diagonal, ones on the diagonal).

Function template Dune::XT::LA::eye_matrix

template<class MatrixType>
int Dune::XT::LA::eye_matrix(const int rows, const int cols, const SparsityPatternDefault &pattern = SparsityPatternDefault())

Creates a rows x cols identity matrix of the given LA matrix type (optionally with a sparsity pattern).

Function template Dune::XT::LA::eye_matrix

template<class MatrixType>
int Dune::XT::LA::eye_matrix(const int size, const SparsityPatternDefault &pattern = SparsityPatternDefault())

Creates a square size x size identity matrix of the given matrix type.