/* 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, 1,1, 104, 51, 10, 17,
0,1, 0,1, -46,153, 178, 51,
0,1, 0,1, -91,153, -43,102,
};
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, 0,1, 1, 1, 0,1,
0,1, 0,1, 91,153, 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,1, 0, 1, 0,1,
0,1, 0,1, 1*(-153),46* 1, 0,1,
0,1, 0,1, 91*(-153),46*153, 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;
}