找到矩阵的行列式 [英] Finding the determinant of a matrix

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

问题描述

我无法使这个递归C函数适用于大小超过3行和列的方形矩阵。

I am having trouble making this recursive C function work for square matrices of size greater than 3 rows and columns.

展开 | 选择 | 换行 | 行号

推荐答案

最近的主题中所述,找到由未成年人扩张的决定因素非常缓慢(对于nxn矩阵为O(n!)),有更好的方法,如找到LU分解,即O(n ^ 3)。此外,有许多库可以为您完成所有这些,例如 GSL
As noted in a recent thread, finding the determinant by a minors expansion is very slow (O(n!) for an nxn matrix), there are much better methods like the finding the LU decomposition which is O(n^3). Also, there are a number of libraries which can do all this for you, such as GSL.



最近的线程,通过未成年人扩展找到行列式是非常慢的(对于nxn矩阵来说是O(n!)),有更好的方法,比如找到LU分解为O(n ^ 3)。此外,有许多库可以为您完成所有这些,例如 GSL
As noted in a recent thread, finding the determinant by a minors expansion is very slow (O(n!) for an nxn matrix), there are much better methods like the finding the LU decomposition which is O(n^3). Also, there are a number of libraries which can do all this for you, such as GSL.



我知道还有其他方法,但我想使用这个方法,所以请阅读程序并尝试一下,也许你会知道什么是'错误。

I know there are other methods , but I want to use this one, so please read the program and try it and maybe you''ll know what''s wrong with it.


你的代码有什么问题?它编译?它会给你错误的答案吗?
What kind of problems are you having with your code? Does it compile? Does it give you the wrong answer?


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

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