Vector Cross Product

Dear all,

I am trying to compute the cross product of an 1x6 column vector "D" with a 6xN matrix "S".

1
2
3
4
vector< vector<float> > D(1, vector<float>(6));
vector< vector<float> > S(6, vector<float>(10)); // Example where N = 10

float cProduct = D*S; // ? 


The last line fails, so I'm wondering how you would get the cross product?

Regards,

Louis
Last edited on
Do you mean the matrix product? Cross product is only defined when both operands are in R3.

C++ vectors are used to store arbitrarily long sequences of objects. They are not analogous to vectors in mathematics and they do not implement any of their operations. You need a linear algebra library, such as Eigen.
Dear helios,

I did mean the matrix product, thanks for the clarification. I'm currently playing around with the Armadillo linear algebra library :)
Topic archived. No new replies allowed.