-
Boost prod function
I have a weird problem with the "prod" function of the Boost library. I am trying to multiply a vector with a matrix and get the result vector but I am failing
The code is:
Code:
matrix <double> m_matrix1(2,2);
matrix <double> m_matrix2(2,2);
std::vector <double> m_result;
m_result = prod(row(m_matrix1, 1), m_matrix2);
The error is a long log starting with
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)
Can someone help me or link a simple and understandeable guide for the boost library? I already read the official documentation and could not solve
-
Re: Boost prod function
There's a big difference between a uBLAS vector, which is a mathematical construct, an a std::vector, which is merely a container representing a dynamic array.
-
Re: Boost prod function
I tried using matrix <double>, it did not work either
-
Re: Boost prod function
Bump this topic: I need to solve this problem.
How can I multiply a matrix <double> single row with a complete matrix <double> to obtain an accessible vector of values with uBLAS?
Someone help me please! Links to helping papers are well-accepted since boost mailing list is not helping
-
Re: Boost prod function
You had the right idea before, but you were trying to use a std::vector where you needed a boost::numeric::ublas::vector.
(Note that row(matrix, i) returns a vector, so the matrix/vector form of prod() will be used which returns a vector.)
-
Re: Boost prod function
Thank you so much Lindley!
Problem solved with your help!!