Linear Algebra and the C Language/a081
Install and compile this file in your working directory.
/* ------------------------------------ */
/* Save as: c00c.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define Cb C1
/* ------------------------------------ */
void fun(int r)
{
double **Ab = r_singular_Ab_mR( i_Abr_Ac_bc_mR(r,r,Cb),999);
clrscrn();
printf(" The system is consistent \n\n"
" Ab: Rows of identical A's, with identical b's");
p_mR(Ab, S8,P0,C7);
stop();
clrscrn();
printf(" Copy/Paste into the octave window.\n\n");
p_Octave_mR(Ab,"Ab",P0);
printf("\n rref(Ab,.00000000001)\n\n");
printf(" Ab: The system is consistent");
p_mR(gj_PP_mR(Ab,YES), S10,P4,C7);
is_system_consistent_mR(Ab);
f_mR(Ab);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R5)+R1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Screen output example:
The system is consistent
Ab: Rows of identical A's, with identical b's
+728 +29 +154 +623 -289
+728 +29 +154 +623 -289
-815 -257 +836 +537 +657
+765 -486 -193 +974 +511
Press return to continue.
Copy/Paste into the octave window.
Ab=[
+728,+29,+154,+623,-289;
+728,+29,+154,+623,-289;
-815,-257,+836,+537,+657;
+765,-486,-193,+974,+511]
rref(Ab,.00000000001)
Ab: The system is consistent
+1.0000 +0.0000 -0.0000 +0.7068 -0.3309
+0.0000 +1.0000 -0.0000 -1.2657 -1.5652
+0.0000 -0.0000 +1.0000 +0.9423 -0.0178
+0.0000 -0.0000 +0.0000 +0.0000 +0.0000
Press return to continue
Press X return to stop