Boost logo

Ublas :

From: Jeremy Conlin (jeremit0_at_[hidden])
Date: 2008-06-23 10:45:09


Thanks Thomas, I needed that.
I had used trevc as you had, but I hadn't done the multiplication with the
original matrix and the eigenvalue and see how the results compare. I was
just comparing my eigenvectors with eigenvectors calculated with Mathematica
and another application. I too get a bunch of zeros indicating the
eigenvectors are good, but my eigenvectors don't match with Mathematica. I
have tried different methods of normalizing the eigenvectors to see if that
is the difference, but have had no such luck in getting them to match up.

Jeremy

On Sat, Jun 21, 2008 at 6:44 PM, Thomas Klimpel <Thomas.Klimpel_at_[hidden]>
wrote:

> Hello Jeremy,
>
> I modified your file hseqr.cpp slightly (just update
> libs/numeric/bindings), to create an example of trecv in use. Hope it helps.
>
> Regards,
> Thomas
>
> Index: bindings/lapack/test/hseqr.cpp
> ===================================================================
> --- bindings/lapack/test/hseqr.cpp (Revision 46588)
> +++ bindings/lapack/test/hseqr.cpp (Arbeitskopie)
> @@ -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;
> +
> }
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: ublas-bounces_at_[hidden] im Auftrag von Jeremy Conlin
> Gesendet: Do 19.06.2008 21:41
> An: ublas mailing list
> Betreff: [ublas] Example of using trevc.hpp?
>
> I am trying to use the trevc.hpp header with my new hseqr.hpp header. I'm
> not getting the results I expected and I'm trying to track down the error.
> Everything compiles and runs, but the result is not what I expected. I
> can
> confirm the results of hseqr by a call to Mathematica, but I can't figure
> out an equivalent command for trevc.
> Does anyone have an example of trevc in use?
>
> Thanks,
> Jeremy
>
>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
>
>