如何找到大矩阵的行列式 [英] How to find determinant of large matrix

查看:168
本文介绍了如何找到大矩阵的行列式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一些C ++代码,用于找到矩阵的行列式,4x4到8x8。它工作确定,但我的项目需要的矩阵是18x18或更多,并且代码太慢。代码是递归的,但是递归正确的概念来处理一个18×18的矩阵?

I found some C++ code for finding the determinant of matrix, for 4x4 to 8x8. It works ok, but my project needs matrices that are 18x18 or more, and the code is too slow. The code is recursive, but is recursion the right concept to deal with an 18x18 matrix? How else can I find the determinant?

推荐答案

我假设您正在使用 naive方法展开拉普拉斯公式。如果你想获得速度,你可以使用 M no $> $ c>然后计算行列式为:

I assume you're using the naive method of expanding Laplace's formula. If you want to gain in speed, you can decompose your matrix M using LU decomposition (into two lower- and upper-diagonal matrices) which you can achieve with a modified Gauss-Jordan elimination in 2*n^3/3 FLOPS and then calculate the determinant as:

det(M)= det(L)* det c>,这对于三角矩阵只是其对角线条目的乘积。

det(M) = det(L) * det(U), which for triangular matrices is just the product of the entries in their diagonal.

这个过程仍然会比

编辑:您还可以使用 Crout的方法,被广泛实现。

you can also use Crout's method, which is widely implemented.

这篇关于如何找到大矩阵的行列式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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