From 0e3b96db603d7aba23f9076299176f27a882cb7e Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Mon, 5 Sep 2011 21:27:41 +0000 Subject: [PATCH] Added exception handling code but has not yet been exercised! Chris will do so... --- gtsam/linear/GaussianFactorGraph.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gtsam/linear/GaussianFactorGraph.cpp b/gtsam/linear/GaussianFactorGraph.cpp index 3a3d81916..441962af4 100644 --- a/gtsam/linear/GaussianFactorGraph.cpp +++ b/gtsam/linear/GaussianFactorGraph.cpp @@ -323,7 +323,15 @@ namespace gtsam { // some untouched non-zeros that should be zero. We zero them while // extracting submatrices next. tic(4, "partial Cholesky"); - combinedFactor->partialCholesky(nrFrontals); + try { + combinedFactor->partialCholesky(nrFrontals); + } catch + (std::exception &ex) { // catch exception from Cholesky + combinedFactor->print("combinedFactor"); + string reason = "EliminateCholesky failed while trying to eliminate the combined factor"; + throw invalid_argument(reason); + } + toc(4, "partial Cholesky"); // Extract conditionals and fill in details of the remaining factor