Boost logo

Ublas :

From: Thomas Lemaire (thomas.lemaire_at_[hidden])
Date: 2005-09-06 03:41:28


compiling your small example does not work for me :

error: call of overloaded 'prod(pipo()::mat&, boost::numeric::ublas::matrix_range<pipo()::mat>&)' is ambiguous
/usr/include/boost/numeric/ublas/matrix_expression.hpp:4636: note: candidates are: typename boost::numeric::ublas::matrix_matrix_binary_traits<typename E1::value_type, E1, typename E2::value_type, E2>::result_type boost::numeric::ublas::prod(const boost::numeric::ublas::matrix_expression<E>&, const boost::numeric::ublas::matrix_expression<E2>&) [with E1 = pipo()::mat, E2 = boost::numeric::ublas::matrix_range<pipo()::mat>]
/usr/include/boost/numeric/ublas/matrix_expression.hpp:4695: note: M boost::numeric::ublas::prod(const boost::numeric::ublas::matrix_expression<E2>&, const boost::numeric::ublas::matrix_expression<E2>&) [with M = pipo()::mat, E1 = boost::numeric::ublas::matrix<double, boost::numeric::ublas::basic_row_major<size_t, ptrdiff_t>, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, E2 = boost::numeric::ublas::matrix_range<pipo()::mat>]

(I call my function pipo(), which explains some pipo() in the error message...)

I am using gcc4 and boost1.33.0 from debian sid
I compile with -DBOOST_UBLAS_USE_EXCEPTIONS, I tried with and without -DNDEBUG but got the same result.

On Tuesday 06 September 2005 09:51, Michael Stevens wrote:
> Hallo Thomas,
>
> On Dienstag 06 September 2005 08:02, Thomas Lemaire wrote:
> > P -= prod<sym_mat>(prod<mat>(K,H_), P);
> > My config has just changed and I am now using stable boost 1.33 and gcc4.
> > the compilation error concerns the inside prod<mat>(K,H_):
>
> The error looks extremely odd. The second prod template should definitely
> be chosen.
>
> I tried to reproduce the report with gcc-4.0.0 and the follow code
> /*
> * Test GCC specific bugs
> */
> #include <boost/numeric/ublas/matrix.hpp>
> #include <boost/numeric/ublas/symmetric.hpp>
> #include <boost/numeric/ublas/matrix_proxy.hpp>
>
> using namespace boost::numeric::ublas;
>
> int main()
> {
> typedef matrix<double> mat;
> typedef symmetric_matrix<double> sym_mat;
> sym_mat P;
> mat K;
> matrix_range<mat> H_ (K, range(0,0), range(0,0));
> P -= prod<sym_mat>(prod<mat>(K,H_), P);
> }
>
> This compile fine. Can you simplify your test case and be more specific
> about which GCC 4 version.
>
> Fingers crossed,
> Michael

-- 
thomas