Processing math: 100%

 

 

 

Matrix Handling in C/C++

We have N×N matrices A, B and C and we wish to evaluate A=B+C. A=B±Caij=bij±cij, In C/C++ this would be coded like

   for(i=0 ; i < N ; i++) {
      for(j=0 ; j < N ; j++) {
         a[i][j] = b[i][j]+c[i][j]