|
-
May 15th, 2010, 07:17 PM
#1
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
-
May 15th, 2010, 07:34 PM
#2
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.
-
May 16th, 2010, 03:58 AM
#3
Re: Boost prod function
I tried using matrix <double>, it did not work either
-
May 19th, 2010, 12:00 PM
#4
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
-
May 19th, 2010, 12:19 PM
#5
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.)
-
May 19th, 2010, 01:01 PM
#6
Re: Boost prod function
Thank you so much Lindley!
Problem solved with your help!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|