Linear Algebra and the C Language/a0ky


Install and compile this file in your working directory.

/* ------------------------------------ */
/*  Save as:   c00a.c                   */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
double **X_gj_PP_mR(
double **Ab,
int above                              /* I use this name gj_PP_mR(); */ 
)                                      /* when working in a C file.   */
{
   gj3_T_mR(Ab,above);                 /* I use this name gj3_T_mR(); */
                                       /* when working in an H file.  */
return(Ab);
}
/* ------------------------------------ */
/* ------------------------------------ */
void fun(int r)
{
double **A  =        r_mR(     i_mR(r,r),999.);
double **b  =        r_mR(     i_mR(r,C1),999.);
double **Ab = c_A_b_Ab_mR(A,b, i_Abr_Ac_bc_mR(  r,  r, C1));;
/*                             i_Abr_Ac_bc_mR(RAb, CA, Cb)); */
 
  clrscrn();
  printf(" Copy/Paste into the octave window.\n\n");
  p_Octave_mR(Ab,"Ab",P0);
  printf("\n rref(Ab,.00000000001)\n\n");

  X_gj_PP_mR(Ab,YES);
  
  printf(" See above for the function code: gj_PP_mR();\n\n"
         "  gj_PP_mR(Ab,YES);");
  p_mR(Ab,S10,P4,C7);
  
  
  f_mR(Ab);
  f_mR(b);
  f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
do
{
  fun(R5);


} while(stop_w());

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */

Screen output example:

                                                                                       
 Copy/Paste into the octave window.

 Ab=[
-237,+385,-915,+508,+678,-252;
+101,+989,+771,+799,-340,-791;
-238,-696,-454,-997,+758,-680;
-699,-989,-194,-523,+512,+821;
-817,-528,-978,-684,-521,+218]


 rref(Ab,.00000000001)

 See above for the function code: gj_PP_mR();

  gj_PP_mR(Ab,YES);
   +1.0000    +0.0000    +0.0000    +0.0000    +0.0000    +0.3977 
   +0.0000    +1.0000    +0.0000    +0.0000    +0.0000    -2.3871 
   -0.0000    -0.0000    +1.0000    +0.0000    +0.0000    -0.2510 
   -0.0000    +0.0000    +0.0000    +1.0000    +0.0000    +1.8883 
   -0.0000    -0.0000    +0.0000    +0.0000    +1.0000    -0.6308 


 Press   return to continue
 Press X return to stop