如何反转 3x3 矩阵,每个元素都是 3x3 矩阵?
我正在尝试用 C++ 实现用于数据融合的卡尔曼滤波器。作为项目的一部分,我需要实现一个函数来计算 3x3 矩阵的逆矩阵,该矩阵的每个元素本身就是一个 3x3 矩阵。你能帮我解决这个问题吗?我更喜欢需要最少计算量(CPU 效率最高)的解决方案。
还有一个问题,由于卡尔曼滤波器依赖于逆矩阵,当矩阵不可逆时我应该如何处理?
感谢您的帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建一个“小矩阵”,它是“大矩阵”的每个元素,其中包含指向“小矩阵”的指针,因此反转“大矩阵”所需的时间与反转普通整数矩阵一样长。
这可能是您能做到的最快的算法,但它适合您的实现吗?你的矩阵是如何声明的?
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?