/* 01.c freeware [[Email Removed]]
*/
/* --------------------------------- INCLUDES ------------------------------- */
#include "xa_hfile.h"
/* --------------------------------- MAIN ----------------------------------- */
main()
{
double pbA[4][4*TWOCOL]=
{
2,3, 3,2, 3,1, 1,1,
2,1, 1,4, 1,3, 1,2,
2,3, 2,3, 1,1, 4,1,
3,1, 2,3, 1,2, 1,2
};
matrix mA={4,4*TWOCOL,&pbA[0][0]};
double pbID1[4][ 4*TWOCOL]=
{
1,1, 0,1, 0,1, 0,1,
-2,1, 1,1, 0,1, 0,1,
-2,3, 0,1, 1,1, 0,1,
-3,1, 0,1, 0,1, 1,1,
};
matrix mID1 = {4, 4*TWOCOL,&pbID1[0][0]};
double pbID2[4][ 4*TWOCOL]=
{
1*3,2*1, 0,1, 0,1, 0,1,
-2*3,2*1, 1,1, 0,1, 0,1,
-2*3,2*3, 0,1, 1,1, 0,1,
-3*3,2*1, 0,1, 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;
}