Bugzilla – Attachment 557 Details for
Bug 985
RealQZ yields a wrong answer when there are zeros in the input 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
test case
test_QZ.cpp (text/x-c++src), 1.44 KB, created by
Ben Goodrich
on 2015-03-30 17:40:00 UTC
(
hide
)
Description:
test case
Filename:
MIME Type:
Creator:
Ben Goodrich
Created:
2015-03-30 17:40:00 UTC
Size:
1.44 KB
patch
obsolete
>#include <Eigen/Dense> >#include <iostream> > >int main() { > int K = 8; > // double precision also exhibits the bug > typedef Eigen::Matrix<long double, Eigen::Dynamic, Eigen::Dynamic> mat; > mat A = mat::Zero(K,K); > mat B = mat::Zero(K,K); > > A(0,2) = -0.166420546130334; > A(1,2) = -4.01570490140352; > A(1,3) = 5.73672128771931; > A(1,4) = -11.4734425754386; > A(2,3) = -1; > A(3,0) = -0.4175111947; > A(5,1) = -0.5839317408; > > B(0,2) = -0.175179522242457; > B(0,3) = -0.583931740808189; > B(0,4) = 0.417511194677855; > B(1,4) = -11.4734425754386; > B(2,3) = -0.9; > B(3,4) = -0.417511194677855; > B(4,2) = -0.175179522242457; > B(4,3) = -0.583931740808189; > B(4,5) = 0.583931740808189; > B(5,5) = -0.583931740808189; > B(6,0) = 1; > B(7,1) = 1; > B(6,4) = -1; > B(7,5) = -1; > B(6,6) = 1; > B(7,7) = 1; > > // Making B random yields norms close to zero > // B.setRandom(K,K); > Eigen::RealQZ<mat> qz(K); > qz.compute(A,B); > std::cout << "S:\n" << qz.matrixS() << "\n" << "T:\n" << qz.matrixT() << "\n"; > std::cout << "Q:\n" << qz.matrixQ() << "\n" << "Z:\n" << qz.matrixZ() << "\n"; > > std::cout << "\nErrors:" > << "\n|A-QSZ|: " << (A-qz.matrixQ()*qz.matrixS()*qz.matrixZ()).norm() > << ", |B-QTZ|: " << (B-qz.matrixQ()*qz.matrixT()*qz.matrixZ()).norm() > << "\n|QQ* - I|: " << (qz.matrixQ()*qz.matrixQ().transpose() - mat::Identity(K,K)).norm() > << ", |ZZ* - I|: " << (qz.matrixZ()*qz.matrixZ().transpose() - mat::Identity(K,K)).norm() > << "\n"; > 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 985
: 557 |
558