📄 aaz_inv_ scilab.c
字号:
/* gjid03.c freeware http://groups.yahoo.com/group/mathc/
*/
/* --------------------------------- INCLUDES ------------------------------- */
#include "y_ahfile.h"
/* ------------------------------------- FUNCTION -------------------------- */
/* Do : */
/* */
/* -------------------------------------------------------------------------- */
void DeterA(int n)
{
complexZ z_det;
mZ mA ={n,n*C2,init_mZ(n,n*C2)};
mZ minvA={n,n*C2,init_mZ(n,n*C2)};
/*-------------------------------- PROGRAM ---------------------------------- */
do
{
if(n==4) rnd0_mZ(&mA,2);
if(n==3) rnd0_mZ(&mA,3);
if(n==2) rnd0_mZ(&mA,4);
if(n==1) rnd0_mZ(&mA,5);
z_det = det_Z(&mA);
}while( (!z_det.r) && (!z_det.i));
clrscrn();
printf(" Copy/Past into the scilab windows \n\n");
p_mZ_scilab(&mA,"a");
printf(" inv(a)\n");
getchar();
inverse_mZ(&mA,&minvA);
p_mZ(&minvA);
}
void hello(void)
{
printf("\n Freeware by : xhunga bernard 06000 Nice France.\n");
printf("\n ");
printf("\n inverse(mA) ");
printf("\n *********** \n");
printf("\n The size of mA : 2x2 ... 5x5. \n");
printf("\n ex : \"inverse.exe\" \n");
printf("\n You can choose the size : \n");
printf("\n ex : \"inverse.exe 2\" -> mA 2x2 ");
printf("\n \"inverse.exe 3\" -> mA 3x3 ");
printf("\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 > 3){n=3;}}
else
{ n = rndp_I(3);}
if( n < 1){n=1;}
DeterA(n);
printf("\n\n Press 'X' Return to stop\n");
} while(toupper(getchar())!='X');
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -