📄 aar_gram_r.c
字号:
/* .h freeware http://groups.yahoo.com/group/mathc/ */
/* --------------------------------- INCLUDES ------------------------------- */
#include "v_ahfile.h"
/* ------------------------------------- FUNCTION -------------------------- */
/* Do : */
/* */
/* -------------------------------------------------------------------------- */
void AB(
int a)
{
int n;
int m;
double det;
double pbu [MXR][MXC];mR mu={MXR,MXC,&pbu[0][0]};
double pbv [MXR][MXC];mR mv={MXR,MXC,&pbv[0][0]};
double pbvT[MXR][MXC];mR mvT ={MXR,MXC,&pbvT[0][0]};
mu.rows = a; mu.cols = a;
mv.rows = a; mv.cols = a;
mvT.rows = 1; mvT.cols = a+2;
/*-------------------------------- PROGRAM ---------------------------------- */
do
{
rnd_mR(&mu,3);
det = det_R(&mu);
}while(!det);
clrscrn();
printf(" Consider the vector space R**5 with the Euclidean inner product.\n");
printf(" A Matrix U with linear independent rows vectors, a basis of R**5.\n");
p_mR(&mu);
printf("\n");
p_innerprod_mR(&mu,'u');
getchar();
clrscrn();
printf("\n If we apply the Gram-SchidmRt process on the vectors\n");
printf(" on the matrixU, we obtain a orthogonal basis.\n");
Gram_Schimdt_mR(&mu,&mv);
p_mR(&mv);
printf("\n");
p_innerprod_mR(&mv,'v');
}
void hello(void)
{
printf("\n Freeware by : xhunga bernard 06000 Nice France. ");
printf("\n\n\n\n \n");
printf(" The Gram-SchidmRt process in R**n, \n");
printf(" with the Euclidean inner product. \n");
printf(" ******************************** ");
printf("\n\n\n \n\n\n\n\n\n\n\n ");
printf("\n Distributed by : http://www.simtel.net/ ");
printf("\n ");
printf("\n Press return to continue ");
printf("\n ");
getchar();
}
/* --------------------------------- MAIN ----------------------------------- */
int main(int argc, char *argv[])
{
time_t t;
int n;
/*-------------------------------- PROGRAM ---------------------------------- */
srand(time(&t));
hello();
do
{
if( argc == 2 && atoi(argv[1]))
{ n = atoi(argv[1]); if( n > 6){n=6;}}
else
{ n = rndp_I(6);}
if( n < 2){n=2;}
AB(n);
printf("\n Press 'X' Return to stop");
} while(toupper(getchar())!='X');
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -