// Ex514.cc // Sec. 5.1 of lecture // 2D arrays // Multiplication Matrix*Vector f := A * u // with A as 2D array or B as 1D array #include main() { const int NROW=4, MCOL=3; double f[NROW], a[NROW][MCOL] = {4,-1,-0.5, -1,4,-1, -0.5,-1,4, 3,0,-1 }, b[NROW*MCOL] = {4,-1,-0.5, -1,4,-1, -0.5,-1,4, 3,0,-1 }, u[MCOL] = {1,2,3}; int i,j; // matrix times vector : f := A * u for (i=0; i