在c程序中求解6 * 6线性方程组 [英] Solving a 6*6 system of linear equation in c program

查看:89
本文介绍了在c程序中求解6 * 6线性方程组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

系数矩阵的条目是程序中一些计算变量的值。首先我使用LU分解技术。转发一些主要的主要未成年人是单数。然后我使用高斯消除。但是一些对角元素是零。然后我虽然在主程序中我必须解决方程250000次,并且在某些情况下矩阵的大部分元素都是零,然后才使用Gauss Seidel迭代方法,因此改变方程的顺序似乎是不可能的。但再次证明矩阵不是对角占优势的。我听说雅可比的迭代。但这也有一些陷阱。



给我一些建议。

The entries of coefficient matrix are values of some computed variables in the program.First I use LU Decomposition technique.Turns out that some leading principal minors are singular.Then I use Gauss elimination.But some diagonal elements are zero.Then I tried to do pivoting.But changing order of equations seems impossible since in main program I have to solve the equation 250000 times and in some cases most of the elements of matrix are zero.Then I use Gauss Seidel iterative method. But again turns out that the matrix is not diagonally dominant.I hear about Jacobi's iteration. But that also have some pitfall.

Give me some suggestion about that.

推荐答案

你可以当然,使用一些开源数学库,或者学习一些计算数学(在常规线性代数之上),但由于近似浮点的固有问题,问题的计算方面比线性代数要简单得多。数字和其他问题),并由你自己完成。线性方程组解的经典算法是高斯方法: http://www.alexeypetrov.narod。 ru / Eng / C / gauss_about.html [ ^ ]。



-SA
You can either use some open-source mathematics library, or learn some computational mathematics (on top of "regular" linear algebra, of course, but computational aspect of the problem is much less trivial than in linear algebra, due to inherent problems of approximate floating-point numbers and other issues), and do it all by yourself. The classical algorithm for the solution of linear equation system is Gauss's method: http://www.alexeypetrov.narod.ru/Eng/C/gauss_about.html[^].

—SA


正如我之前所回忆的那样。只需尝试使用英特尔MKL库就可以实现此目的。刚开始在此处获取英特尔Parallel Studio XE
As I have previously recalled. Just try using Intel MKL library for that purpose. Just start from obtaining a Intel Parallel Studio XE at here

这篇关于在c程序中求解6 * 6线性方程组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆