/* belowid01.c freeware [[Email Removed]]
*/
/* --------------------------------- INCLUDES ------------------------------- */
#include "xa_hfile.h"
/* --------------------------------- MAIN ----------------------------------- */
main()
{
double pbA[4][4*TWOCOL]=
{
1,1, 9, 4, 9,2, 3,2,
0,1, -17, 4, -26,3, -5,2,
0,1, -5, 6, -2,1, 3,1,
0,1, -73,12, -13,1, -4,1,
};
matrix mA={4,4*TWOCOL,&pbA[0][0]};
double pbID1[4][ 4*TWOCOL]=
{
1,1, 0, 1, 0,1, 0,1,
0,1, 1, 1, 0,1, 0,1,
0,1, 5, 6, 1,1, 0,1,
0,1, 73,12, 0,1, 1,1,
};
matrix mID1 = {4, 4*TWOCOL,&pbID1[0][0]};
double pbID2[4][ 4*TWOCOL]=
{
1,1, 0, 1, 0,1, 0,1,
0,1, 1*(-4),17* 1, 0,1, 0,1,
0,1, 5*(-4),17* 6, 1,1, 0,1,
0,1, 73*(-4),17*12, 0,1, 1,1,
};
matrix mID2 = {4, 4*TWOCOL,&pbID2[0][0]};
double pbB[4][4*TWOCOL];matrix mB = {4,4*TWOCOL,&pbB[0][0]};
/*-------------------------------- PROGRAM ---------------------------------- */
printf("\n The matrix mA : \n");
printmF(&mA );
printf("\n");
printf(" a) If you copy all the values below the pivot \n ");
printf(" in the identity matrix. And take the opposite.\n ");
printmF(&mID1);
printf("\n");
printf(" b) If you multiply all these values, plus the pivot, \n ");
printf(" by the inverse of the pivot value, of a matrix mA :\n ");
printmF(&mID2);
getchar();
printf(" And now if you multiply this matrix by mA : \n\n");
printf(" a) The pivot equal 1 (1/1)\n");
printf(" b) All the values below the pivot will be equal to 0 (0/1) \n");
printf(" \n");
multmF(&mID2,&mA,&mB);
printmF( &mB);
printf("\n\n\n\n\n\n\n");
printf("\n Press return to continue");
getchar();
return 0;
}