From 39d7e52eddca44744f7455a6557b2aff46f6ad64 Mon Sep 17 00:00:00 2001 From: conrad Date: Mon, 10 Jan 2022 14:42:18 +1000 Subject: [PATCH] more specific warning --- include/armadillo_bits/op_find_meat.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/armadillo_bits/op_find_meat.hpp b/include/armadillo_bits/op_find_meat.hpp index 3b4a7bc5..d3a4087b 100644 --- a/include/armadillo_bits/op_find_meat.hpp +++ b/include/armadillo_bits/op_find_meat.hpp @@ -93,9 +93,9 @@ op_find::helper const eT val = X.aux; - if(arma_config::debug && arma_isnan(val)) + if((is_same_type::yes || is_same_type::yes) && arma_config::debug && arma_isnan(val)) { - arma_debug_warn_level(1, "find(): NaN is not comparable to any value, even other NaN values"); + arma_debug_warn_level(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); } const Proxy A(X.m); @@ -226,6 +226,11 @@ op_find::helper const eT val = X.aux; + if((is_same_type::yes || is_same_type::yes) && arma_config::debug && arma_isnan(val)) + { + arma_debug_warn_level(1, "find(): NaN is not equal to anything; suggest to use find_nonfinite() instead"); + } + const Proxy A(X.m); ea_type PA = A.get_ea();