-
大小: 3KB文件类型: .cpp金币: 1下载: 0 次发布日期: 2021-06-07
- 语言: C/C++
- 标签: Gauss-Seidel 迭代 SOR迭代 c++程序
资源简介
数值计算方法中关于Gauss-Seidel 迭代和SOR迭代的通用c++程序
代码片段和文件信息
/*数值计算方法lab6
Gauss_Seidel 迭代和松弛迭代通用程序
刘波 pb07210511
*/
#include
#include
#include
using namespace std;
const int N=9;
const double epsilon=0.00000001;
int main()
{
double array[N][N]={
{31-13000-10000}
{-1335-90-110000}
{0-931-1000000}
{00-1079-30000-9}
{000-3057-70-50}
{0000-747-3000}
{00000-304100}
{0000-50027-2}
{000-9000-229}
};
double array1[N]={-1527-230-2012-7710};
double x[N]={000000000};
double w;
int icountermin_counter;
int Gauss_Seidel(double array[][N]double array1[]double x[]);
int SOR(double array[][N]double array1[]double x[]double w);
Gauss_Seidel(arrayarray1x);
cout< for (i=0;i {
cout<<“x[“< }
cout<<“The total steps of SOR Iteration is:“< for( i=1;i<100;i++)
{
counter=SOR(arrayarray1xi/50.0);
if (i==1) {w=i/50.0;min_counter=counter;}
else if (counter }
cout<<“The best w is “<
}
int Gauss_Seidel(double array[][N]double array1[]double x[])
{
double tmax_error=100;
double matrix[N][N]y[N];
int ijcounter=0;
for (i=0;i for (j=0;j matrix[i][j]=array[i][j];
for (i=0;i f
- 上一篇:C语言 机房收费管理系统
- 下一篇:segy读取原码
相关资源
- 用c++做数据曲线和函数曲线
- 编译原理之算符优先算法-迭代法
- 数值分析迭代法解非线性方程组c语言
- Jacobi迭代法和Gauss-Seidel迭代法求解线
- C语言 Newton迭代法解非线性方程组
- C++实现Jacbio和SOR迭代
- 高斯迭代法的c++源程序
- 分割阈值opencv2
- 用C语言实现高斯-赛德尔迭代方法
- 计算方法实验5--埃特金加速迭代算法
- Jacobi迭代法解方程(C语言代码)
- 雅克比迭代法 c语言实现计算方法
- PCL点云-RGBD图像ICP迭代最近点之点云配
- 牛顿迭代法解非线性方程组
- 雅可比迭代C++实现
- 信道容量的迭代算法的C语言实现
- C++实战源码-迭代器的用法
- 汉诺塔问题C++函数迭代解法
- 爱产崽的小母牛函数迭代解法
- c++ 迭代法开平方
- 利用组合惯导实现多帧点云拼接并迭
- 数值分析牛顿迭代、三次样条等五个
- 高斯-赛德尔迭代C++源码
- 计算方法——迭代过程加速
评论
共有 条评论