Mathc matrices/c12a2
Installer ce fichier dans votre répertoire de travail.
![]() |
ca23.c |
---|
/* ------------------------------------ */
/* Save as : ca23.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double ab[R2*C3]={
-367,+448,+328,
+448,-847,+241
};
int r = R2;
int c = C3;
double **A = ca_A_mR(ab,i_mR(r,c));
double **A_T = i_mR(c,r);
double **SvdValue = i_mR(r,C1);
double **svdU = i_mR(r,r);
double **svdV = i_mR(c,c);
clrscrn();
printf(" Copy/Past into the octave windows \n\n\n");
p_octave_mR(A,"a",1,0);
printf(" [U, S, V] =svd (a,10)\n\n\n");
stop();
clrscrn();
svdU_mR(A,svdU);
svdV_mR(A,svdV);
svduv_mR(transpose_mR(A,A_T),SvdValue);
printf(" svdU :");
p_mR(svdU,S10,P6,C6);
printf(" SvdValue :");
p_mR(SvdValue,S10,P6,C6);
printf(" svdV :");
p_mR(svdV,S10,P6,C6);
stop();
f_mR(A);
f_mR(A_T);
f_mR(SvdValue);
f_mR(svdU);
f_mR(svdV);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
------------------------------------
Copy/Past into the octave windows
a=[
-367,+448,+328;
+448,-847,+241]
[U, S, V] =svd (a,10)
Press return to continue.
------------------------------------
svdU :
-0.501230 +0.865314
+0.865314 +0.501230
SvdValue :
+1115.993416
+416.808944
svdV :
-0.512200 -0.223171 +0.829365
+0.857955 -0.088483 +0.506047
-0.039550 +0.970755 +0.236792
Press return to continue
Press X to stop