Aller au contenu

Mathc complexes/00t

Un livre de Wikilivres.

Application

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

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(void)
{
double  a[R4*(C4*C2)]={ 1,0, 9,9, 9,9, 9,9,
                        0,0, 1,0, 9,9, 9,9,
                        0,0, 2,3, 9,9, 9,9,
                        0,0, 4,5, 9,9, 9,9 };	
                        
double id[R4*(C4*C2)]={ 1,0,  0, 0, 0,0, 0,0,
                        0,0,  1, 0, 0,0, 0,0,	
                        0,0, -2,-3, 1,0, 0,0,
                        0,0, -4,-5, 0,0, 1,0 };               
              
double **A  = ca_A_mZ(a, i_mZ(R4,C4));
double **ID = ca_A_mZ(id,i_mZ(R4,C4));

double **IDA = mul_mZ(ID,A,i_mZ(R4,C4));

  clrscrn();
  printf(" Zero under the pivot \n\n");
  printf(" ID : Add a constant c times one row to another.");
  p_mZ(ID, S4,P0, S3,P0, C6);
  printf(" A :");
  p_mZ(A, S4,P0, S3,P0, C6);
  printf(" ID A : ");
  p_mZ(IDA, S4,P0, S3,P0, C6);
   
  f_mZ(A);
  f_mZ(ID);
  f_mZ(IDA);
}
/* ------------------------------------ */
int main(void)
{

  fun();
  
  stop();

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

mettre zéro sous le pivot 2

Exemple de sortie écran :

 Zero under the pivot 

 ID : Add a constant c times one row to another.
  +1 +0i   +0 +0i   +0 +0i   +0 +0i 
  +0 +0i   +1 +0i   +0 +0i   +0 +0i 
  +0 +0i   -2 -3i   +1 +0i   +0 +0i 
  +0 +0i   -4 -5i   +0 +0i   +1 +0i 

 A :
  +1 +0i   +9 +9i   +9 +9i   +9 +9i 
  +0 +0i   +1 +0i   +9 +9i   +9 +9i 
  +0 +0i   +2 +3i   +9 +9i   +9 +9i 
  +0 +0i   +4 +5i   +9 +9i   +9 +9i 

 ID A : 
  +1 +0i   +9 +9i   +9 +9i   +9 +9i 
  +0 +0i   +1 +0i   +9 +9i   +9 +9i 
  +0 +0i   +0 +0i  +18-36i  +18-36i 
  +0 +0i   +0 +0i  +18-72i  +18-72i 

 Press return to continue.