📄 aaz_gram_r.c
字号:
/* .h freeware http://groups.yahoo.com/group/mathc/ */
/* --------------------------------- INCLUDES ------------------------------- */
#include "y_ahfile.h"
/* ------------------------------------- FUNCTION -------------------------- */
/* Do : */
/* */
/* -------------------------------------------------------------------------- */
void AB(
int a)
{
int n;
int m;
complexZ det;
double pbu [MXR][MXC];mZ mu={MXR,MXC,&pbu[0][0]};
double pbv [MXR][MXC];mZ mv={MXR,MXC,&pbv[0][0]};
mu.rows = a; mu.cols = a*C2;
mv.rows = a; mv.cols = a*C2;
/*-------------------------------- PROGRAM ---------------------------------- */
do
{
rnd_mZ(&mu,3);
det = det_Z(&mu);
}while( (!det.r) && (!det.i));
clrscrn();
printf(" Consider the vector space C**n with the Euclidean inner product.\n");
printf(" A Matrix U with linear independent rows vectors, a basis of R**5.\n");
p_mZ(&mu);
printf("\n");
p_innerprod_r_mZ(&mu,'u');
getchar();
clrscrn();
printf("\n If we apply the Gram-Schimdt process on the vectors\n");
printf(" on the matrixU, we obtain a orthogonal basis.\n");
Gram_Schimdt_mZ(&mu,&mv);
p_mZ(&mv);
printf("\n");
p_innerprod_r_mZ(&mv,'v');
}
void hello(void)
{
printf("\n Freeware by : xhunga bernard 06000 Nice France. ");
printf("\n\n\n\n \n");
printf(" The Gram-Schimdt process in C**n, \n");
printf(" with the Euclidean inner product. \n");
printf(" ******************************** ");
printf("\n\n\n \n\n\n\n\n\n\n\n ");
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 > 4){n=4;}}
else
{ n = rndp_I(4);}
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 + -