Boost logo

Ublas :

From: Vadim von Brzeski (madvlad_at_[hidden])
Date: 2008-02-04 02:02:35

Thanks! That did the trick.





From: ublas-bounces_at_[hidden] [mailto:ublas-bounces_at_[hidden]]
On Behalf Of Jesse Manning
Sent: Sunday, February 03, 2008 10:24 PM
To: ublas mailing list
Subject: Re: [ublas] geev call parameters


>From looking at the geev binding in geev.hpp it does not look like passing
in NULL for the left and right eigenvector parameters will succeed. Maybe
someone else more familiar with the function can provide more assistance on

I modified your code in the following ways to get it to compile:

int main()
    ublas::matrix<double, ublas::column_major> Y(3,3);

    ublas::vector< std::complex<double> > evals(3);

    // assign some vals to Y

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

    // make sure to pass in matrices for left and right eigenvectors
    lapack::geev(Y, evals, &vl, &vr, lapack::optimal_workspace());

These changes at least allowed your code to compile, but I did not check if
these changes produced correct results when actually running the geev

>From the documentation it looks like vl and vr should be matrices with the
same dimensions as the matrix you pass in as input (in your case the Y

Hope this helps.


On Feb 4, 2008 12:44 AM, Vadim von Brzeski <madvlad_at_[hidden]> wrote:

I am trying to call lapack::geev via lapack as follows:


#include <boost/numeric/ublas/vector.hpp>

#include <boost/numeric/ublas/matrix.hpp>

#include <boost/numeric/ublas/io.hpp>

#include <boost/numeric/bindings/lapack/geev.hpp>

#include <boost/numeric/bindings/traits/ublas_matrix.hpp>

#include <boost/numeric/bindings/traits/ublas_vector.hpp>

#include <boost/numeric/ublas/matrix_proxy.hpp>


namespace ublas = boost::numeric::ublas;

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


int main()


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

ublas::vector< std::complex<double> > evals(3);


            // assign some vals to Y



lapack::geev(Y, evals, NULL, NULL, lapack::optimal_workspace());




But I get is this:


test.cpp:78: error: no matching function for call to `geev


boost::numeric::ublas::unbounded_array<double, std::allocator<double> >

>&, boost::numeric::ublas::vector<std::complex<double>,


std::allocator<std::complex<double> > > >&, int, int,


I tried Y as 'row-major' - same result.


If you look into boost/numeric/bindings/lapack/geev.hpp, this is the


    // gateway / dispatch routine

    template <typename A, typename W, typename V>

    int geev(A& a, W& w, V* vl, V* vr, optimal_workspace)





So I am confused. Can someone please provide some examples on how one would
call geev, and also what the vl and vr parameters should be?


Thank you.


Vadim v. B.

ublas mailing list