Calculates the multiplication of a matrix with a vector.