Mathc matrices/a234
Installer et compiler ces fichiers dans votre répertoire de travail.
c01a.c |
---|
/* ------------------------------------ */
/* Save as : c01a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **u = r_mR( i_mR(r,C1),9.);
double **v = r_mR( i_mR(r,C1),9.);
clrscrn();
printf(" u :");
p_mR(u,S3,P0,C6);
printf(" v :");
p_mR(v,S3,P0,C6);
printf(" Cauchy-Schwarz : |<u,v>| <= ||u|| ||v|| \n\n"
" |<u,v>| = %+.0f\t ||u|| ||v|| = %+.0f\n\n\n"
" |<u,v>|\t <= ||u|| ||v|| \n"
" %+.0f\t <= %+.0f \n",
fabs( dot_R(u, v)),
norm_R(u) * norm_R(v),
fabs( dot_R(u, v)),
norm_R(u) * norm_R(v) );
f_mR(u);
f_mR(v);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Cauchy-Schwarz : |<u,v>| <= ||u|| ||v||
Exemple de sortie écran :
---------------------------
u :
+7
+4
+9
+6
-4
v :
+8
-2
+6
+9
+7
Cauchy-Schwarz : |<u,v>| <= ||u|| ||v||
|<u,v>| = +128 ||u|| ||v|| = +215
|<u,v>| <= ||u|| ||v||
+128 <= +215
Press return to continue
Press X return to stop