Linear Algebra and the C Language/a0dg
Install and compile this file in your working directory.
/* ------------------------------------ */
/* Save as: c00h.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = rsymmetric_mR( i_mR(r,r),999);
double **EVector = eigs_V_mR(A, i_mR(r,r));
clrscrn();
printf(" A:");
p_mR(A,S5,P0,C6);
printf(" EVector:");
p_mR(EVector,S5,P6,C6);
printf(" det_R(EVector) = %+.0f"
" (The vectors form an orthonormal basis.)\n",det_R(EVector));
f_mR(A);
f_mR(EVector);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R4)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Screen output example:
A:
+985 +314 -890
+314 -290 +578
-890 +578 -944
EVector:
+0.337889 +0.934880 +0.108766
-0.442685 +0.055879 +0.894934
+0.830578 -0.350538 +0.432738
det_R(EVector) = +1 (The vectors form an orthonormal basis.)
Press return to continue
Press X return to stop