Bugzilla – Attachment 361 Details for
Bug 626
No range check for sparse 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
Test for sparse matrix range check
matrixRangeTest.cpp (text/x-c++src), 1016 bytes, created by
Kolja Brix
on 2013-06-28 13:19:25 UTC
(
hide
)
Description:
Test for sparse matrix range check
Filename:
MIME Type:
Creator:
Kolja Brix
Created:
2013-06-28 13:19:25 UTC
Size:
1016 bytes
patch
obsolete
>#include <iostream> > >#include <Eigen/Core> >#include <Eigen/SparseCore> > >int main() >{ > > Eigen::SparseMatrix < double, Eigen::Dynamic > M(10, 10); > > std::cout<<"allowed entries"<<std::endl; > M.coeffRef(0,0)=1; > M.coeffRef(0,2)=1; > M.coeffRef(0,5)=1; > M.coeffRef(2,3)=1; > M.coeffRef(7,9)=1; > std::cout<<"M="<<std::endl<<M<<std::endl; > > std::cout<<"entries with column number that is not allowed"<<std::endl; // these entries are inserted > M.coeffRef(0,10)=2; > M.coeffRef(3,11)=2; > M.coeffRef(5,12)=2; > std::cout<<""<<"M="<<std::endl<<M<<std::endl; > > std::cout<<"entries with row number that is not allowed"<<std::endl; // (usually) results in segmentation fault > M.coeffRef(10,4)=-2; > M.coeffRef(11,5)=-2; > M.coeffRef(12,9)=-2; > std::cout<<"M="<<std::endl<<M<<std::endl; > > std::cout<<"entries with row and column numbers that are both not allowed"<<std::endl; // (usually) results in segmentation fault > M.coeffRef(11,10)=1; > M.coeffRef(15,11)=1; > M.coeffRef(10,12)=1; > std::cout<<"M="<<std::endl<<M<<std::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 626
: 361