📄 aar_octave_scilab_inv.c
字号:
/* gjid03.c freeware http://groups.yahoo.com/group/mathc/
*/
/* --------------------------------- INCLUDES ------------------------------- */
#include "v_ahfile.h"
/* ------------------------------------- FUNCTION -------------------------- */
/* Do : */
/* */
/* -------------------------------------------------------------------------- */
void invB(int n)
{
double det;
double x;
mR mA ={n,n,init_mR(n,n)};
mR minvA={n,n,init_mR(n,n)};
/*-------------------------------- PROGRAM ---------------------------------- */
x= 3;
if(n==5){x= 5;}
if(n==4){x= 10;}
if(n==3){x= 15;}
if(n==2){x= 100;}
if(n==1){x=1000;}
do
{
rnd_mR(&mA,x);
det = det_R(&mA);
}while(!det);
clrscrn();
printf(" Copy/Past into the octave/scilab windows \n\n");
p_mR_octave(&mA,"a");
printf(" inv(a)\n\n\n");
inverse_mR (&mA,&minvA);
p_mR( &minvA);
free(mA.pb);
free(minvA.pb);
}
void hello(void)
{
printf("\n Freeware by : xhunga bernard 06000 Nice France.\n");
printf("\n ");
printf("\n Find the inverse of mA ");
printf("\n ********************** \n");
printf("\n The size of mA : 1x1 ... 6x6. \n");
printf("\n ex : \"invf.exe\" \n");
printf("\n You can choose the size : \n");
printf("\n ex : \"invf.exe 2\" -> mA 2x2 ");
printf("\n \"invf.exe 3\" -> mA 3x3 ");
printf("\n \"invf.exe 4\" -> mA 4x4 ");
printf("\n ");
printf("\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 < 1){n=1;}
invB(n);
printf("\n Press 'X' Return to stop");
} while(toupper(getchar())!='X');
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -