#include void MatrixVectorMult(double out[], double Val[], int RowPtr[], int Col[], double in[], int m) { int i, k; for (k = 0; k < m; k = k + 1) { out[k] = 0.0; } for (i = 0; i < m; i = i + 1) { for (k = RowPtr[i]; k < RowPtr[i+1]; k = k + 1) { // cout << "k = " << k << ", Col[k] = " << Col[k] // << ", in[Col[k]] = " << in[Col[k]] << endl; // cout << Val[k] << " * " << in[Col[k]] << endl; out[i] = out[i] + Val[k]*in[Col[k]]; } } }