Linear Algebra and the C Language/a0dk


Install and compile this file in your working directory.

/* ------------------------------------ */
/*  Save as :  c00b.c                   */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define   RCA C3
/* ------------------------------------ */
int main(void)
{
double a[RCA*RCA]={
+9,+9,+8,
+9,+6,+2,
+8,+2,+3
};

double **A         = ca_A_mR(a, i_mR(RCA,RCA));
double **EigsValue = eigs_mR(A, i_mR(RCA,C1)); 

  clrscrn();
  printf(" Copy/Paste into the octave windows \n\n");
  p_Octave_mR(A,"a",P0);
  printf(" EigenValues  = eigs (a,%d) \n\n",RCA);
   
  printf(" EigsValue :");
  p_mR(EigsValue,S13,P6,C1);
  stop();   
   
  f_mR(A);
  f_mR(EigsValue);

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


Screen output example:

                                                                                       
 Copy/Paste into the octave windows 

 a=[
+9,+9,+8;
+9,+6,+2;
+8,+2,+3]

 EigenValues  = eigs (a,3) 

 EigsValue :
   +19.969678 
    -4.396009 
    +2.426331 

 Press return to continue.