Merge branch 'develop'
commit
08a54ee470
|
@ -25,8 +25,11 @@ if(NOT GTSAM_USE_SYSTEM_EIGEN)
|
||||||
FILES_MATCHING PATTERN "*.h")
|
FILES_MATCHING PATTERN "*.h")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option(GTSAM_BUILD_METIS "Build metis library" ON)
|
||||||
option(GTSAM_BUILD_METIS_EXECUTABLES "Build metis library executables" OFF)
|
option(GTSAM_BUILD_METIS_EXECUTABLES "Build metis library executables" OFF)
|
||||||
add_subdirectory(metis-5.1.0)
|
if(GTSAM_BUILD_METIS)
|
||||||
|
add_subdirectory(metis-5.1.0)
|
||||||
|
endif(GTSAM_BUILD_METIS)
|
||||||
############ NOTE: When updating GeographicLib be sure to disable building their examples
|
############ NOTE: When updating GeographicLib be sure to disable building their examples
|
||||||
############ and unit tests by commenting out their lines:
|
############ and unit tests by commenting out their lines:
|
||||||
# add_subdirectory (examples)
|
# add_subdirectory (examples)
|
||||||
|
|
|
@ -2,9 +2,13 @@ cmake_minimum_required(VERSION 2.8)
|
||||||
project(METIS)
|
project(METIS)
|
||||||
|
|
||||||
# Add flags for currect directory and below
|
# Add flags for currect directory and below
|
||||||
add_definitions(-Wno-unused-variable)
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
add_definitions(-Wno-unused-variable)
|
||||||
|
add_definitions(-Wno-sometimes-uninitialized)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_definitions(-Wno-unknown-pragmas)
|
add_definitions(-Wno-unknown-pragmas)
|
||||||
add_definitions(-Wno-sometimes-uninitialized)
|
add_definitions(-Wunused-but-set-variable)
|
||||||
|
|
||||||
set(GKLIB_PATH ${PROJECT_SOURCE_DIR}/GKlib CACHE PATH "path to GKlib")
|
set(GKLIB_PATH ${PROJECT_SOURCE_DIR}/GKlib CACHE PATH "path to GKlib")
|
||||||
set(SHARED FALSE CACHE BOOL "build a shared library")
|
set(SHARED FALSE CACHE BOOL "build a shared library")
|
||||||
|
|
|
@ -33,7 +33,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
set(GKlib_COPTIONS "${GKlib_COPTIONS} -fPIC")
|
set(GKlib_COPTIONS "${GKlib_COPTIONS} -fPIC")
|
||||||
endif(NOT MINGW)
|
endif(NOT MINGW)
|
||||||
# GCC warnings.
|
# GCC warnings.
|
||||||
set(GKlib_COPTIONS "${GKlib_COPTIONS} -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas")
|
set(GKlib_COPTIONS "${GKlib_COPTIONS} -Wall -pedantic -Wno-unused-variable -Wno-unknown-pragmas")
|
||||||
elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun")
|
elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun")
|
||||||
# Sun insists on -xc99.
|
# Sun insists on -xc99.
|
||||||
set(GKlib_COPTIONS "${GKlib_COPTIONS} -xc99")
|
set(GKlib_COPTIONS "${GKlib_COPTIONS} -xc99")
|
||||||
|
|
|
@ -88,6 +88,9 @@ namespace gtsam {
|
||||||
template<class DERIVEDFACTOR>
|
template<class DERIVEDFACTOR>
|
||||||
GaussianFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
GaussianFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
||||||
|
|
||||||
|
/** Virtual destructor */
|
||||||
|
virtual ~GaussianFactorGraph() {}
|
||||||
|
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
|
|
|
@ -151,13 +151,13 @@ void ISAM2Clique::print(const std::string& s, const KeyFormatter& formatter) con
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
ISAM2::ISAM2(const ISAM2Params& params): params_(params) {
|
ISAM2::ISAM2(const ISAM2Params& params): params_(params), update_count_(0) {
|
||||||
if(params_.optimizationParams.type() == typeid(ISAM2DoglegParams))
|
if(params_.optimizationParams.type() == typeid(ISAM2DoglegParams))
|
||||||
doglegDelta_ = boost::get<ISAM2DoglegParams>(params_.optimizationParams).initialDelta;
|
doglegDelta_ = boost::get<ISAM2DoglegParams>(params_.optimizationParams).initialDelta;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
ISAM2::ISAM2() {
|
ISAM2::ISAM2() : update_count_(0) {
|
||||||
if(params_.optimizationParams.type() == typeid(ISAM2DoglegParams))
|
if(params_.optimizationParams.type() == typeid(ISAM2DoglegParams))
|
||||||
doglegDelta_ = boost::get<ISAM2DoglegParams>(params_.optimizationParams).initialDelta;
|
doglegDelta_ = boost::get<ISAM2DoglegParams>(params_.optimizationParams).initialDelta;
|
||||||
}
|
}
|
||||||
|
@ -521,8 +521,7 @@ ISAM2Result ISAM2::update(
|
||||||
|
|
||||||
gttic(ISAM2_update);
|
gttic(ISAM2_update);
|
||||||
|
|
||||||
static int count = 0;
|
this->update_count_++;
|
||||||
count++;
|
|
||||||
|
|
||||||
lastAffectedVariableCount = 0;
|
lastAffectedVariableCount = 0;
|
||||||
lastAffectedFactorCount = 0;
|
lastAffectedFactorCount = 0;
|
||||||
|
@ -533,7 +532,8 @@ ISAM2Result ISAM2::update(
|
||||||
ISAM2Result result;
|
ISAM2Result result;
|
||||||
if(params_.enableDetailedResults)
|
if(params_.enableDetailedResults)
|
||||||
result.detail = ISAM2Result::DetailedResults();
|
result.detail = ISAM2Result::DetailedResults();
|
||||||
const bool relinearizeThisStep = force_relinearize || (params_.enableRelinearization && count % params_.relinearizeSkip == 0);
|
const bool relinearizeThisStep = force_relinearize
|
||||||
|
|| (params_.enableRelinearization && update_count_ % params_.relinearizeSkip == 0);
|
||||||
|
|
||||||
if(verbose) {
|
if(verbose) {
|
||||||
cout << "ISAM2::update\n";
|
cout << "ISAM2::update\n";
|
||||||
|
|
|
@ -468,6 +468,8 @@ protected:
|
||||||
* variables and thus cannot have their linearization points changed. */
|
* variables and thus cannot have their linearization points changed. */
|
||||||
FastSet<Key> fixedVariables_;
|
FastSet<Key> fixedVariables_;
|
||||||
|
|
||||||
|
int update_count_; ///< Counter incremented every update(), used to determine periodic relinearization
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef ISAM2 This; ///< This class
|
typedef ISAM2 This; ///< This class
|
||||||
|
|
|
@ -6,10 +6,13 @@ set (gtsam_unstable_subdirs
|
||||||
discrete
|
discrete
|
||||||
dynamics
|
dynamics
|
||||||
nonlinear
|
nonlinear
|
||||||
partition
|
|
||||||
slam
|
slam
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(GTSAM_BUILD_METIS) # Only build partition if metis is built
|
||||||
|
set (gtsam_unstable_subdirs ${gtsam_unstable_subdirs} partition)
|
||||||
|
endif(GTSAM_BUILD_METIS)
|
||||||
|
|
||||||
set(GTSAM_UNSTABLE_BOOST_LIBRARIES ${GTSAM_BOOST_LIBRARIES})
|
set(GTSAM_UNSTABLE_BOOST_LIBRARIES ${GTSAM_BOOST_LIBRARIES})
|
||||||
|
|
||||||
add_custom_target(check.unstable COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
|
add_custom_target(check.unstable COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
|
||||||
|
@ -47,10 +50,13 @@ set(gtsam_unstable_srcs
|
||||||
${discrete_srcs}
|
${discrete_srcs}
|
||||||
${dynamics_srcs}
|
${dynamics_srcs}
|
||||||
${nonlinear_srcs}
|
${nonlinear_srcs}
|
||||||
${partition_srcs}
|
|
||||||
${slam_srcs}
|
${slam_srcs}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(GTSAM_BUILD_METIS) # Only build partition if metis is built
|
||||||
|
set (gtsam_unstable_srcs ${gtsam_unstable_srcs} ${partition_srcs})
|
||||||
|
endif(GTSAM_BUILD_METIS)
|
||||||
|
|
||||||
# Versions - same as core gtsam library
|
# Versions - same as core gtsam library
|
||||||
set(gtsam_unstable_version ${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH})
|
set(gtsam_unstable_version ${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH})
|
||||||
set(gtsam_unstable_soversion ${GTSAM_VERSION_MAJOR})
|
set(gtsam_unstable_soversion ${GTSAM_VERSION_MAJOR})
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
#include <gtsam/base/DSFVector.h>
|
#include <gtsam/base/DSFVector.h>
|
||||||
|
|
||||||
|
@ -468,9 +469,9 @@ namespace gtsam { namespace partition {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minFoundConstraintsPerCamera < minNrConstraintsPerCamera)
|
if (minFoundConstraintsPerCamera < minNrConstraintsPerCamera)
|
||||||
throw runtime_error("checkSingularity:minConstraintsPerCamera < " + minFoundConstraintsPerCamera);
|
throw runtime_error("checkSingularity:minConstraintsPerCamera < " + boost::lexical_cast<string>(minFoundConstraintsPerCamera));
|
||||||
if (minFoundConstraintsPerLandmark < minNrConstraintsPerLandmark)
|
if (minFoundConstraintsPerLandmark < minNrConstraintsPerLandmark)
|
||||||
throw runtime_error("checkSingularity:minConstraintsPerLandmark < " + minFoundConstraintsPerLandmark);
|
throw runtime_error("checkSingularity:minConstraintsPerLandmark < " + boost::lexical_cast<string>(minFoundConstraintsPerLandmark));
|
||||||
}
|
}
|
||||||
|
|
||||||
}} // namespace
|
}} // namespace
|
||||||
|
|
Loading…
Reference in New Issue