From b9b6e302aa2fc45731ed490ae528b93a13f5e2de Mon Sep 17 00:00:00 2001 From: conrad Date: Thu, 4 Aug 2022 16:07:57 +1000 Subject: [PATCH] ensure output matrix is reset on nonconformant input --- include/armadillo_bits/fn_chol.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/armadillo_bits/fn_chol.hpp b/include/armadillo_bits/fn_chol.hpp index c65ef622..8edbf046 100644 --- a/include/armadillo_bits/fn_chol.hpp +++ b/include/armadillo_bits/fn_chol.hpp @@ -95,7 +95,11 @@ chol out = X.get_ref(); - arma_debug_check( (out.is_square() == false), "chol(): given matrix must be square sized" ); + if((arma_config::debug) && (out.is_square() == false)) + { + out.reset(); + arma_stop_logic_error("chol(): given matrix must be square sized"); + } if(out.is_empty()) {