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 **EigsValue =       eigs_mR(A, i_mR(r,C1)); 

  clrscrn();
  printf(" Copy/Paste into the octave windows \n\n");
  p_Octave_mR(A,"a",P0);
  printf(" EigenValues  = eigs (a,%d) \n\n",r);
   
  printf(" EigsValue :");
  p_mR(EigsValue,S13,P6,C1);   
   
  f_mR(A);
  f_mR(EigsValue);
}
/* ------------------------------------ */
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=[
+940,-936,+256,+423;
-936,+941,-835,-162;
+256,-835,+704,+13;
+423,-162,+13,+3]

 EigenValues  = eigs (a,4) 

 EigsValue :
 +2330.118095 
  +654.325588 
  -290.221547 
  -106.222136 


 Press   return to continue
 Press X return to stop