
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@gmail.com> ha scritto nel messaggio news:4BF000A8.7090903@providere-consulting.com...
AMDG
gicatena@libero.it 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