Linear Algebra and the C Language/a0kv
Install and compile this file in your working directory.
/* ------------------------------------ */
/* Save as : c00c.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
double **X_J_mR(
double **J
)
{
int r;
int c;
isquare_mR(J,"J_mR();","(J)");
m0_mR(J);
for( r=R1,c=csize_R(J); r<J[R_SIZE][C0]; r++, c--)
J[r][c] = 1.;
return(J);
}
/* ------------------------------------ */
/* ------------------------------------ */
int main(void)
{
double **J = J_mR(i_mR(R5,C5));
clrscrn();
printf(" J:");
p_mR(J, S4,P0,C6);
stop();
f_mR(J);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Screen output example:
J:
+0 +0 +0 +0 +1
+0 +0 +0 +1 +0
+0 +0 +1 +0 +0
+0 +1 +0 +0 +0
+1 +0 +0 +0 +0
Press return to continue.