mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 05:13:34 +08:00
matrix: add method to check all values are nan (#82)
This commit is contained in:
committed by
Julian Kent
parent
84b3da227c
commit
cc084e0791
@@ -507,6 +507,17 @@ public:
|
||||
return min_val;
|
||||
}
|
||||
|
||||
bool isAllNan() const {
|
||||
const Matrix<float, M, N> &self = *this;
|
||||
bool result = true;
|
||||
for (size_t i = 0; i < M; i++) {
|
||||
for (size_t j = 0; j < N; j++) {
|
||||
result = result && isnan(self(i, j));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
template<typename Type, size_t M, size_t N>
|
||||
|
||||
Reference in New Issue
Block a user