diff --git a/include/armadillo_bits/op_omit_meat.hpp b/include/armadillo_bits/op_omit_meat.hpp index 1836962e..85ec8903 100644 --- a/include/armadillo_bits/op_omit_meat.hpp +++ b/include/armadillo_bits/op_omit_meat.hpp @@ -32,6 +32,12 @@ op_omit::apply(Mat& out, const Op& in) const uword omit_mode = in.aux_uword_a; + if(arma_config::fast_math_warn) + { + if(omit_mode == 1) { arma_warn(1, "omit_nan(): detection of NaN is not reliable in fast math mode"); } + if(omit_mode == 2) { arma_warn(1, "omit_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + } + auto is_omitted_1 = [](const eT& x) -> bool { return arma_isnan(x); }; auto is_omitted_2 = [](const eT& x) -> bool { return arma_isnonfinite(x); }; diff --git a/include/armadillo_bits/spop_omit_meat.hpp b/include/armadillo_bits/spop_omit_meat.hpp index 3383f446..6e039464 100644 --- a/include/armadillo_bits/spop_omit_meat.hpp +++ b/include/armadillo_bits/spop_omit_meat.hpp @@ -33,6 +33,12 @@ spop_omit::apply(SpMat& out, const SpOp& const uword omit_mode = in.aux_uword_a; + if(arma_config::fast_math_warn) + { + if(omit_mode == 1) { arma_warn(1, "omit_nan(): detection of NaN is not reliable in fast math mode"); } + if(omit_mode == 2) { arma_warn(1, "omit_nonfinite(): detection of non-finite values is not reliable in fast math mode"); } + } + auto is_omitted_1 = [](const eT& x) -> bool { return arma_isnan(x); }; auto is_omitted_2 = [](const eT& x) -> bool { return arma_isnonfinite(x); };