Boost logo

Ublas :

Subject: Re: [ublas] [bindings] [lapack] geev and the type of the input matrix
From: Marco Guazzone (marco.guazzone_at_[hidden])
Date: 2010-07-15 03:55:52


On Wed, Jul 14, 2010 at 8:47 PM, Rutger ter Borg <rutger_at_[hidden]> wrote:
> Marco Guazzone wrote:
>
> [snip]
>>
>>   bindings::lapack::geev('V', 'V', ublas::trans(A), wr, wi, LV, RV);
>>
> [snip]
>
> Could your error have to do with ublas::trans(..) turning anything you pass
> it into a read-only object?
>
> Have you tried bindings::trans(A) over the ublas one? That one should
> preserve access rights to the underlying object.
>

Just tried:

--- [code snip] ---
...
#include <boost/numeric/bindings/trans.hpp>
#include <boost/numeric/bindings/ublas.hpp>
...
int main()
{
  ...
  bindings::lapack::geev('V', 'V', bindings::trans(A), wr, wi, LV, RV);
  ...
}
--- [/code snip] ---

but does not work:

--- [error] ---
In file included from lapack_geev.cpp:2:
/home/marco/tmp/boost-numeric_bindings/boost/numeric/bindings/lapack/driver/geev.hpp:
In static member function ‘static ptrdiff_t
boost::numeric::bindings::lapack::geev_impl<Value, typename
boost::enable_if<boost::numeric::bindings::is_real<T>,
void>::type>::invoke(char, char, MatrixA&, VectorWR&, VectorWI&,
MatrixVL&, MatrixVR&,
boost::numeric::bindings::lapack::detail::workspace1<WORK>) [with
MatrixA = const
boost::numeric::bindings::detail::trans_wrapper<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> > >, mpl_::void_>, VectorWR =
boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> >, VectorWI = boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> >, MatrixVL = 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> > >, MatrixVR =
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> > >, WORK =
boost::numeric::bindings::detail::array<double>, Value = double]’:
/home/marco/tmp/boost-numeric_bindings/boost/numeric/bindings/lapack/driver/geev.hpp:236:
  instantiated from ‘static ptrdiff_t
boost::numeric::bindings::lapack::geev_impl<Value, typename
boost::enable_if<boost::numeric::bindings::is_real<T>,
void>::type>::invoke(char, char, MatrixA&, VectorWR&, VectorWI&,
MatrixVL&, MatrixVR&,
boost::numeric::bindings::lapack::optimal_workspace) [with MatrixA =
const boost::numeric::bindings::detail::trans_wrapper<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> > >, mpl_::void_>, VectorWR =
boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> >, VectorWI = boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> >, MatrixVL = 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> > >, MatrixVR =
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> > >, Value = double]’
/home/marco/tmp/boost-numeric_bindings/boost/numeric/bindings/lapack/driver/geev.hpp:461:
  instantiated from ‘typename
boost::disable_if<boost::numeric::bindings::lapack::detail::is_workspace<MatrixVR>,
long int>::type boost::numeric::bindings::lapack::geev(char, char,
const MatrixA&, VectorWR&, VectorWI&, MatrixVL&, MatrixVR&) [with
MatrixA = boost::numeric::bindings::detail::trans_wrapper<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> > >, mpl_::void_>, VectorWR =
main()::out_vector_type, VectorWI = main()::out_vector_type, MatrixVL
= main()::out_matrix_type, MatrixVR = main()::out_matrix_type]’
lapack_geev.cpp:50: instantiated from here
/home/marco/tmp/boost-numeric_bindings/boost/numeric/bindings/lapack/driver/geev.hpp:146:
error: invalid application of ‘sizeof’ to incomplete type
‘boost::STATIC_ASSERTION_FAILURE<false>’
/home/marco/tmp/boost-numeric_bindings/boost/numeric/bindings/lapack/driver/geev.hpp:146:
error: invalid application of ‘sizeof’ to incomplete type
‘boost::STATIC_ASSERTION_FAILURE<false>’
--- [/error] ---

Cheers,

-- Marco