:lapack_matrix to mtl::matrix

[email protected] Tue, 27 Apr 2004 13:24:49 +0200 (MEST)
Newsgroups gmane.comp.lib.mtl.devel
Message-ID <[email protected]>
Hi all,
I'm a newbie to the MTL (and not so fit in STL), so please apologise my
simple question. 

How can I simply transfrom a mtl::lapack_matrix to a mtl::matrix. I did it
now via an array:


 typedef matrix<double,
               rectangle<>,
               dense<>,
               column_major >::type   myMatrix
 typedef ssMatrix::size_type          mySizeT;
 mySizeT   n=3;

 //right eigenvectors for the geev algorithm:
 lapack_matrix<double>::type  vr(3,3);
 double  eigenvecs[n*n];
 myMatrix  newMatrix(eigenvecs,n,n);
 int  k=0;
 //... 
 //... vr will be filled via  mtl::mtl2lapack::geev

 for (int i=0; i<3; i++)
   for (int j=0; j<3; j++)
     {
     eigenvecs[k]=vr[i][j];
     std::cout << "eigenvecs[" << k << "]= " << eigenvecs[k] << std::endl;
     k++;
     };
 //... using newMatrix now for further matrix computation
 //multiplication, etc...


but this seems to me a little bit complicated. Isn't there a faster method
by member functions? 
Thanx a lot for any comment, for learning more about MTL, matrix and STL
handling.

regards,
uli
 

-- 
 

"Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info

_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/