so the multiplication works in boost code, but problem is that return type is matrix instead of vector?
well, either write a helper function that converts matrix to vector array. it really depends on how you want or need data to be stored in an array.
surely boost version doesn't return vector because matrix isn't plain array, it's either multiple arrays or multidimensional array or it stores matrix elements somehow else..
But that is for matrix and matrix multiplication |
so what, it still serves as example, rewrite the sample for loop code to multiply vector and matrix instead of 2 matrices.
if boost does not provide what you want then what are you going to do?
using array as a storage for matrix is error prone too, because you need to keep track of how data in vector is stored, is it 2x2, 3x3, or 4x5? how would you know these things?
also, what does such result represent anyway? it's the same as mutiplying 2 vectors, that is you lose matrix information. that's why boost library return matrix instead of vector which makes no mathematical sense.