Boost logo

Ublas :

Subject: [ublas] lapack::geev()
From: Jakob Gerstenlauer (j.gerstenlauer_at_[hidden])
Date: 2008-11-12 07:39:21


Hi,

I realized that lapack::gees() is not the appropriate routine for me,
and geev() would better suit me.
Now I hope somebody has already tried that routine and I would really
appreciate to see an example of how it works.
I attached my code (that is however not working: "no matching function
for call...").

Cheers,
Jakob

#include <iostream>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/bindings/lapack/geev.hpp>
#include <boost/numeric/bindings/traits/vector_traits.hpp>
#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
#include <boost/numeric/bindings/traits/ublas_vector2.hpp>
#include <boost/numeric/bindings/traits/c_array.hpp>
#include <complex>

namespace ublas = boost::numeric::ublas;
namespace lapack = boost::numeric::bindings::lapack;

int main() {

unsigned int n=10;

ublas::matrix < double, ublas::column_major> A (n,n);
    for(unsigned int i=0; i<n; i++){
       for(unsigned int j=0; j<n; j++){
           A(i,j)=i*j;
       }
    }

ublas::matrix<std::complex<double>, ublas::column_major> Vl(n,n),Vr(n,n);
ublas::vector<std::complex<double> > w(n);
double work[10*n];

lapack::geev(A, w, Vl, Vr, work);

return 0;
}