From 9acf8d4ebca32e2f13e7c7deb75e9d449d86cffc Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Thu, 10 Sep 2020 19:59:18 -0400 Subject: [PATCH] ISAM2 helper methods and wrapper to evaluate nonlinear error --- gtsam/gtsam.i | 2 ++ gtsam/nonlinear/ISAM2Result.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/gtsam/gtsam.i b/gtsam/gtsam.i index 52f5901ee..8779c946f 100644 --- a/gtsam/gtsam.i +++ b/gtsam/gtsam.i @@ -2551,6 +2551,8 @@ class ISAM2Result { size_t getVariablesRelinearized() const; size_t getVariablesReeliminated() const; size_t getCliques() const; + double getErrorBefore() const; + double getErrorAfter() const; }; class ISAM2 { diff --git a/gtsam/nonlinear/ISAM2Result.h b/gtsam/nonlinear/ISAM2Result.h index e45b17e4a..b249af5c5 100644 --- a/gtsam/nonlinear/ISAM2Result.h +++ b/gtsam/nonlinear/ISAM2Result.h @@ -176,6 +176,8 @@ struct ISAM2Result { size_t getVariablesRelinearized() const { return variablesRelinearized; } size_t getVariablesReeliminated() const { return variablesReeliminated; } size_t getCliques() const { return cliques; } + double getErrorBefore() const { return errorBefore ? *errorBefore : std::nan(""); } + double getErrorAfter() const { return errorAfter ? *errorAfter : std::nan(""); } }; } // namespace gtsam