1 SparseMatrix<double>
A(3,3);
6 cout <<
"The matrix A is:" << endl <<
MatrixXd(
A) << endl;
7 cout <<
"it has " <<
A.
nonZeros() <<
" stored non zero coefficients that are: " <<
A.
coeffs().transpose() << endl;
9 cout <<
"After adding 10 to every stored non zero coefficient, the matrix A is:" << endl <<
MatrixXd(
A) << endl;
SparseMatrix< double > A(3, 3)
const Map< const Array< Scalar, Dynamic, 1 > > coeffs() const
Scalar & insert(Index row, Index col)
Matrix< double, Dynamic, Dynamic > MatrixXd
Dynamic×Dynamic matrix of type double.