Boost logo

Ublas :

From: Jesse Manning (manning.jesse_at_[hidden])
Date: 2008-02-04 01:23:56


>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
this.

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
function.

>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
matrix)

Hope this helps.

Jesse

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::matrix<double,
>
> boost::numeric::ublas::column_major,
>
> boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>
> >&, boost::numeric::ublas::vector<std::complex<double>,
>
> boost::numeric::ublas::unbounded_array<std::complex<double>,
>
> std::allocator<std::complex<double> > > >&, int, int,
> boost::numeric::bindings::lapack::optimal_workspace)'
>
>
>
> I tried Y as 'row-major' – same result.
>
>
>
> If you look into boost/numeric/bindings/lapack/geev.hpp, this is the
> definition
>
>
>
> // 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
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
>
>