Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dot Product on Matrices and Vectors

I'm trying to get the dot product of two matrices, or vectors. I am using the Accord.net framework but I can't seem to find anything in the documentation that shows how to do this.

Here's an example:

double[] vector1 = { 1, 2, 3 };
double[] vector2 = { 3, 4, 5 };

Now I need to multiply them like so:

(1 * 3) + (2 * 4) + (3 * 5)

I assume this is possible, I just can't find the documentation that shows the method used for this.

like image 855
Torra Avatar asked Jan 11 '23 00:01

Torra


1 Answers

Shouldn't the following code work?

vector1.InnerProduct(vector2);

Documentation url: http://accord-framework.net/docs/html/M_Accord_Math_Matrix_InnerProduct.htm

like image 76
Ulugbek Umirov Avatar answered Jan 22 '23 09:01

Ulugbek Umirov