Mathc matrices/b0a4b
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00b.c |
|---|
/* ------------------------------------ */
/* Save as : c00b.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
double **X_c_c_withR0_mR(
double **A,
int cA,
double **B,
int cB
)
{
int r;
for(r=R0; r<A[R_SIZE][C0]; r++)
B[r][cB] = A[r][cA];
return(B);
}
/* ------------------------------------ */
/* ------------------------------------ */
void fun(int r,int c)
{
double **A = r_mR(i_mR(r,c),99.);
double **B = i_mR(r,c);
clrscrn();
printf(" A:\n");
pall_mR(A, S5,P0,C10);
printf(" B: c_c_withR0_mR(A,C1,B,C2);\n");
pall_mR(c_c_withR0_mR(A,C1,B,C2),S5,P0,C10);
f_mR(A);
f_mR(B);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
int i;
do
{
i = rp_I(R3)+R1;
fun(i,i+C1);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
Copier une colonne avec son indice dans une autre colonne.
Exemple de sortie écran :
A:
+5 +1 +2 +3 +4 +5
+6 -61 -49 -66 -35 -50
+0 -58 -67 -35 +93 -9
+0 +52 +34 +96 -18 -87
+0 +50 -69 -58 -51 +63
B: c_c_withR0_mR(A,C1,B,C2);
+5 +1 +1 +3 +4 +5
+6 +0 -61 +0 +0 +0
+0 +0 -58 +0 +0 +0
+0 +0 +52 +0 +0 +0
+0 +0 +50 +0 +0 +0
Press return to continue
Press X return to stop