摘 要: 为了实现科技和工程技术领域中对有限元线性方程组的快速求解,首先需判断该线性方程组所对应的行列式的值是否为零。若该值不为零,则线性方程组有惟一确定的解;否则,线性方程组的解不惟一。利用行列式的基本性质、代数余子式、定理,采用递归程序设计方法,设计了两种算法,用以求解行列式的值;并从运算精度和运行效率上比较了这两种算法,得出了这两种算法各自的适用环境。
关键词: 递归程序设计方法; 行列式算法; 运行效率; 线性方程
中图分类号: TN911?34 文献标识码: A 文章编号: 1004?373X(2014)04?0025?03
Comparison between two determinant evaluation algorithms
WEI Hong?chun
(Department of Computer Science, Sichuan University of Arts and Science, Dazhou 635000, China)
Abstract: In order to quickly solve the value offinite element linear equations in the fields of science, technology and engineering, The first step is to judge that the determinants value corresponding to the given linear equations is zero or not. If the value is nonzero, linear equations have only one determinate solution. Otherwise, the answer is not determinate. Two algorithms were designed by using determinant's basic nature, algebraic complement, relevant theorem and recursive programming methods to solve the determinant's value. The two algorithms were compared in calculative accuracy and operational efficiency. The application environment of each algorithm was achieved.
Keywords: recursive programming method; determinant algorithm; operating efficiency; linear equation
线性代数是研究有限维线性空间及其线性变换的基本理论,在科学技术及工程技术领域中应用十分广泛。例如,运筹学中的线性规划;设计集成电路时,对数百万电子元件的仿真;机械工程领域复杂线性方程组的数值求解;工程测量领域中的测量平差等等。其实质是求解n元一次线性方程组。
对于n元一次线性方程组An×nXn×1=Bn×1,若n阶方阵A满秩时,则有X=A-1B。因此,必须首先求解方阵A所对应的行列式。若该值非零,则A存在可逆矩阵A-1,此方程组有惟一解;否则方阵A是奇异的,方程组的解不惟一。本文探讨了对n阶行列式求值的两种算法,并对这两种算法进行了比较。
1 基本理论
对于n阶行列式A,有:
性质1 互换行列式的两行(列),行列式变号。
性质2 把行列式的某一列(行)的各元素乘以同一数后,加到另一列(行)对应的元素上去,行列式不变。
代数余子式: 在n阶行列式A中,把元素aij所在的第i行和第j列划去后(见图1),剩下的n-1阶行列式叫做元素aij的余子式,记作Mij,记:……p>