
It is convenient to have routines to initialize a matrix either to a zero matrix or the identity matrix.
The function for setting a real matrix to the zero matrix is Zero_Matrix( ) and the function for setting a complex matrix to the zero matrix is Zero_CMatrix( ). The function for setting a square n×n real matrix to the identity matrix is Identity_Matrix( ) and the function or setting a square n×n complex matrix to the identity matrix is Identity_CMatrix( ). There are also special routines for setting a matrix to a identity matrix stored in upper triangular form or lower triangular form.
 void Zero_Matrix( double *A, int nrows, int ncols )
Set the nrows×ncols matrix A to the zero matrix, i.e. A[i] [j] = 0 for all i, j.
 void Identity_Matrix( double *A, int n )
Set the square n×n matrix A to the identity matrix, i.e. A[i][j] = 0 if i ≠ j and A[i][i] = 1 otherwise.
 void Identity_Matrix_ut( double *A, int n )
Set the square n×n matrix A stored in upper triangular form to the identity
matrix. The array A must be declared at least n (n+1) / 2 in the calling routine.
 void Identity_Matrix_lt( double *A, int n )
Set the square n×n matrix A stored in lower triangular form to the identity
matrix. The array A must be declared at least n (n+1) / 2 in the calling routine.
 void Zero_CMatrix( double complex *A, int nrows, int ncols )
Set the nrows×ncols complex matrix A to the zero matrix, i.e. A[i] [j] = 0+0i for all i, j.
 void Identity_CMatrix( double complex *A, int n )
Set the square n×n complex matrix A to the identity matrix, i.e. A[i][j] = 0+0i if i ≠ j and A[i][i] = 1+0i otherwise.
 void Identity_CMatrix_ut( double complex *A, int n )
Set the square n×n complex matrix A stored in upper triangular form to the identity
matrix. The array A must be declared at least n (n+1) / 2 in the calling routine.
 void Identity_CMatrix_lt( double complex *A, int n )
Set the square n×n complex matrix A stored in lower triangular form to the identity
matrix. The array A must be declared at least n (n+1) / 2 in the calling routine.
 The file, zero_matrix.c, contains the version of Zero_Matrix( ) written in C.
 The file, identity_matrix.c, contains the version of Identity_Matrix( ) written in C.
 The file, identity_matrix_ut.c, contains the version of Identity_Matrix_ut( ) written in C.
 The file, identity_matrix_lt.c, contains the version of Identity_Matrix_lt( ) written in C.
 The file, zero_cmatrix.c, contains the version of Zero_Matrix( ) written in C.
 The file, identity_cmatrix.c, contains the version of Identity_CMatrix( ) written in C.
 The file, identity_cmatrix_ut.c, contains the version of Identity_CMatrix_ut( ) written in C.
 The file, identity_cmatrix_lt.c, contains the version of Identity_CMatrix_lt( ) written in C.
 The file, testzeromatrix_C.c, contains a test program of Zero_Matrix( ). This test program requires the file zero_matrix.c listed above.
 The file, ZeroMatrix_CTest.txt, contains the results of the test program testzeromatrix_C.c.
 The file, testzeromatrix_C.sh, contains the shell script used to compile, link, and execute the test program testzeromatrix_C.c.
 The file, testidentity_C.c, contains a test program of Identity_Matrix( ). This test program requires the file identity_matrix.c listed above.
 The file, IdentityMatrixTests_C.txt, contains the results of the test program testidentity_C.c.
 The file, testidentity_C.sh, contains the shell script used to compile, link, and execute the test program testidentity_C.c.
 The file, testidentity_ut_C.c, contains a test program of Identity_Matrix_ut( ). This test program requires the file identity_matrix_ut.c listed above.
 The file, IdentityMatrixUTTests_C.txt, contains the results of the test program testidentity_ut_C.c.
 The file, testidentity_ut_C.sh, contains the shell script used to compile, link, and execute the test program testidentity_ut_C.c.
 The file, testidentity_lt_C.c, contains a test program of Identity_Matrix_lt( ). This test program requires the file identity_matrix_lt.c listed above.
 The file, IdentityMatrixLTTests_C.txt, contains the results of the test program testidentity_lt_C.c.
 The file, testidentity_lt_C.sh, contains the shell script used to compile, link, and execute the test program testidentity_lt_C.c.
 The file, testzerocmatrix.c, contains a test program of Zero_CMatrix( ). This test program requires the file zero_cmatrix.c listed above.
 The file, ZeroCMatrixTest.txt, contains the results of the test program ttestzerocmatrix.c.
 The file, testzerocmatrix.sh, contains the shell script used to compile, link, and execute the test program testzerocmatrix.c.
 The file, testidentitycmatrix.c, contains a test program of Identity_CMatrix( ). This test program requires the file identity_cmatrix.c listed above.
 The file, IdentityCMatrixTests.txt, contains the results of the test program testidentitycmatrix.c.
 The file, testidentitycmatrix.sh, contains the shell script used to compile, link, and execute the test program testidentitycmatrix.c.
 The file, testidentitycmatrixut.c, contains a test program of Identity_CMatrix_ut( ). This test program requires the file identity_cmatrix_ut.c listed above.
 The file, IdentityCMatrixUTTests.txt, contains the results of the test program testidentitycmatrixut.c.
 The file, testidentitycmatrixut.sh, contains the shell script used to compile, link, and execute the test program testidentitycmatrixut.c.
 The file, testidentitycmatrixlt.c, contains a test program of Identity_CMatrix_lt( ). This test program requires the file identity_cmatrix_lt.c listed above.
 The file, IdentityCMatrixLTTests.txt, contains the results of the test program testidentitycmatrixlt.c.
 The file, testidentitycmatrixlt.sh, contains the shell script used to compile, link, and execute the test program testidentitycmatrixlt.c.
 The file, testzeromatrix_A.c, contains a test program of Zero_Matrix( ). This test program requires the file zero_matrix.asm listed above.
 The file, ZeroMatrix_ATest.txt, contains the results of the test program testzeromatrix_A.c.
 The file, testzeromatrix_A.sh, contains the shell script used to compile, link, and execute the test program testzeromatrix_A.c.
 The file, testidentity_A.c, contains a test program of Identity_Matrix( ). This test program requires the file identity_matrix.asm listed above.
 The file, IdentityMatrixTests_A.txt, contains the results of the test program testidentity_A.c.
 The file, testidentity_A.sh, contains the shell script used to compile, link, and execute the test program testidentity_A.c.
 The file, testidentity_ut_A.c, contains a test program of Identity_Matrix_ut( ). This test program requires the file identity_matrix_ut.asm listed above.
 The file, IdentityMatrixUTTests_A.txt, contains the results of the test program testidentity_ut_A.c.
 The file, testidentity_ut_A.sh, contains the shell script used to compile, link, and execute the test program testidentity_ut_A.c.
 The file, testidentity_lt_A.c, contains a test program of Identity_Matrix_lt( ). This test program requires the file identity_matrix_lt.asm listed above.
 The file, IdentityMatrixLTTests_A.txt, contains the results of the test program testidentity_lt_A.c.
 The file, testidentity_lt_A.sh, contains the shell script used to compile, link, and execute the test program testidentity_lt_A.c.
Routine  3 × 4 Matrix 
zero_matrix.c  105 
zero_matrix.asm  38 

Routine  3 × 3 Matrix 
identity_matrix.c  66 
identity_matrix.asm  28 

Routine  2 × 2 Matrix  3 × 3 Matrix  4 × 4 Matrix 
identity_matrix_ut.c  19  47  85 
identity_matrix_ut.asm  0^{*}  19  38 

^{*}Time within time variation of calling time stamp. 
Routine  2 × 2 Matrix  3 × 3 Matrix  4 × 4 Matrix 
identity_matrix_lt.c  19  47  85 
identity_matrix_lt.asm  0^{*}  19  38 

^{*}Time within time variation of calling time stamp. 
