Linear Algebra and the C Language/a0di


Install and compile this file in your working directory.

/* ------------------------------------ */
/*  Save as:  c00a.c                    */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **A      = rsymmetric_mR(   i_mR(r,r),999.);
double **EValue =       eigs_mR(A, i_mR(r,C1)); 

  clrscrn();
  printf(" Copy/Paste into the octave windows \n\n");
  p_Octave_mR(A,"a",P0);
  printf(" EValue  = eigs (a,%d) \n\n",r);
   
  printf(" EValue:");
  p_mR(EValue,S13,P6,C1);   
   
  f_mR(A);
  f_mR(EValue);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
 fun(rp_I(R4)+R2);

} while(stop_w());

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


Screen output example:

                                                                                       
 Copy/Paste into the octave windows 

 a=[
+653,+226,-348,+195,+643,-599;
+226,-376,+961,+694,-422,+697;
-348,+961,-227,+996,-408,+706;
+195,+694,+996,+764,-801,+894;
+643,-422,-408,-801,+872,+131;
-599,+697,+706,+894,+131,+756]

 EValue  = eigs (a,6) 

 EValue:
 +3149.197249 
 -1465.569289 
 +1120.988394 
  +870.255854 
  -735.776325 
  -497.095883 


 Press   return to continue
 Press X return to stop