Boost logo

Boost-Commit :

From: thomas.klimpel_at_[hidden]
Date: 2008-06-21 18:40:37


Author: klimpel
Date: 2008-06-21 18:40:36 EDT (Sat, 21 Jun 2008)
New Revision: 46595
URL: http://svn.boost.org/trac/boost/changeset/46595

Log:
example use of trevc

Text files modified:
   sandbox/libs/numeric/bindings/lapack/test/hseqr.cpp | 24 ++++++++++++++++++++++++
   1 files changed, 24 insertions(+), 0 deletions(-)

Modified: sandbox/libs/numeric/bindings/lapack/test/hseqr.cpp
==============================================================================
--- sandbox/libs/numeric/bindings/lapack/test/hseqr.cpp (original)
+++ sandbox/libs/numeric/bindings/lapack/test/hseqr.cpp 2008-06-21 18:40:36 EDT (Sat, 21 Jun 2008)
@@ -90,6 +90,30 @@
     cout << "'New' original matrix:\n" << origG << endl;
     cout << "==================================" << endl;
 
+ ublas::matrix<complex<double>, ublas::column_major> cVL(cZ);
+ ublas::matrix<complex<double>, ublas::column_major> cVR(cZ);
+ boost::numeric::bindings::traits::detail::array<complex<double> > work(3*n);
+ lapack::trevc('B','B',G,cVL,cVR,work);
+
+ cout << "\n==================================" << endl;
+ cout << "Testing left & right eigenvectors..." << endl;
+ Hessenberg(G);
+ cout << "Many 'zeros':" << endl;
+ for ( int i=0; i<n; ++i){
+ cout << (ublas::prod( G, column(cVR, i) ) - values(i) * column(cVR, i)) << endl;
+ cout << (ublas::prod( ublas::herm(G), column(cVL, i) ) - conj( values(i) ) * column(cVL, i)) << endl;
+ }
+ cout << "==================================" << endl;
+
+ cout << "\n==================================" << endl;
+ cout << "Verifying diagonal matrix..." << endl;
+ ublas::matrix<complex<double>, ublas::column_major> cG(n,n,0);
+ Hessenberg(G);
+ G = ublas::prod( G, cVR );
+ G = ublas::prod( ublas::herm(cVL), G );
+ cout << "'diagonal' matrix:\n" << G << endl;
+ cout << "==================================" << endl;
+
 }
 
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk