Boost logo

Ublas :

Subject: [ublas] [bindings] [lapack] geev and the type of the input matrix
From: Marco Guazzone (marco.guazzone_at_[hidden])
Date: 2010-07-05 10:56:28


Hi,

I've noticed that if you call the version of lapack::geev with only
one output vector

   geev(const char jobvl, const char jobvr, const MatrixA& a, VectorW&
w, const MatrixVL& vl, const MatrixVR& vr);

   geev(const char jobvl, const char jobvr, const MatrixA& a, VectorW&
w, const MatrixVL& vl, const MatrixVR& vr, Workspace work);

the input matrix "a" must be of std::complex type.

As a matter of fact, if you use a non-complex matrix (say
matrix<double>) you get errors like the one below:

--- [error] ---
/boost-numeric_bindings/boost/numeric/bindings/lapack/driver/geev.hpp:709:
error: no matching function for call to
‘boost::numeric::bindings::lapack::geev_impl<double,
void>::invoke(const char&, const char&,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long
int>, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >&, std::vector<std::complex<double>,
std::allocator<std::complex<double> > >&,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long
int>, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >&, boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long
int>, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >&,
boost::numeric::bindings::lapack::optimal_workspace)’
--- [/error] ---

However, there are situations where the input matrix has only real
numbers and the output eigen{vectors,values} are complex.

So, since (in addition to a complex matrix) a non-complex matrix may
also give complex eigen{vectors,values}, why is the check on the
value type not done on the output types (i.e., VectorW, MatrixVL,
MatrixVL)?

IMHO, this would avoid the user (e.g., me ;) ) to copy its working
(possibly non-complex) matrix variable into a temp complex matrix
before using lapack::geev.

Thank you very much!!

Best,

-- Marco