Linear Algebra and the C Language/a0f3
Install and compile this file in your working directory.
/* ------------------------------------ */
/* Save as : c00c.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void p3_mR(
double **A,
int er
)
{
int r;
int c;
for (r = R1; r < A[R_SIZE][C0]; r++)
{
for (c = C1; c < A[C_SIZE][C0]; c++)
printf("%+*.f ",er,A[r][c]);
printf("\n");
}
}
/* ------------------------------------ */
void fun(int r,int c)
{
double **A = r_mR(i_mR(r,c),999);
clrscrn();
printf(" A: p_mR(A, S10,P0,C8);");
p_mR(A, S10,P0,C8);
printf(" A: p3_mR(A, S10 );\n");
p3_mR(A, S10);
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;
}
/* ------------------------------------ */
/* ------------------------------------ */
Control the size of the columns:
Screen output example:
A: p_mR(A, S10,P0,C8);
+324 +488 +919 +20
-391 -411 -739 +829
-159 -443 -637 +135
+86 +358 +807 -820
A: p3_mR(A, S10 );
+324 +488 +919 +20
-391 -411 -739 +829
-159 -443 -637 +135
+86 +358 +807 -820
Press return to continue
Press X return to stop