gtsam
3rdparty
Eigen
doc
snippets
SparseMatrix_coeffs.cpp
Go to the documentation of this file.
1
SparseMatrix<double>
A
(3,3);
2
A
.insert(1,2) = 0;
3
A
.insert(0,1) = 1;
4
A
.insert(2,0) = 2;
5
A
.makeCompressed();
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;
8
A
.coeffs() += 10;
9
cout <<
"After adding 10 to every stored non zero coefficient, the matrix A is:"
<< endl << MatrixXd(
A
) << endl;
A
Definition:
test_numpy_dtypes.cpp:298
A
SparseMatrix< double > A(3, 3)
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:04:43