Aller au contenu

Mathc matrices/Fichiers c : pow r

Un livre de Wikilivres.


Application

Installer et compiler ce fichier dans votre répertoire de travail.

c00d.c
/* ------------------------------------ */
/*  Save as :   c00d.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int rc)
{
int        n = 3;
double **A   = r_mR(i_mR(rc,rc),9);
double **A_n =      i_mR(rc,rc);

       clrscrn();
       
       printf(" A : ");
       p_mR(A,S4,P0,C6);
       
       printf(" A^%d :",n);
       p_mR(pow_mR(n,A,A_n),
            S3+n,             /* Try 3 without  */
            P0,
            C6);
  stop();

  clrscrn();
  printf(" Copy/Paste into the octave window.\n\n");  
  p_Octave_mR(A,"A", P0);
  printf("A^%d\n",n);

  p_mR(A_n,S3+n,P0,C6);
    
  f_mR(A);
  f_mR(A_n);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
  
   do{ 
        fun(rp_I(R3)+C1);
        
     }while(stop_w());
        
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Exemple de sortie écran :

 A : 
  -5   -9   -6   -6 
  +8   -5   +7   -2 
  -7   -1   -2   -1 
  +4   -7   -3   -6 

 A^3 :
 +1630  -1056   +876   -639 
  +870  +1755   +823  +1191 
  +345  -1124    +77   -730 
 +1206   +337   +793   +261 

 Press return to continue.