add inv_opts::no_ugly

This commit is contained in:
conrad
2022-04-19 12:41:41 +10:00
parent 8fa46e3a06
commit 05ca294ef7
@@ -92,6 +92,7 @@ op_inv_spd_full::apply_direct(Mat<typename T1::elem_type>& out, const Base<typen
const bool allow_approx = has_user_flags && bool(flags & inv_opts::flag_allow_approx);
const bool likely_sympd = has_user_flags && bool(flags & inv_opts::flag_likely_sympd);
const bool no_sympd = has_user_flags && bool(flags & inv_opts::flag_no_sympd );
const bool no_ugly = has_user_flags && bool(flags & inv_opts::flag_no_ugly );
arma_extra_debug_print("op_inv_spd_full: enabled flags:");
@@ -99,10 +100,24 @@ op_inv_spd_full::apply_direct(Mat<typename T1::elem_type>& out, const Base<typen
if(allow_approx) { arma_extra_debug_print("allow_approx"); }
if(likely_sympd) { arma_extra_debug_print("likely_sympd"); }
if(no_sympd ) { arma_extra_debug_print("no_sympd"); }
if(no_ugly ) { arma_extra_debug_print("no_ugly"); }
if(likely_sympd) { arma_debug_warn_level(1, "inv_sympd(): option 'likely_sympd' ignored" ); }
if(no_sympd) { arma_debug_warn_level(1, "inv_sympd(): option 'no_sympd' ignored" ); }
arma_debug_check( (no_ugly && allow_approx), "inv_sympd(): options 'no_ugly' and 'allow_approx' are mutually exclusive" );
if(no_ugly)
{
T rcond = T(0);
const bool status = op_inv_spd_rcond::apply_direct(out, rcond, expr);
if((status == false) || (rcond < auxlib::epsilon_lapack(out))) { return false; }
return true;
}
if(allow_approx)
{
T rcond = T(0);