|
Boost Users : |
Subject: [Boost-users] Problem with "prod" function
From: gicatena_at_[hidden]
Date: 2010-05-16 06:01:16
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;
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> ]
1>c:\program files (x86)
\boost\boost_1_42\boost\numeric\ublas\matrix_expression.hpp(3809) : error
C2039: 'result_type' : is not a member of '`global namespace''
1>c:\program files (x86)
\boost\boost_1_42\boost\numeric\ublas\matrix_expression.hpp(3809) : error
C2146: syntax error : missing ';' before identifier 'value_type'
1>c:\program files (x86)
\boost\boost_1_42\boost\numeric\ublas\matrix_expression.hpp(3809) : error
C4430: missing type specifier - int assumed. Note: C++ does not support default-
int
1>c:\program files (x86)
\boost\boost_1_42\boost\numeric\ublas\matrix_expression.hpp(3810) : error
C2146: syntax error : missing ';' before identifier 'const_reference'
1>c:\program files (x86)
\boost\boost_1_42\boost\numeric\ublas\matrix_expression.hpp(3810) : error
C4430: missing type specifier - int assumed. Note: C++ does not support default-
int
1>c:\program files (x86)
\boost\boost_1_42\boost\numeric\ublas\matrix_expression.hpp(3810) : error
C4430: missing type specifier - int assumed. Note: C++ does not support default-
int
1>c:\program files (x86)
\boost\boost_1_42\boost\numeric\ublas\matrix_expression.hpp(3811) : error
C2146: syntax error : missing ';' before identifier 'reference'
1>c:\program files (x86)
\boost\boost_1_42\boost\numeric\ublas\matrix_expression.hpp(3811) : error
C4430: missing type specifier - int assumed. Note: C++ does not support default-
int
1>c:\program files (x86)
\boost\boost_1_42\boost\numeric\ublas\matrix_expression.hpp(3811) : error
C4430: missing type specifier - int assumed. Note: C++ does not support default-
int
1>c:\users\alex\desktop\testngage\testngage\testngage.cpp(21) : error C2512:
'boost::numeric::ublas::matrix_vector_binary2<E1,E2,F>' : no appropriate
default constructor available
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> ]
1>c:\users\alex\desktop\testngage\testngage\testngage.cpp(23) : error C2679:
binary '=' : no operator found which takes a right-hand operand of type 'boost::
numeric::ublas::matrix_vector_binary2<E1,E2,F>' (or there is no acceptable
conversion)
1> with
1> [
1> E1=boost::numeric::ublas::matrix_row<boost::numeric::ublas::
matrix<double>>,
1> E2=boost::numeric::ublas::matrix<double>,
1> F=boost::numeric::ublas::matrix_vector_prod2<boost::numeric::
ublas::matrix_row<boost::numeric::ublas::matrix<double>>,boost::numeric::ublas::
matrix<double>,double>
1> ]
1> c:\program files (x86)
\boost\boost_1_42\boost\numeric\ublas\matrix_expression.hpp(4075): could be
'boost::numeric::ublas::matrix_vector_binary2<E1,E2,F> &boost::numeric::ublas::
matrix_vector_binary2<E1,E2,F>::operator =(const boost::numeric::ublas::
matrix_vector_binary2<E1,E2,F> &)'
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> ]
1> while trying to match the argument list '(boost::numeric::ublas::
matrix_vector_binary2<E1,E2,F>, boost::numeric::ublas::matrix_vector_binary2<E1,
E2,F>)'
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> ]
1> and
1> [
1> E1=boost::numeric::ublas::matrix_row<boost::numeric::ublas::
matrix<double>>,
1> E2=boost::numeric::ublas::matrix<double>,
1> F=boost::numeric::ublas::matrix_vector_prod2<boost::numeric::
ublas::matrix_row<boost::numeric::ublas::matrix<double>>,boost::numeric::ublas::
matrix<double>,double>
1> ]
where am I getting wrong?
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