Boost logo

Boost Users :

Subject: [Boost-users] [ublas]how to get tsm to compile with simple matrix args?
From: Larry Evans (cppljevans_at_[hidden])
Date: 2011-11-14 14:26:09


Compilation of the attached file with gcc4.7 produces obscure output:

/home/evansl/download/gcc/4.7-20111008/install/bin/g++ -c -Wall
-ftemplate-depth-300 -O0 -g3 -fno-inline -std=gnu++0x
-I/home/evansl/prog_dev/boost-svn/ro/trunk/sandbox/rw/non_variadic_templates
-I/home/evansl/prog_dev/boost-svn/ro/trunk -I../../..
-DTEMPLATE_DEPTH=300 solve_tridiag_ublas.cpp -MMD -o solve_tridiag_ublas.o
In file included from solve_tridiag_ublas.cpp:2:0:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:
In instantiation of 'typename
boost::numeric::ublas::matrix_matrix_solve_traits<E1, E2>::result_type
boost::numeric::ublas::solve(const
boost::numeric::ublas::matrix_expression<E1>&, const
boost::numeric::ublas::matrix_expression<E1>&, C) [with E1 =
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>; E2 = boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >; C =
double; typename boost::numeric::ublas::matrix_matrix_solve_traits<E1,
E2>::result_type = boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >]':
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/blas.hpp:387:48:
  required from 'M1& boost::numeric::ublas::blas_3::tsm(M1&, const T&,
const M2&, C) [with M1 = boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>; T = double; M2 = boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>; C = double]'
solve_tridiag_ublas.cpp:150:54: required from here
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
error: no matching function for call to 'inplace_solve(const
boost::numeric::ublas::matrix_expression<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
> >&,
boost::numeric::ublas::matrix_matrix_solve_traits<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >
>::result_type&, double)'
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
note: candidates are:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1859:10:
note: template<class E1, class E2> void
boost::numeric::ublas::inplace_solve(const
boost::numeric::ublas::matrix_expression<E1>&,
boost::numeric::ublas::vector_expression<E2>&,
boost::numeric::ublas::lower_tag,
boost::numeric::ublas::column_major_tag,
boost::numeric::ublas::dense_proxy_tag)
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1859:10:
note: template argument deduction/substitution failed:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
note:
'boost::numeric::ublas::matrix_matrix_solve_traits<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >
>::result_type {aka boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>}' is not derived from 'boost::numeric::ublas::vector_expression<E2>'
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1885:10:
note: template<class E1, class E2> void
boost::numeric::ublas::inplace_solve(const
boost::numeric::ublas::matrix_expression<E1>&,
boost::numeric::ublas::vector_expression<E2>&,
boost::numeric::ublas::lower_tag,
boost::numeric::ublas::column_major_tag,
boost::numeric::ublas::packed_proxy_tag)
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1885:10:
note: template argument deduction/substitution failed:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
note:
'boost::numeric::ublas::matrix_matrix_solve_traits<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >
>::result_type {aka boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>}' is not derived from 'boost::numeric::ublas::vector_expression<E2>'
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1914:10:
note: template<class E1, class E2> void
boost::numeric::ublas::inplace_solve(const
boost::numeric::ublas::matrix_expression<E1>&,
boost::numeric::ublas::vector_expression<E2>&,
boost::numeric::ublas::lower_tag,
boost::numeric::ublas::column_major_tag,
boost::numeric::ublas::unknown_storage_tag)
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1914:10:
note: template argument deduction/substitution failed:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
note:
'boost::numeric::ublas::matrix_matrix_solve_traits<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >
>::result_type {aka boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>}' is not derived from 'boost::numeric::ublas::vector_expression<E2>'
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1942:10:
note: template<class E1, class E2> void
boost::numeric::ublas::inplace_solve(const
boost::numeric::ublas::matrix_expression<E1>&,
boost::numeric::ublas::vector_expression<E2>&,
boost::numeric::ublas::lower_tag, boost::numeric::ublas::column_major_tag)
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1942:10:
note: template argument deduction/substitution failed:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
note:
'boost::numeric::ublas::matrix_matrix_solve_traits<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >
>::result_type {aka boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>}' is not derived from 'boost::numeric::ublas::vector_expression<E2>'
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1950:10:
note: template<class E1, class E2> void
boost::numeric::ublas::inplace_solve(const
boost::numeric::ublas::matrix_expression<E1>&,
boost::numeric::ublas::vector_expression<E2>&,
boost::numeric::ublas::lower_tag, boost::numeric::ublas::row_major_tag)
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1950:10:
note: template argument deduction/substitution failed:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
note:
'boost::numeric::ublas::matrix_matrix_solve_traits<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >
>::result_type {aka boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>}' is not derived from 'boost::numeric::ublas::vector_expression<E2>'
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1959:10:
note: template<class E1, class E2> void
boost::numeric::ublas::inplace_solve(const
boost::numeric::ublas::matrix_expression<E1>&,
boost::numeric::ublas::vector_expression<E2>&,
boost::numeric::ublas::lower_tag)
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1959:10:
note: template argument deduction/substitution failed:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
note:
'boost::numeric::ublas::matrix_matrix_solve_traits<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >
>::result_type {aka boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>}' is not derived from 'boost::numeric::ublas::vector_expression<E2>'
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1967:10:
note: template<class E1, class E2> void
boost::numeric::ublas::inplace_solve(const
boost::numeric::ublas::matrix_expression<E1>&,
boost::numeric::ublas::vector_expression<E2>&,
boost::numeric::ublas::unit_lower_tag)
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1967:10:
note: template argument deduction/substitution failed:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
note:
'boost::numeric::ublas::matrix_matrix_solve_traits<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >
>::result_type {aka boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>}' is not derived from 'boost::numeric::ublas::vector_expression<E2>'
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1977:10:
note: template<class E1, class E2> void
boost::numeric::ublas::inplace_solve(const
boost::numeric::ublas::matrix_expression<E1>&,
boost::numeric::ublas::vector_expression<E2>&,
boost::numeric::ublas::upper_tag,
boost::numeric::ublas::column_major_tag,
boost::numeric::ublas::dense_proxy_tag)
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:1977:10:
note: template argument deduction/substitution failed:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
note:
'boost::numeric::ublas::matrix_matrix_solve_traits<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >
>::result_type {aka boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>}' is not derived from 'boost::numeric::ublas::vector_expression<E2>'
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2003:10:
note: template<class E1, class E2> void
boost::numeric::ublas::inplace_solve(const
boost::numeric::ublas::matrix_expression<E1>&,
boost::numeric::ublas::vector_expression<E2>&,
boost::numeric::ublas::upper_tag,
boost::numeric::ublas::column_major_tag,
boost::numeric::ublas::packed_proxy_tag)
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2003:10:
note: template argument deduction/substitution failed:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
note:
'boost::numeric::ublas::matrix_matrix_solve_traits<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >
>::result_type {aka boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>}' is not derived from 'boost::numeric::ublas::vector_expression<E2>'
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2032:10:
note: template<class E1, class E2> void
boost::numeric::ublas::inplace_solve(const
boost::numeric::ublas::matrix_expression<E1>&,
boost::numeric::ublas::vector_expression<E2>&,
boost::numeric::ublas::upper_tag,
boost::numeric::ublas::column_major_tag,
boost::numeric::ublas::unknown_storage_tag)
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2032:10:
note: template argument deduction/substitution failed:
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/numeric/ublas/triangular.hpp:2587:9:
note:
'boost::numeric::ublas::matrix_matrix_solve_traits<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::matrix_binary_scalar1<const double,
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, boost::numeric::ublas::scalar_multiplies<double, double> >
>::result_type {aka boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>}' is not derived from 'boost::numeric::ublas::vector_expression<E2>'

and it goes on and on. Looking at libs/numeric/ublas/test:23.cpp was no
help since it looked like it was doing exactly what the attached
code is doing.

Please, what can I change to get the attached to compile?

TIA.

-regards,
Larry




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net