Mathc matrices/c24l

Un livre de Wikilivres.


Application


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


c02a.c
/* ------------------------------------ */
/*  Save as :  c02a.c                   */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
#define   RA R2
#define   CA C2

#define   RX R2
#define   CX C1
/* ------------------------------------ */
/* ------------------------------------ */
int main(void)
{
double x_B[RX*CX]={
    +1,   
    +2
};

double b[RA*CA]={
    +2, +4,   
    +3, +5
};

double **B   = ca_A_mR(b, i_mR(RA,CA));

double **X_B = ca_A_mR(x_B,  i_mR(RX,CX));
double **X   = mul_mR(B,X_B, i_mR(RX,CX));
 
  clrscrn();
  printf(" B is the change of basis matrix for the basis \"B\" \n\n"
         " B :");
  p_mR(B,S8,P2,C7);  
  
  printf(" x_B :");
  p_mR(X_B,S8,P2,C7);
  
  printf(" Compute x_B in the standard basis :\n\n"
         " x = B*x_B  :");
  p_mR(X,S8,P2,C7);
  stop();
  
  f_mR(B);  
  
  f_mR(X_B);
  f_mR(X); 
  
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


 Nous allons introduire ces valeurs dans les fichiers suivants.
 

Exemple de sortie écran :
 ------------------------------------ 
 B is the change of basis matrix for the basis "B" 

 B :
   +2.00    +4.00 
   +3.00    +5.00 

 x_B :
   +1.00 
   +2.00 

 Compute x_B in the standard basis :

 x = B*x_B  :
  +10.00 
  +13.00 

 Press return to continue.