Compute matrix inverse using biogo?

999 Views Asked by At

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!

2

There are 2 best solutions below

2
On BEST ANSWER

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
On

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.