Boost logo

Ublas :

From: Thomas Lemaire (thomas.lemaire_at_[hidden])
Date: 2005-09-06 01:13:31


An other example of the same error:

S.assign(prod<sym_mat>(Jxi, prod<mat>(Pi_, trans(Jxi))) +
             prod<sym_mat>(Jxt, prod<mat>(Pt_, trans(Jxt))) +
             sym_mat(prod<mat>(Jxt, prod<mat>(Pti_, trans(Jxi))) + //the sum of these two terms
                     prod<mat>(Jxi, prod<mat>(trans(Pti_), trans(Jxt))) // <- error !
                     ) + // is symmetric
             zCovMat_
             );

the error occurs with the outside prod in indicated line. Jxi and Jxt are mat, and Pti_ is a sym_mat_range (typedefs usind double) :

error: call of overloaded 'prod(jblas::mat&, jblas::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 = 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<double, boost::numeric::ublas::basic_row_major<size_t, ptrdiff_t>, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >]
/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 = jblas::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<double, boost::numeric::ublas::basic_row_major<size_t, ptrdiff_t>, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >]

On Tuesday 06 September 2005 08:02, Thomas Lemaire wrote:
> Dear list,
>
> I have a strange compilation problem with this line (sym_mat and mat are
> typedef) :
>
> P -= prod<sym_mat>(prod<mat>(K,H_), P);
>
> P is a sym_mat, K is a mat and H_ a mat_range... I have been using this for
> a while with boost cvs/gcc3.3 and it compiled well...
> 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_):
>
> error: call of overloaded 'prod(jblas::mat&, const
> boost::numeric::ublas::matrix_range<jblas::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 = jblas::mat, E2 =
> boost::numeric::ublas::matrix_range<jblas::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 = jblas::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<jblas::mat>]

-- 
thomas