From da8ea7ea207c587ac407ccd007378a674d744e90 Mon Sep 17 00:00:00 2001 From: conrad Date: Tue, 5 Nov 2024 18:53:25 +1000 Subject: [PATCH] add note --- include/armadillo_bits/auxlib_meat.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/armadillo_bits/auxlib_meat.hpp b/include/armadillo_bits/auxlib_meat.hpp index 8a70da4c..72bd2e75 100644 --- a/include/armadillo_bits/auxlib_meat.hpp +++ b/include/armadillo_bits/auxlib_meat.hpp @@ -28,6 +28,10 @@ auxlib::inv(Mat& A) { arma_debug_sigprint(); + // NOTE: given a matrix with NaN values, getrf() and getri() do not necessarily fail, + // NOTE: and can produce matrices with NaN values. + // NOTE: we're not checking for non-finite values to avoid breaking existing user code. + if(A.is_empty()) { return true; } #if defined(ARMA_USE_LAPACK)