Make gtsam_unstable/partition compile again, and actually build when GTSAM_SUPPORT_NESTED_DISSECTION=ON

release/4.3a0
Chris Beall 2018-12-14 14:53:03 -08:00
parent ed05fa6a7b
commit f21a431427
7 changed files with 17 additions and 15 deletions

View File

@ -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})

View File

@ -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)

View File

@ -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) {

View File

@ -6,7 +6,6 @@
* Description: generic graph types used in partitioning
*/
#include <iostream>
#include <boost/tuple/tuple.hpp>
#include <boost/make_shared.hpp>
#include <boost/lexical_cast.hpp>
@ -105,9 +104,8 @@ namespace gtsam { namespace partition {
list<vector<size_t> > islands;
map<size_t, vector<size_t> > arrays = dsf.arrays();
size_t key; vector<size_t> 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<size_t, vector<size_t> > labelIslands = dsf.arrays();
size_t label; vector<size_t> island;
for(boost::tie(label, island): labelIslands) {
for(const auto& li: labelIslands) {
tie(label, island) = li;
vector<size_t> filteredIsland; // remove singular cameras from array
filteredIsland.reserve(island.size());
for(const size_t key: island) {

View File

@ -8,6 +8,7 @@
#pragma once
#include <set>
#include <list>
#include <vector>
#include <stdexcept>

View File

@ -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;

View File

@ -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 ..