Linear Algebra and the C Language/a0f1
Install and compile this file in your working directory.
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void p1_mR(
double **A
)
{
int r;
int c;
for (r = R1; r < A[R_SIZE][C0]; r++)
{
for (c = C1; c < A[C_SIZE][C0]; c++)
printf("%f ",A[r][c]);
printf("\n");
}
}
/* ------------------------------------ */
void fun(int r,int c)
{
double **A = r_mR(i_mR(r,c),9);
clrscrn();
printf(" A: p_mR(A, S4,P0,C8);");
p_mR(A, S4,P0,C8);
printf(" A: p1_mR(A); \n");
p1_mR(A);
f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
fun(rp_I(R2)+R2, rp_I(C4)+C2);
while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Without formatting:
Screen output example:
A: p_mR(A, S4,P0,C8);
+5 +1 +6 -2
+7 +8 +6 -3
-6 -3 -5 +1
A: p1_mR(A);
5.000000 1.000000 6.000000 -2.000000
7.000000 8.000000 6.000000 -3.000000
-6.000000 -3.000000 -5.000000 1.000000
Press return to continue
Press X return to stop