Bugzilla – Attachment 566 Details for
Bug 1005
Error with sparse vector and transpose of matrix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
This bugzilla service is closed. All entries have been migrated to
https://gitlab.com/libeigen/eigen
Repro code
eigen_sparse_bug.cpp (text/x-c++src), 1.03 KB, created by
Benjamin Chretien
on 2015-04-27 04:15:26 UTC
(
hide
)
Description:
Repro code
Filename:
MIME Type:
Creator:
Benjamin Chretien
Created:
2015-04-27 04:15:26 UTC
Size:
1.03 KB
patch
obsolete
>#include <Eigen/Sparse> >#include <iostream> > >using namespace Eigen; > >typedef SparseMatrix<double> sparseMatrix_t; >typedef SparseVector<double> sparseVector_t; > >typedef MatrixXd denseMatrix_t; >typedef VectorXd denseVector_t; > >int main(int argc, char *argv[]) >{ > IOFormat ioformat = IOFormat (StreamPrecision, > DontAlignCols, > ",", ",", "", "", "(", ")"); > ioformat.rowSpacer = ""; > > sparseMatrix_t m1 (1, 2); > m1.insert (0, 0) = 1.; > m1.insert (0, 1) = 2.; > > sparseMatrix_t m2 (2, 1); > m2.insert (0, 0) = 1.; > m2.insert (1, 0) = 2.; > > sparseVector_t v (2); > v.insert (0) = 1.; > v.insert (1) = 2.; > > std::cout << denseMatrix_t (m1).format (ioformat) << std::endl; > std::cout << denseMatrix_t (m2).format (ioformat) << std::endl; > std::cout << denseVector_t (v).format (ioformat) << std::endl; > > v += m1.transpose (); > std::cout << denseVector_t (v).format (ioformat) << std::endl; > > v += m2; > std::cout << denseVector_t (v).format (ioformat) << std::endl; > > return 0; >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1005
: 566