diff --git a/gtsam_unstable/CMakeLists.txt b/gtsam_unstable/CMakeLists.txt index 448e8b00e..9ce9d9a22 100644 --- a/gtsam_unstable/CMakeLists.txt +++ b/gtsam_unstable/CMakeLists.txt @@ -10,9 +10,9 @@ set (gtsam_unstable_subdirs slam ) -if(GTSAM_BUILD_METIS) # Only build partition if metis is built +if(GTSAM_SUPPORT_NESTED_DISSECTION) # Only build partition if metis is built set (gtsam_unstable_subdirs ${gtsam_unstable_subdirs} partition) -endif(GTSAM_BUILD_METIS) +endif(GTSAM_SUPPORT_NESTED_DISSECTION) set(GTSAM_UNSTABLE_BOOST_LIBRARIES ${GTSAM_BOOST_LIBRARIES}) @@ -55,9 +55,9 @@ set(gtsam_unstable_srcs ${slam_srcs} ) -if(GTSAM_BUILD_METIS) # Only build partition if metis is built +if(GTSAM_SUPPORT_NESTED_DISSECTION) # Only build partition if metis is built set (gtsam_unstable_srcs ${gtsam_unstable_srcs} ${partition_srcs}) -endif(GTSAM_BUILD_METIS) +endif(GTSAM_SUPPORT_NESTED_DISSECTION) # Versions - same as core gtsam library set(gtsam_unstable_version ${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}) diff --git a/gtsam_unstable/partition/CMakeLists.txt b/gtsam_unstable/partition/CMakeLists.txt index fa5c336c3..74951bf93 100644 --- a/gtsam_unstable/partition/CMakeLists.txt +++ b/gtsam_unstable/partition/CMakeLists.txt @@ -1,5 +1,5 @@ # Install headers file(GLOB partition_headers "*.h") -install(FILES ${partition_headers} DESTINATION include/gtsam_unstable/parition) +install(FILES ${partition_headers} DESTINATION include/gtsam_unstable/partition) add_subdirectory(tests) diff --git a/gtsam_unstable/partition/FindSeparator-inl.h b/gtsam_unstable/partition/FindSeparator-inl.h index a65e3f1ca..15411264f 100644 --- a/gtsam_unstable/partition/FindSeparator-inl.h +++ b/gtsam_unstable/partition/FindSeparator-inl.h @@ -474,7 +474,7 @@ namespace gtsam { namespace partition { if (!result.is_initialized()) { std::cout << "metis failed!" << std::endl; - return 0; + return boost::none; } if (reduceGraph) { diff --git a/gtsam_unstable/partition/GenericGraph.cpp b/gtsam_unstable/partition/GenericGraph.cpp index 3ac77c213..7200f6168 100644 --- a/gtsam_unstable/partition/GenericGraph.cpp +++ b/gtsam_unstable/partition/GenericGraph.cpp @@ -6,7 +6,6 @@ * Description: generic graph types used in partitioning */ #include -#include #include #include @@ -105,9 +104,8 @@ namespace gtsam { namespace partition { list > islands; map > arrays = dsf.arrays(); - size_t key; vector array; - for(boost::tie(key, array): arrays) - islands.push_back(array); + for(const auto& kv : arrays) + islands.push_back(kv.second); return islands; } @@ -305,7 +303,8 @@ namespace gtsam { namespace partition { // regenerating islands map > labelIslands = dsf.arrays(); size_t label; vector island; - for(boost::tie(label, island): labelIslands) { + for(const auto& li: labelIslands) { + tie(label, island) = li; vector filteredIsland; // remove singular cameras from array filteredIsland.reserve(island.size()); for(const size_t key: island) { diff --git a/gtsam_unstable/partition/GenericGraph.h b/gtsam_unstable/partition/GenericGraph.h index 803a79719..ec0027635 100644 --- a/gtsam_unstable/partition/GenericGraph.h +++ b/gtsam_unstable/partition/GenericGraph.h @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include diff --git a/gtsam_unstable/partition/tests/testFindSeparator.cpp b/gtsam_unstable/partition/tests/testFindSeparator.cpp index 8c8f12d74..9706e4cc4 100644 --- a/gtsam_unstable/partition/tests/testFindSeparator.cpp +++ b/gtsam_unstable/partition/tests/testFindSeparator.cpp @@ -179,9 +179,11 @@ TEST ( Partition, findSeparator2 ) } /* *************************************************************************/ -// l1-l8 l9-l16 l17-l24 -// / | / \ | \ -// x25 x26 x27 x28 +/** + * l1-l8 l9-l16 l17-l24 + * / | / \ | \ + * x25 x26 x27 x28 + */ TEST ( Partition, findSeparator3_with_reduced_camera ) { GenericGraph3D graph; diff --git a/package_scripts/toolbox_package_unix.sh b/package_scripts/toolbox_package_unix.sh index bb5845a3c..28de2572a 100755 --- a/package_scripts/toolbox_package_unix.sh +++ b/package_scripts/toolbox_package_unix.sh @@ -42,7 +42,7 @@ cmake -DCMAKE_BUILD_TYPE=Release \ -DGTSAM_BUILD_TIMING:BOOL=OFF \ -DGTSAM_BUILD_EXAMPLES_ALWAYS:BOOL=OFF \ -DGTSAM_WITH_TBB:BOOL=OFF \ --DGTSAM_BUILD_METIS:BOOL=OFF \ +-DGTSAM_SUPPORT_NESTED_DISSECTION:BOOL=OFF \ -DGTSAM_INSTALL_GEOGRAPHICLIB:BOOL=OFF \ -DGTSAM_BUILD_UNSTABLE:BOOL=OFF \ -DGTSAM_MEX_BUILD_STATIC_MODULE:BOOL=ON ..