Boost logo

Ublas :

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


I also tryed boost cvs with the same result... The problem is the use of the explicit template parameter with prod:

simple example:

typedef matrix<double> mat;
mat A,B;
mat C = prod(A,B); // does compile
mat D = prod<mat>(A,B); // does not compile

I cannot find in the boost doc exact use of the template parameter of prod(), but I am using it to specify type of temporary matrix... (did I found the info on the wiki ?)

If I ommit the template specifier, compiling :
 P -= prod<sym_mat>(prod(K,H), P);

I got the following error:
 /home/thomas/usr/local/boost/include/boost/numeric/ublas/matrix_expression.hpp:4810: instantiated from 'M boost::numeric::ublas::prod(const boost::numeric::ublas::matrix_expression<E2>&, const boost::numeric::ublas::matrix_expression<E2>&) [with M = pipo()::sym_mat, E1 = boost::numeric::ublas::matrix_matrix_binary<boost::numeric::ublas::matrix<double, boost::numeric::ublas::basic_row_major<size_t, ptrdiff_t>, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, boost::numeric::ublas::matrix<double, boost::numeric::ublas::basic_row_major<size_t, ptrdiff_t>, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, boost::numeric::ublas::matrix_matrix_prod<double, double, double> >, E2 = boost::numeric::ublas::symmetric_matrix<double, boost::numeric::ublas::basic_lower<size_t>, boost::numeric::ublas::basic_row_major<size_t, ptrdiff_t>, boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >]'
/home/thomas/jafar/modules/helloworld/src/pipo.cpp:22: instantiated from here
/home/thomas/usr/local/boost/include/boost/numeric/ublas/matrix_expression.hpp:4751: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>'

thomas

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