±êÌ⣺¹ØÓÚÌØÊâÐÐÁеÄÐÐÁÐʽ
È¡ÏûÖ»¿´Â¥Ö÷
kashiwa_song
Rank: 1
µÈ¡¡¼¶£ºÐÂÊÖÉÏ·
Ìû¡¡×Ó£º2
ר¼Ò·Ö£º0
×¢¡¡²á£º2013-1-1
½áÌûÂÊ£º100%
ÒѽáÌù¡Ì  ÎÊÌâµãÊý£º10 »Ø¸´´ÎÊý£º1 
¹ØÓÚÌØÊâÐÐÁеÄÐÐÁÐʽ
ÓÐÏÂÃæµÄÒ»¸öCÓïÑÔµÄÐÐÁÐʽµÄº¯Êý¡££¨×ª×Ôhttp://www.£©
µ«ÊÇ£¬Èç¹ûÏñµÚÒ»ÐУ¨0£¬1£©£¬µÚ¶þÐУ¨1£¬0£©ÕâÑùµÄ2³Ë2ÊúÁУ¬Ö÷¶Ô½ÇÏߵĵÚÒ»¸öÐеÚÒ»¸öÔªËØ»¯²»³ÉÒ»¸ö·ÇÁãµÄʵÊýÔõôÐ޸ģ¿
³ýÁËÈ˹¤°ÑÊäÈëµÄÐÐÁеÄÐÐ˳Ðò¸Ä±ä¡£Çó´óʦ...
double matrixdet(Matrix *a)
{
    int i,j,k;
    double t,det=1,x;
    if (a->cols!=a->rows)
    {
        printf("\n\n\t¤¹¤ß¤Þ¤»¤ó¡¢ÈëÁ¦¤¬Õý·½ÐÐÁФǤϤʤ¤¤Î¤Ç¡¢égß`¤Ã¤Æ¤¤¤Þ¤¹£¡£¡\n");
        printf("\tEnter¥­©`¤ò´ò¤Ã¤Æ¥×¥í¥°¥é¥à¤ò½KÁˤ·¤Æ¤¯¤À¤µ¤¤¡£\n");
        getch();
        return -1;
    }
    else
    {
        for (i=0;i<a->rows;i++)
            for (k=0;k<a->rows;k++)
            {
                if (k!=i)
                {
                    if (a->m[i][i]!=0)
                    {
                        t = a->m[k][i]/a->m[i][i];
                        for (j=0;j<(2*a->rows);j++)
                        {
                            x = a->m[i][j]*t;
                            a->m[k][j] = a->m[k][j] - x;
                        }
                    }
                    else
                        return 0;
                }
            }
            for (i=0;i<a->rows;i++)
                det = det*a->m[i][i];
            return (det);
    }
}
ËÑË÷¸ü¶àÏà¹ØÖ÷ÌâµÄÌû×Ó: ÌØÊâ¡¡Matrix¡¡double¡¡ÐÐÁÐʽ¡¡
2013-01-09 13:45
kashiwa_song
Rank: 1
µÈ¡¡¼¶£ºÐÂÊÖÉÏ·
Ìû¡¡×Ó£º2
ר¼Ò·Ö£º0
×¢¡¡²á£º2013-1-1
µÃ·Ö:0 
»Ø¸´ 3Â¥ zklhp
ÇóÐÞ¸Ä...
2013-01-11 09:40



²ÎÓëÌÖÂÛÇëÒƲ½Ô­ÍøÕ¾Ìù×Ó£ºhttps://bbs.bccn.net/thread-395866-1-1.html




¹ØÓÚÎÒÃÇ | ¹ã¸æºÏ×÷ | ±à³ÌÖйú | Çå³ýCookies | TOP | ÊÖ»ú°æ

±à³ÌÖйú °æȨËùÓУ¬²¢±£ÁôËùÓÐȨÀû¡£
Powered by Discuz, Processed in 0.046486 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved