Bugzilla – Attachment 616 Details for
Bug 305
.block() not implemented for sparse matrices
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
minimal example main.cpp file for sparse matrix block assignment
block_assign_main.cpp (text/x-c++src), 692 bytes, created by
henzlers
on 2015-10-19 17:49:04 UTC
(
hide
)
Description:
minimal example main.cpp file for sparse matrix block assignment
Filename:
MIME Type:
Creator:
henzlers
Created:
2015-10-19 17:49:04 UTC
Size:
692 bytes
patch
obsolete
>#include <iostream> >#include <Eigen/Dense> >#include <Eigen/Sparse> > >using namespace Eigen; >using namespace std; > >typedef Matrix<double,5,5> Matrix5d; > >int main() >{ > Matrix2d m; > Matrix5d mbig; > m<< > 5.0,0.0, > 0.0,6.0; > mbig.setConstant(0.0); > mbig.block(0,0,2,2)=m.block(0,0,2,2); > cout<<"mbig="<<endl<<mbig<<endl; > SparseMatrix<double> small(2,2),big(4,4); > for(int i=0;i<m.rows();i++) > for(int j=0;j<m.cols();j++) > if(m(i,j)!=0.0) > small.insert(i,j)=m(i,j); > small.makeCompressed(); > cout<<"small sparse="<<endl<<small.toDense()<<endl; > big.block(0,0,2,2)=small.block(0,0,2,2); > big.makeCompressed(); > cout<<"big sparse="<<endl<<big.toDense()<<endl; >}
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 305
:
370
| 616