From 0f65b6c68c6cb170083fca7cc2bfe9dc714918ae Mon Sep 17 00:00:00 2001 From: conrad Date: Tue, 19 Apr 2022 22:39:34 +1000 Subject: [PATCH] simplifications --- include/armadillo_bits/glue_solve_meat.hpp | 44 ++++------------------ 1 file changed, 8 insertions(+), 36 deletions(-) diff --git a/include/armadillo_bits/glue_solve_meat.hpp b/include/armadillo_bits/glue_solve_meat.hpp index ad1aac9d..d0f1341b 100644 --- a/include/armadillo_bits/glue_solve_meat.hpp +++ b/include/armadillo_bits/glue_solve_meat.hpp @@ -288,16 +288,9 @@ glue_solve_gen_full::apply(Mat& out, const Base& A_expr, const Base T(0)) && (rcond < std::numeric_limits::epsilon()) ) + if( (allow_ugly == false) && (status == true) && (rcond > T(0)) && (rcond < std::numeric_limits::epsilon()) ) { - if(allow_ugly) - { - arma_debug_warn_level(2, "solve(): solution computed, but system is singular to working precision (rcond: ", rcond, ")"); - } - else - { - status = false; - } + status = false; } @@ -338,16 +331,9 @@ glue_solve_gen_full::apply(Mat& out, const Base& A_expr, const Base T(0)) && (rcond < std::numeric_limits::epsilon()) ) + if( (allow_ugly == false) && (status == true) && (rcond > T(0)) && (rcond < std::numeric_limits::epsilon()) ) { - if(allow_ugly) - { - arma_debug_warn_level(2, "solve(): solution computed, but system is singular to working precision (rcond: ", rcond, ")"); - } - else - { - status = false; - } + status = false; } if( (status == false) && (no_approx == false) ) @@ -431,16 +417,9 @@ glue_solve_tri_default::apply(Mat& actual_out, const Base& A_expr, co status = auxlib::solve_trimat_rcond(out, rcond, A, B_expr.get_ref(), layout); // A is not modified - if( (status == true) && (rcond > T(0)) && (rcond < std::numeric_limits::epsilon()) ) + if( (allow_ugly == false) && (status == true) && (rcond > T(0)) && (rcond < std::numeric_limits::epsilon()) ) { - if(allow_ugly) - { - arma_debug_warn_level(2, "solve(): solution computed, but system is singular to working precision (rcond: ", rcond, ")"); - } - else - { - status = false; - } + status = false; } @@ -557,16 +536,9 @@ glue_solve_tri_full::apply(Mat& actual_out, const Base& A_expr, const status = auxlib::solve_trimat_rcond(out, rcond, A, B_expr.get_ref(), layout); // A is not modified } - if( (status == true) && (rcond > T(0)) && (rcond < std::numeric_limits::epsilon()) ) + if( (allow_ugly == false) && (status == true) && (rcond > T(0)) && (rcond < std::numeric_limits::epsilon()) ) { - if(allow_ugly) - { - arma_debug_warn_level(2, "solve(): solution computed, but system is singular to working precision (rcond: ", rcond, ")"); - } - else - { - status = false; - } + status = false; }