Linear Algebra and the C Language/a0kr
Install and compile this file in your working directory.
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
double **X_m0_mR(
double **Zer
)
{
int r;
int c;
for ( r=R1; r<Zer[R_SIZE][C0]; r++)
for ( c=C1; c<Zer[C_SIZE][C0]; c++)
Zer[r][c] = 0.;
return(Zer);
}
/* ------------------------------------ */
/* ------------------------------------ */
int main(void)
{
double **A = r_mR(i_mR(R5,C6), 9);
clrscrn();
printf(" A:");
p_mR(A, S4,P0,C6);
printf(" m0_mR(A);");
p_mR(m0_mR(A), S4,P0,C6);
stop();
f_mR(A);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Screen output example:
A:
+2 -1 -6 +2 -7 -6
-6 +6 +7 +8 +9 -7
+9 -9 -2 +6 +1 -6
+2 +5 -7 -1 -6 +6
+3 +3 +2 -9 +6 -5
m0_mR(A);
+0 +0 +0 +0 +0 +0
+0 +0 +0 +0 +0 +0
+0 +0 +0 +0 +0 +0
+0 +0 +0 +0 +0 +0
+0 +0 +0 +0 +0 +0
Press return to continue.