Mathc matrices/c102a
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
d01.c |
---|
/* ------------------------------------ */
/* Save as : d01.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
void XX_put_zeroR_mR(
double **Ab,
double **Ab_free
)
{
int r;
int c;
int r_free= R1;
int t=0;
for (r=R1; r<Ab[R_SIZE][C0]; r++)
for (c=r+t; c<Ab[C_SIZE_A][C0]; c++)
if(Ab[r][c]> ERROR_E)
{
c_r_mR(Ab,r,Ab_free,r_free);
c = Ab[C_SIZE_A][C0];
r_free++;
}
else
{
r_free++;
t++;
}
}
/* ------------------------------------ */
/* ------------------------------------ */
int main(void)
{
double ab[R4*C7]={
1, 0, 0, 0, 0, 0, 0,
0, 2, 3, 4, 5, 6, 0,
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
double **Ab = ca_A_mR(ab,i_Abr_Ac_bc_mR(R4,C6,C1));
double **A = c_Ab_A_mR(Ab,i_mR(R4,C6));
double **b = c_Ab_b_mR(Ab,i_mR(R4,C1));
double **Ab_free = i_Abr_Ac_bc_mR(csize_A_R(Ab),csize_A_R(Ab),C1);
clrscrn();
printf(" Ab :");
p_mR(Ab,S8,P0,C7);
XX_put_zeroR_mR(Ab,Ab_free);
printf(" Ab_free : put_zeroR_mR(); ");
p_mR(Ab_free,S8,P0,C8);
stop();
f_mR(Ab);
f_mR(b);
f_mR(A);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
Ab :
+1 +0 +0 +0 +0 +0 +0
+0 +2 +3 +4 +5 +6 +0
+0 +0 +0 +0 +0 +0 +0
+0 +0 +0 +0 +0 +0 +0
Ab_free : put_zeroR_mR();
+1 +0 +0 +0 +0 +0 +0
+0 +2 +3 +4 +5 +6 +0
+0 +0 +0 +0 +0 +0 +0
+0 +0 +0 +0 +0 +0 +0
+0 +0 +0 +0 +0 +0 +0
+0 +0 +0 +0 +0 +0 +0
Press return to continue.