Boost logo

Ublas :

Subject: [ublas] binding to LAPACK routine gees()
From: Jakob Gerstenlauer (j.gerstenlauer_at_[hidden])
Date: 2008-11-10 10:58:35


Hi,

I want to compute the dominant eigenvalue of some non-symmetric
matrices, so I was happy to find out that the numeric bindings library
provides an interface to some lapack routines. I chose the gees routine,
but now I got stuck with the following error:
   
error: no match for call to
`(boost::numeric::bindings::lapack::detail::Gees<1>) (char,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>&, boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>&, boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>&, double*&)'

Can anybody give me some indication about the error? Did I declare
"workspace" with the proper type? Below I attached the code.

Thanks in advance for any help!
Jakob, uBLAS greenhorne

#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/bindings/lapack/gees.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>

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

using namespace ublas;

int main() {

    ublas::matrix<double, column_major> m (3,3);

    for(unsigned int i=0; i<3; i++){
        for(unsigned int j=0; j<3; j++){
            m(i,j)=i*j;
        }
    }

    ublas::vector<double> v1 (3), v2 (3);

    double workspace[10000];

    lapack::gees(m,v1,v2,workspace);

    return 0;
}