< Mathc matrices
Installer et compiler ces fichiers dans votre répertoire de travail.
![]() |
gj1_rsing.c ' |
---|
/* ------------------------------------ */
/* Save as : gj1_rsing.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **Ab = r_singular_Ab_mR(i_AbR0_mR(r,r,C1),999);
double **A = c_Ab_A_mR(Ab,i_mR(r,r));
double **b = c_Ab_b_mR(Ab,i_mR(r,C1));
clrscrn();
printf(" A :");
p_mR(A,8,0,7);
printf(" b :");
p_mR(r_mR(b,999.),8,0,7); /* I change the value of b */
printf(" Ab :");
p_mR(c_A_b_Ab_mR(A,b,Ab),8,0,7);
getchar();
clrscrn();
printf(" Copy/Past into the octave window.\n\n");
p_octave_mR(Ab,"Ab",1,0);
printf("\n rref(Ab,.00000000001)\n\n");
printf(" gj_mR(Ab) :");
p_mR(gj_mR(Ab),10,5,7);
f_mR(Ab);
f_mR(b);
f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(5)+1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
La matrice A a deux lignes identique mais avec un b différent. Systeme incompatible.
Exemple de sortie écran :
------------------------------------
A :
-579 -827 +750 +922
+252 +44 +966 -283
-757 +432 +474 -519
-579 -827 +750 +922
b :
-743
+946
+958
-501
Ab :
-579 -827 +750 +922 -743
+252 +44 +966 -283 +946
-757 +432 +474 -519 +958
-579 -827 +750 +922 -501
------------------------------------
Copy/Past into the octave window.
Ab=[
-579,-827,+750,+922,-743;
+252,+44,+966,-283,+946;
-757,+432,+474,-519,+958;
-579,-827,+750,+922,-501]
rref(Ab,.00000000001)
gj_mR(Ab) : This(ese) row(s) are incompatible.
row 4;
This(ese) equation(s) was (were)already
defined with an other value(s)
The system is inconsistent.
I prefer to close the program.
Press return to continue.
Cet article est issu de Wikibooks. Le texte est sous licence Creative Commons - Attribution - Partage dans les Mêmes. Des conditions supplémentaires peuvent s'appliquer aux fichiers multimédias.