线程“main”中的异常java.lang.RuntimeException:Matrix是单数 [英] Exception in thread "main" java.lang.RuntimeException: Matrix is singular

查看:752
本文介绍了线程“main”中的异常java.lang.RuntimeException:Matrix是单数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想在JAMA文档之后创建一个3x3矩阵的逆矩阵。但每次它给我以下错误 -

I'm just trying to create an inverse matrix of a 3x3 matrix following JAMA documentation. But every time it's giving me the following error -

线程main中的异常java.lang.RuntimeException:Matrix是单数

在这方面有谁可以帮助我?

Can anyone help me in this regard?

推荐答案

如果你可以计算矩阵的行列式,你会发现它是零(或接近它)。

If you can calculate the determinant of your matrix, you'll find that it's zero (or close to it).

您可以通过检查来判断。如果一行与另一行成比例,则矩阵不可逆。

You might be able to tell by inspection. If one row is proportional to another, your matrix is not invertible.

3x3很容易手动反转。试一试,看看它出错了。

3x3 is easy enough to invert by hand. Try it and see where it goes wrong.

尝试使用SVD解决方案。它会告诉你矩阵的零空间是什么。

Try a SVD solution. It'll tell you what the null space for your matrix is.

这篇关于线程“main”中的异常java.lang.RuntimeException:Matrix是单数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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