Linear Algebra and the C Language/a06q
Install and compile this file in your working directory.
/* ------------------------------------ */
/* Save as : c00b.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = r_mR( i_mR(r,r),9.);
double **At = transpose_mR(A, i_mR(r,r));
clrscrn();
printf(" A:");
p_mR(A, S3,P0,C6);
printf(" At:");
p_mR(At, S3,P0,C6);
printf(" det_R(A) = %+.0f\n",det_R(A));
printf(" det_R(At) = %+.0f\n",det_R(At));
f_mR(A);
f_mR(At);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(RC5)+RC1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Screen output example:
A
+1 +3 -3 +2 -5
+6 -2 -1 -4 -1
-5 +8 +6 -6 -4
+4 -9 +1 -2 -2
-3 -1 -7 +3 -7
At
+1 +6 -5 +4 -3
+3 -2 +8 -9 -1
-3 -1 +6 +1 -7
+2 -4 -6 -2 +3
-5 -1 -4 -2 -7
det_R(A) = +22207
det_R(At) = +22207
Press return to continue
Press X return to stop