mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-10 22:13:35 +08:00
matrix_alg: use PX4_ISFINITE() instead if isnan() & isinf()
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "matrix_alg.h"
|
#include "matrix_alg.h"
|
||||||
|
#include <px4_defines.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Does matrix multiplication of two regular/square matrices
|
* Does matrix multiplication of two regular/square matrices
|
||||||
@@ -239,7 +240,7 @@ bool mat_inverse(float *A, float *inv, uint8_t n)
|
|||||||
//check sanity of results
|
//check sanity of results
|
||||||
for (uint8_t i = 0; i < n; i++) {
|
for (uint8_t i = 0; i < n; i++) {
|
||||||
for (uint8_t j = 0; j < n; j++) {
|
for (uint8_t j = 0; j < n; j++) {
|
||||||
if (isnan(inv_pivoted[i * n + j]) || isinf(inv_pivoted[i * n + j])) {
|
if (!PX4_ISFINITE(inv_pivoted[i * n + j])) {
|
||||||
ret = false;
|
ret = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user