Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem with "prod" function
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-05-16 10:26:48


AMDG

gicatena_at_[hidden] wrote:
> The following code is not working for me:
> ---------------------------------------
> using namespace boost::numeric::ublas;
> matrix<double> m (3, 3);
> matrix<double> o (3, 3);
> for (unsigned i = 0; i < m.size1 (); ++ i)
> for (unsigned j = 0; j < m.size2 (); ++ j)
> {
> m (i, j) = 3 * i + j;
> o (i, j) = 3 * i + j;
> }
> std::cout << m << o << std::endl;
>
> matrix_vector_binary2< matrix_row< matrix<double> >, matrix<double>, double >
> D;
>

Use the correct function object instead of double as the last argument.

> D = prod(row(m, 1),o);
> ---------------------------------------
>
> the error is
>
> 1>c:\program files (x86)
> \boost\boost_1_42\boost\numeric\ublas\matrix_expression.hpp(3809) : error
> C2825: 'F': must be a class or namespace when followed by '::'
> 1> c:\users\alex\desktop\testngage\testngage\testngage.cpp(21) : see
> reference to class template instantiation 'boost::numeric::ublas::
> matrix_vector_binary2<E1,E2,F>' being compiled
> 1> with
> 1> [
> 1> E1=boost::numeric::ublas::matrix_row<boost::numeric::ublas::
> matrix<double>>,
> 1> E2=boost::numeric::ublas::matrix<double>,
> 1> F=double
> 1> ]
> <snip>
>
> where am I getting wrong?
>

In Christ,
Steven Watanabe


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