Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem with "prod" function
From: Alex34 (gicatena_at_[hidden])
Date: 2010-05-16 12:47:53


Thanks Steven, but I'm a newbie and I've read all the documentation in the
boost website: it did not help me

Can you please tell me what kind of object (I assume is a "functor") I have
to pass to get the code working?

Or alternatively can you provide me a link to study how to write properly
this code? As i've stated, I read the boost library without success

"Steven Watanabe" <watanabesj_at_[hidden]> ha scritto nel messaggio
news:4BF000A8.7090903_at_providere-consulting.com...
> 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