How to invert a 3x3 matrix with each element being a 3x3 matrix?

1.3k Views Asked by At

I am trying to implement a Kalman filter for data fusion in C++. As part of the project, I need to implement a function to calculate the inverse of a 3x3 matrix that has each element being a 3x3 matrix itself. Could you help me solve this problem? I would prefer a solution that requires the least amount of calculations (most CPU efficient).

Also another question, since the Kalman filter depends on the inverse matrix, how should I handle the case when the matrix is not invertible?

Thanks for your helps.

1

There are 1 best solutions below

3
On

You can do a "small matrix" which is each element of a "big matrix", which contains pointers to the "small matrix", so reversing the "big matrix" will take as long as reversing a normal matrix of integers.

Probably this is the fastest algorithm you can do but does it fit in your implementation? How are your matrix declared?