Aller au contenu

Mathc complexes/c072d

Un livre de Wikilivres.


Application


Installer et compiler ces fichiers dans votre répertoire de travail.


c02d.c
/* ------------------------------------ */
/*  Save as :  c02d.c                   */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
void fun(int rc)
{
double **A = r_mZ(i_mZ(rc,rc),9.);
double **B =      i_mZ(rc,rc);

nb_Z z = {2,-3};

int    r = R2;

  clrscrn();
  printf(" A:");
  p_mZ(A, S3,P0, S3,P0, C6);
   
  printf(" The row[%d] of A is muliply by ",r);
  p_Z(z, S1,P0,S1,P0);
  
  printf("\n\n B:");
  p_mZ(mulR_mZ(c_mZ(A,B),z,r), S3,P0, S3,P0, C6);

  printf("  If B is the matrix that  results when \n");
  printf("  a single row of A is muliplied by  \n");
  printf("  a scalar z, then det(B) = z det(A)\n\n");
  printf("   det_Z(B) =");
  p_Z(det_Z(B), S1,P0, S1,P0);
  
  printf("\n z*det_Z(A) =");
  p_Z(mul_Z(z,det_Z(A)), S1,P0, S1,P0);
    
  printf("\n\n   det_Z(A) = ");
  p_Z(det_Z(A), S1,P0, S1,P0);

  f_mZ(A);
  f_mZ(B);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
do
{
  fun(rp_I(RC2)+RC2);
  
} while(stop_w());

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




Exemple de sortie écran :
 A:
 +2 +6i  +2 +6i  -7 -5i 
 -5 +8i  +4 +6i  +4 -1i 
 -3 -7i  +8 -5i  -3 +4i 

 The row[2] of A is muliply by +2-3i 

 B:
 +2 +6i  +2 +6i  -7 -5i 
+14+31i +26 +0i  +5-14i 
 -3 -7i  +8 -5i  -3 +4i 

  If B is the matrix that  results when 
  a single row of A is muliplied by  
  a scalar z, then det(B) = z det(A)

   det_Z(B) =-2315-3645i 
 z*det_Z(A) =-2315-3645i 

   det_Z(A) = +485-1095i 
 Press return to continue
 Press X      to stop