Linear Algebra and the C Language/a0ez


Install and compile this file in your working directory.

/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define RCA   RC4
#define ARRAY A5
/* ------------------------------------ */
void fun(void)
{
double **A[ARRAY]; 

int i; 
                      
  for(i = A0; i < ARRAY; i++)
     { 
	   clrscrn();	
	    
       A[i] = rE_mR(i_mR(RCA,RCA),999,+1.E-3);
    
       printf(" Standard notation.\n\n"
              " Copy/Paste into the octave window.\n\n");
       
       pAi_Octave_mR(A[i], "A",i, P3);
       printf(" expm (A%d)\n\n\n",i);
       
       stop();
      }  

  for(i = A0; i < ARRAY; i++)
  
      f_mR(A[i]);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
    fun();
    
} while(stop_w());

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

Screen output example:

                                                                                       
 Standard notation.

 Copy/Paste into the octave window.

 A0=[
-0.914,-0.157,-0.213,+0.882;
-0.080,+0.493,+0.430,-0.284;
-0.098,+0.588,+0.256,+0.862;
-0.349,-0.054,+0.930,-0.137]

 expm (A0)


 Press return to continue. 


 Standard notation.

 Copy/Paste into the octave window.

 A1=[
+0.351,-0.523,-0.374,+0.386;
-0.496,-0.091,-0.722,+0.487;
+0.928,-0.193,+0.049,+0.314;
+0.023,-0.546,+0.880,+0.797]

 expm (A1)


 Press return to continue. 


 Standard notation.

 Copy/Paste into the octave window.

 A2=[
-0.693,+0.950,+0.164,+0.239;
-0.932,-0.741,-0.141,-0.475;
-0.302,+0.970,+0.877,+0.466;
-0.651,-0.852,+0.131,-0.200]

 expm (A2)


 Press return to continue.