Mathc matrices/c071b
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c01b.c |
---|
/* ------------------------------------ */
/* Save as : c01b.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
double Xdet_R(
double **A
)
{
double **T = c_mR(A,
i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]));
double deter=1;
int rc;
/* ------------------------------------ */
clrscrn();
printf("p_mR(T,S8,P4,C6);\n\n");
p_mR(T,S10,P4,C6);
stop();
/* ------------------------------------ */
for( rc=C1; rc<T[C_SIZE][C0]; rc++)
{
deter *= pivotbest_mR(T,rc);
/* ------------------------------------ */
clrscrn();
printf("deter *= pivotbest_mR(T,rc);\n\n");
p_mR(T,S10,P4,C6);
stop();
/* ------------------------------------ */
deter *= zero_under_pivot_mR(T,rc);
/* ------------------------------------ */
clrscrn();
printf("deter *= zero_under_pivot_mR(T,rc);\n\n");
p_mR(T,S10,P4,C6);
if(rc+C1<T[C_SIZE][C0]) stop();
/* ------------------------------------ */
}
f_mR(T);
return(deter);
}
/* ------------------------------------ */
/* ------------------------------------ */
void fun(int r)
{
double **A = r_mR(i_mR(R4,R4),999);
clrscrn();
printf(" Copy/Past into the octave window. \n\n");
p_Octave_mR(A,"A",P1);
printf(" det(A)\n\n\n");
stop();
printf("\n\n det(A) = %.4e\n\n\n\n",Xdet_R(A));
f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(RC4)+RC1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
Copy/Past into the octave window.
A=[
-827.0,-63.0,+524.0,-186.0;
-52.0,-187.0,+520.0,-611.0;
-315.0,+90.0,-103.0,-27.0;
-972.0,-875.0,+21.0,+679.0]
det(A)
Press return to continue.
/**********************************/
p_mR(T,S8,P4,C6);
-827.0000 -63.0000 +524.0000 -186.0000
-52.0000 -187.0000 +520.0000 -611.0000
-315.0000 +90.0000 -103.0000 -27.0000
-972.0000 -875.0000 +21.0000 +679.0000
Press return to continue.
/**********************************/
deter *= pivotbest_mR(T,rc);
-972.0000 -875.0000 +21.0000 +679.0000
-52.0000 -187.0000 +520.0000 -611.0000
-315.0000 +90.0000 -103.0000 -27.0000
-827.0000 -63.0000 +524.0000 -186.0000
Press return to continue.
/**********************************/
deter *= zero_under_pivot_mR(T,rc);
+1.0000 +0.9002 -0.0216 -0.6986
+0.0000 -140.1893 +518.8765 -647.3251
+0.0000 +373.5648 -109.8056 -247.0463
+0.0000 +681.4702 +506.1327 -763.7088
Press return to continue.
/**********************************/
deter *= pivotbest_mR(T,rc);
+1.0000 -0.6986 -0.0216 +0.9002
+0.0000 -763.7088 +506.1327 +681.4702
+0.0000 -247.0463 -109.8056 +373.5648
+0.0000 -647.3251 +518.8765 -140.1893
Press return to continue.
/**********************************/
deter *= zero_under_pivot_mR(T,rc);
+1.0000 -0.6986 -0.0216 +0.9002
-0.0000 +1.0000 -0.6627 -0.8923
+0.0000 +0.0000 -273.5305 +153.1213
+0.0000 +0.0000 +89.8748 -717.8083
Press return to continue.
/**********************************/
deter *= pivotbest_mR(T,rc);
+1.0000 -0.6986 +0.9002 -0.0216
-0.0000 +1.0000 -0.8923 -0.6627
+0.0000 +0.0000 -717.8083 +89.8748
+0.0000 +0.0000 +153.1213 -273.5305
Press return to continue.
/**********************************/
deter *= zero_under_pivot_mR(T,rc);
+1.0000 -0.6986 +0.9002 -0.0216
-0.0000 +1.0000 -0.8923 -0.6627
-0.0000 -0.0000 +1.0000 -0.1252
+0.0000 +0.0000 +0.0000 -254.3586
Press return to continue.
/**********************************/
deter *= pivotbest_mR(T,rc);
+1.0000 -0.6986 +0.9002 -0.0216
-0.0000 +1.0000 -0.8923 -0.6627
-0.0000 -0.0000 +1.0000 -0.1252
+0.0000 +0.0000 +0.0000 -254.3586
Press return to continue.
/**********************************/
deter *= zero_under_pivot_mR(T,rc);
+1.0000 -0.6986 +0.9002 -0.0216
-0.0000 +1.0000 -0.8923 -0.6627
-0.0000 -0.0000 +1.0000 -0.1252
-0.0000 -0.0000 -0.0000 +1.0000
det(A) = -1.3553e+11
Press return to continue
Press X to stop