雅克比迭代法c语言程序,急!帮忙看一下这个程序哪错了,要怎么改?#include #define N 4#define delta 0.000001double norm(double x1[N],double x2[N]){ int i,j,n; double a; n=N; double sum[N]; for(i=1;ix1[i]) sum[i]=x2[i]-x1[i
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/27 00:17:22
雅克比迭代法c语言程序,急!帮忙看一下这个程序哪错了,要怎么改?#include #define N 4#define delta 0.000001double norm(double x1[N],double x2[N]){ int i,j,n; double a; n=N; double sum[N]; for(i=1;ix1[i]) sum[i]=x2[i]-x1[i
雅克比迭代法c语言程序,急!
帮忙看一下这个程序哪错了,要怎么改?
#include
#define N 4
#define delta 0.000001
double norm(double x1[N],double x2[N])
{
int i,j,n;
double a;
n=N;
double sum[N];
for(i=1;ix1[i])
sum[i]=x2[i]-x1[i];
else
sum[i]=x1[i]-x2[i];
}
for(a=0,j=1;j
雅克比迭代法c语言程序,急!帮忙看一下这个程序哪错了,要怎么改?#include #define N 4#define delta 0.000001double norm(double x1[N],double x2[N]){ int i,j,n; double a; n=N; double sum[N]; for(i=1;ix1[i]) sum[i]=x2[i]-x1[i
double a[N][N]={ 0,0,0,0,
0.78,-0.02,-0.12,-0.14,
-0.02,0.86,-0.04,0.06,
-0.12,-0.04,0.72,-0.08,
-0.14,0.06,-0.08,0.74},
你定义的N为4,4*4=16,但你初始化有20个值,建议改成4*5,或5*5