I need a function that multiply a matrix and a vector (Matrix*vector)
It takes in a matrix A and a vector B, with int describing the dimensions. Somehow it isn't running correctly. Any help??
void Multiply(double *res, double **A, double *B, int ARows, int ACols, int BRows)
{
if (ACols !=BRows)
{
return;
}
for (int i = 0; i < ACols; i++)
{
res[i] = 0;
for (int j = 0; j < BRows; j++)
{
res[i] += A[i][j]*B[j];
}
}
}