Application of the identity matrix II. v05
Submitted By:
xhunga
Rating:





(
Rate It)
/* gjid03.c freeware [[Email Removed]]
*/
/* --------------------------------- INCLUDES ------------------------------- */
#include "xa_hfile.h"
/* --------------------------------- MAIN ----------------------------------- */
main()
{
double pb[3][4*TWOCOL]=
{
2,1, 3,2, 1,1, 3,2,
3,1, -1,4, -1,2, 3,4,
-2,3, 5,3, -1,1, 5,2,
};
matrix m={3,4*TWOCOL,&pb[0][0]};
double pbT3 [3][4*TWOCOL]; matrix mT3 ={3,4*TWOCOL,&pbT3 [0][0]};
double pbT4 [3][4*TWOCOL]; matrix mT4 ={3,4*TWOCOL,&pbT4 [0][0]};
double pbID [3][3*TWOCOL]; matrix mID ={3,3*TWOCOL,&pbID [0][0]};
/*-------------------------------- PROGRAM ---------------------------------- */
copymF(&m,&mT3);
copymF(&m,&mT4);
printf("\n");
printf(" The matrix mA \n");
printmF(&m);
getchar();
printf(" Find mID (below the pivots) \n");
idF4(&mID,&m);
printmF(&mID);
getchar();
printf(" mID * mA \n");
multmF(&mID,&mT3,&m);
printmF(&m);
getchar();
copymF(&m,&mT3);
clrscrn();
printf(" Find mID (above the pivots) \n");
idF4a(&mID,&m);
printmF(&mID);
getchar();
printf(" mID * mA \n");
multmF(&mID,&mT3,&m);
printmF(&m);
getchar();
printf(" Verify with gaussjordanF(); \n");
copymF(&mT4,&m);
gaussjordanF(&m);
printmF(&m);
printf("\n Press return to continue");
getchar();
return 0;
}