英文:
Compute matrix inverse using biogo?
问题
我正在使用Go语言实现卡尔曼滤波器。在阅读了这个帖子之后,我决定使用biogo进行矩阵运算。然而,从文档中可以看出,biogo并没有提供计算矩阵逆的函数。
有没有人知道其他方法或者知道如何使用biogo提供的函数来计算矩阵的逆?谢谢!
英文:
I'm working on a Kalman filter implementation in Go. After reading this thread, I decided to use biogo for matrix operations. However, it appears from the documentation that biogo doesn't provide a function to calculate the inverse of a matrix.
Does anyone know otherwise or know of an easy way to calculate the inverse using the functions that biogo does provide? Thanks!
答案1
得分: 3
如果你愿意切换到github.com/gonum/matrix包,它提供了一个Inverse函数可以使用。这两个包的接口看起来很相似。
从gonum-dev邮件列表的帖子来看,gonum/matrix是未来的发展方向(并且最终会取代biogo.matrix)。
英文:
If you're willing to switch to the github.com/gonum/matrix package, then it provides an Inverse function that you can use. The interfaces of the two packages appear similar.
From posts on the gonum-dev mailing list, it appears that gonum/matrix is the way forward (and will eventually replace biogo.matrix).
答案2
得分: 1
你应该检查一下是否真的需要逆矩阵,或者你对它的所有操作是否都是为了解决某个线性系统。
例如,如果你的公式是 x=AB^(-1)Cy,那么你可以将它分解为以下步骤:w=Cy,z=solve(B,w),x=Az,完全避免使用逆矩阵。所以如果你的应用是向量输入-向量输出的情况,很可能不需要使用逆矩阵。
英文:
You should check if you really need the inverse matrix or if everything you do with it is solving some linear system.
For instance, if your formula is x=AB^(-1)Cy, then you decompose it into the steps w=Cy, z=solve(B,w), x=Az, completely avoiding the inverse matrix. So if your application is vector in - vector out, chances are that the inverse is not needed.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论