update GncOptimizer and make it available

release/4.3a0
Varun Agrawal 2023-05-11 13:17:17 -04:00
parent 7ce5684e05
commit a807127b51
3 changed files with 2 additions and 5 deletions

View File

@ -59,7 +59,6 @@ endif()
# if GTSAM_USE_BOOST_FEATURES is not set, then we need to exclude the following: # if GTSAM_USE_BOOST_FEATURES is not set, then we need to exclude the following:
if(NOT GTSAM_USE_BOOST_FEATURES) if(NOT GTSAM_USE_BOOST_FEATURES)
list (APPEND excluded_sources list (APPEND excluded_sources
"${CMAKE_CURRENT_SOURCE_DIR}/nonlinear/GncOptimizer.h"
"${CMAKE_CURRENT_SOURCE_DIR}/inference/graph.h" "${CMAKE_CURRENT_SOURCE_DIR}/inference/graph.h"
"${CMAKE_CURRENT_SOURCE_DIR}/inference/graph-inl.h" "${CMAKE_CURRENT_SOURCE_DIR}/inference/graph-inl.h"
) )

View File

@ -26,9 +26,9 @@
#pragma once #pragma once
#include <gtsam/nonlinear/GncHelpers.h>
#include <gtsam/nonlinear/GncParams.h> #include <gtsam/nonlinear/GncParams.h>
#include <gtsam/nonlinear/NonlinearFactorGraph.h> #include <gtsam/nonlinear/NonlinearFactorGraph.h>
#include <boost/math/distributions/chi_squared.hpp>
namespace gtsam { namespace gtsam {
/* /*
@ -36,8 +36,7 @@ namespace gtsam {
* Equivalent to chi2inv in Matlab. * Equivalent to chi2inv in Matlab.
*/ */
static double Chi2inv(const double alpha, const size_t dofs) { static double Chi2inv(const double alpha, const size_t dofs) {
boost::math::chi_squared_distribution<double> chi2(dofs); return chi_squared_quantile(dofs, alpha);
return boost::math::quantile(chi2, alpha);
} }
/* ************************************************************************* */ /* ************************************************************************* */

View File

@ -8,7 +8,6 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") # might not be best test - Richar
endif() endif()
if (NOT GTSAM_USE_BOOST_FEATURES) if (NOT GTSAM_USE_BOOST_FEATURES)
list(APPEND excluded_tests "testGncOptimizer.cpp")
list(APPEND excluded_tests "testGraph.cpp") list(APPEND excluded_tests "testGraph.cpp")
endif() endif()