Linear Algebra and the C Language/a0nb


Install and compile this file in your working directory.

/* ------------------------------------ */
/*  Save as:   c00f.c                   */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define   RA R3
#define   CA C3
#define   Cb C1
/* ------------------------------------ */
int main(void)
{
double ab[RA*(CA+Cb)]={
 /* Two rows of identical A, with different b */	
    +515,     +546,     -848,     +756,  
    +515,     +546,     -848,     +305,
     
    +628,     -909,     +148,     -501,       
}; 

double **Ab =   ca_A_mR(ab, i_Abr_Ac_bc_mR(RA,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");

  printf(" gj_PP_mR(Ab,YES) :");
  gj_PP_mR(Ab,YES);
  p_mR(Ab, S10,P4,C7);
  
  is_system_consistent_mR(Ab);
  
  stop();

  f_mR(Ab);
  
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */

Screen output example:

 Copy/Paste into the octave window.

 Ab=[
+515,+546,-848,+756;
+515,+546,-848,+305;
+628,-909,+148,-501]


 rref(Ab,.00000000001)

 gj_PP_mR(Ab,YES) :
   +1.0000    +0.0000    -0.8508    +0.0046 
   +0.0000    +1.0000    -0.7506    +0.5543 
   +0.0000    +0.0000    +0.0000  +451.0000 

 This(ese) row(s) are incompatible.
 row 3;  
 The system is inconsistent. 
 I prefer to close the program.
 Press return to continue.