Linear Algebra and the C Language/a0ex


Install and compile this file in your working directory.

/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A   = r_mR(i_mR(r,r),9999.);

  clrscrn();

  printf(" Standard notation.\n\n"
         " Copy/Paste into the octave window.\n\n");
         
  p_Octave_mR(A,"A",P0);
  printf("format short e\n" 
         "inv(A)\n");

  f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
do
{
  fun(rp_I(RC5)+C1);

} while(stop_w());


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

Screen output example:

                                                                                       
 Standard notation.

 Copy/Paste into the octave window.

 A=[
-570,+8349,-7490,+1845;
+1948,+1222,-8851,+1716;
+6919,+4958,-7616,+1618;
+9146,+6233,-717,+7952]

format short e
inv(A)

 Press   return to continue
 Press X return to stop