dec C++ 高斯消去法問題

Home Home
引用 | 編輯 jjjj0002000
2010-06-17 21:50
樓主
推文 x0
題目: 2a-3b+2c=5
-4a+2b-6c=14
2a+2b+4c=8 ,求解a,b,c的值
程式碼:
#include <cstdlib>
#include <iostream>
#include <math.h>
#define EPS 1e-10
#define INDEX(i,j,n) (i*n+j)
using namespace std;
int gelimd(double *a, double *b, double *x, int n)
{
double tmp,pvt,t;
int i,j,k,itmp;

for (i=0;i<n;i++)
{
pvt = a;
if (fabs(pvt) < EPS)
{
for (j=i+1;j<n;j++)
{
if(fabs( ..

訪客只能看到部份內容,免費 加入會員



獻花 x0
引用 | 編輯 tropical72
2010-11-14 03:26
1樓
  
http://edisonshih.pixnet.net/blog/post/30287135
http://edisonshih.pixnet.net/blog/post/30287155

考慮一下上面的連結, 第二篇用到的函數都在第一篇裡面

獻花 x0