Mathc matrices/c23a
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
#include "dot_trac.h"
/* ------------------------------------ */
void fun(int r)
{
double **A = r_mR(i_mR(r,r),9.);
double **B = r_mR(i_mR(r,r),9.);
clrscrn();
printf(" A :");
p_mR(A,S3,P0,C6);
printf(" B :");
p_mR(B,S3,P0,C6);
printf(" <A,B> = trace(A^t*B) = trace(B^t*A) \n\n");
printf(" <A,B> = %.0f \n\n", dot_TR_R(A,B));
printf(" <B,A> = %.0f \n\n", dot_TR_R(B,A));
f_mR(A);
f_mR(B);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous calculons le produit scalaire trace(A^t*B).
Exemple de sortie écran :
------------------------------------
A :
+2 +8 -7
+8 -7 -1
+2 -9 -3
B :
-3 -7 -1
-3 -9 +4
-3 -7 -1
<A,B> = trace(A^t*B) = trace(B^t*A)
<A,B> = 40
<B,A> = 40
Press return to continue
Press X to stop