本程序可以用雅可比迭代法,塞德尔迭代法,逐次超松弛法求解线性方程组 已经在visual studio2005中调试通过!
ut<<endl;
while(e>fff)
{
for(i=0;i<n;i++)
{
z[i]=y[i];
nn=0;
for(j=0;j<n;j++)
{
nn=nn+x[i][j]*y[j];
y[i]=(1-w)*z[i]+w*(nn+b[i]);
}
e=fabs(z[0]-y[0]);
if(fabs(z[i]-y[i])>e)
e=fabs(z[i]-y[i]);
if(i==0)
{
cout<<setiosflags(ios::fixed);
cout<<"第"<<setw(3)<<setprecision(3)<<f++<<"次迭代"<<" ";
}
cout<<setiosflags(ios::fixed);
cout<<setw(8)<<setprecision(8)<<y[i]<<" ";
}
cout<<e;
cout<<endl;
if(f>mm)
{
cout<<"迭代次数大于"<<mm<<"次"<<endl;
cout<<"认为方程发散,迭代不收敛"<<endl;
exit(1);
}
}
cout<<endl;
cout<<endl;
cout<<"方程迭代了"<<f-1<<"次,达到你所要求的精度"<<fff<<endl;
cout<<"最后结果为:"<<endl;
cout<<endl;
for(i=0;i<n;i++)
{
cout<<"X"<<"["<<i+1<<"]"<<"="<<y[i];
cout<<endl;
}
exit(1);
}
2.2 Fixed-Point Iteration (1) Introduction A fixed point for a given function g is a number p for which g(p)=p. Root-finding problem: f(p)=...
SEI 软件工程研究所 Xidian University Software School RUP -- Iteration Iteration vs. Disciplines SEI 软件工程研究所 Xidian University Software School RUP -- ...
The main advantage of division by functional iteration is...更多>>A class of high performance division algorithms is functional iteration. Division by ...
4.2 Fixed-Point Iteration_理学_高等教育_教育专区。合工大数值分析中英文课件4.2 Fixed-Point Iteration 4.2.1 Basic Concepts 4.2.2 Convergence Analysis ...
Graeffe iteration was the choice algorithm for solving univariate polynomials in the XIX-th and early XX-th century. In this paper, a new variation of...
Power Iteration Clustering_IT/计算机_专业资料。Power Iteration Clustering Speaker: Xiaofei Di 2010.10.11 Outline ? ? ? ? ? Authors Abstract Backg...
KRYLOV SUBSPACE ITERATION Presented by: Nab Raj Roshyara Master and Ph.D. Student Supervisors: Prof. Dr. Peter Benner, Department of Mathematics, TU ...
Suppose that we approximate the n by n matrix A, of the linear system Ax = b, by the simpler matrix K, then the above sketched iteration process ...
tester10 迭代次数:2 次 场景设臵(一):Sequential+Each Iteration 执行结果: VuGen 中:1 个用户 第一次迭代(Iteration)取值为 tester1 第二次迭代(Iteration)...
The most fundamental and easy to code by a combinator are (simple) iteration and primitive-recursion. Some other schemes that are more general in terms ...
热门文档