next up previous contents
Next: Copy matrix Up: Matrix algebra Previous: Zero matrix   Contents

Unit matrix

 
/* sphum - unit matrix */

void sphum(z) double z[3][3]; {int i, j;
for (i=0; i<3; i++) for (j=0; j<3; j++) z[i][j]=0.0;
for (i=0; i<3; i++) z[i][i]=1.0;
}



Pedro Hernandez 2004-05-13