From a807127b512e41704712bdca53922a3bf2224309 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Thu, 11 May 2023 13:17:17 -0400 Subject: [PATCH] update GncOptimizer and make it available --- gtsam/CMakeLists.txt | 1 - gtsam/nonlinear/GncOptimizer.h | 5 ++--- tests/CMakeLists.txt | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/gtsam/CMakeLists.txt b/gtsam/CMakeLists.txt index efd0e9dc2..40028ad00 100644 --- a/gtsam/CMakeLists.txt +++ b/gtsam/CMakeLists.txt @@ -59,7 +59,6 @@ endif() # if GTSAM_USE_BOOST_FEATURES is not set, then we need to exclude the following: if(NOT GTSAM_USE_BOOST_FEATURES) list (APPEND excluded_sources - "${CMAKE_CURRENT_SOURCE_DIR}/nonlinear/GncOptimizer.h" "${CMAKE_CURRENT_SOURCE_DIR}/inference/graph.h" "${CMAKE_CURRENT_SOURCE_DIR}/inference/graph-inl.h" ) diff --git a/gtsam/nonlinear/GncOptimizer.h b/gtsam/nonlinear/GncOptimizer.h index d59eb4371..414bee5eb 100644 --- a/gtsam/nonlinear/GncOptimizer.h +++ b/gtsam/nonlinear/GncOptimizer.h @@ -26,9 +26,9 @@ #pragma once +#include #include #include -#include namespace gtsam { /* @@ -36,8 +36,7 @@ namespace gtsam { * Equivalent to chi2inv in Matlab. */ static double Chi2inv(const double alpha, const size_t dofs) { - boost::math::chi_squared_distribution chi2(dofs); - return boost::math::quantile(chi2, alpha); + return chi_squared_quantile(dofs, alpha); } /* ************************************************************************* */ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d7b68c4ec..66812d6bb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,7 +8,6 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") # might not be best test - Richar endif() if (NOT GTSAM_USE_BOOST_FEATURES) - list(APPEND excluded_tests "testGncOptimizer.cpp") list(APPEND excluded_tests "testGraph.cpp") endif()