use maxflow as default implementation

This commit is contained in:
Sébastien Loriot 2013-09-05 11:23:10 +02:00
parent aad5c09bcf
commit 009c8727e0
2 changed files with 16 additions and 9 deletions

View File

@ -9,8 +9,11 @@
* *
* Main differences between implementations are underlying max-flow algorithm and graph type (i.e. results are the same, performance differs). * Main differences between implementations are underlying max-flow algorithm and graph type (i.e. results are the same, performance differs).
* *
* For activating MAXFLOW software, define CGAL_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE. It activates Alpha_expansion_graph_cut_boykov_kolmogorov, * By default, we use MAXFLOW and the class Alpha_expansion_graph_cut_boykov_kolmogorov.
* and makes CGAL::internal::Surface_mesh_segmentation choose this implementation for graph-cut. * For deactivating MAXFLOW software and using boost implementation instead, define CGAL_DO_NOT_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE.
* It deactivates Alpha_expansion_graph_cut_boykov_kolmogorov, activate boost versions
* and makes CGAL::internal::Surface_mesh_segmentation using Alpha_expansion_graph_cut_boost
* as default implementation for the graph-cut.
* *
* Also algorithms can be used by their-own for applying alpha-expansion graph-cut on any graph. * Also algorithms can be used by their-own for applying alpha-expansion graph-cut on any graph.
*/ */
@ -19,6 +22,7 @@
#include <CGAL/trace.h> #include <CGAL/trace.h>
#include <boost/version.hpp> #include <boost/version.hpp>
#ifdef CGAL_DO_NOT_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE
#include <boost/graph/adjacency_list.hpp> #include <boost/graph/adjacency_list.hpp>
#include <boost/graph/compressed_sparse_row_graph.hpp> #include <boost/graph/compressed_sparse_row_graph.hpp>
#if BOOST_VERSION >= 104400 // at this version kolmogorov_max_flow become depricated. #if BOOST_VERSION >= 104400 // at this version kolmogorov_max_flow become depricated.
@ -26,14 +30,14 @@
#else #else
#include <boost/graph/kolmogorov_max_flow.hpp> #include <boost/graph/kolmogorov_max_flow.hpp>
#endif #endif
#else
#include <CGAL/internal/auxiliary/graph.h>
#endif
#include <vector> #include <vector>
//#define CGAL_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE
#ifdef CGAL_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE
#include <CGAL/internal/auxiliary/graph.h>
#endif
namespace CGAL namespace CGAL
{ {
@ -74,6 +78,7 @@ namespace internal
// //
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
#ifdef CGAL_DO_NOT_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE
/** /**
* @brief Implements alpha-expansion graph cut algorithm. * @brief Implements alpha-expansion graph cut algorithm.
* *
@ -481,7 +486,9 @@ public:
return min_cut; return min_cut;
} }
}; };
#ifdef CGAL_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE #endif
#ifndef CGAL_DO_NOT_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE
/** /**
* @brief Implements alpha-expansion graph cut algorithm. * @brief Implements alpha-expansion graph cut algorithm.
* *
@ -592,7 +599,7 @@ public:
return min_cut; return min_cut;
} }
}; };
#endif //CGAL_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE #endif //CGAL_DO_NOT_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE
}//namespace internal }//namespace internal
/// @endcond /// @endcond
}//namespace CGAL }//namespace CGAL

View File

@ -181,7 +181,7 @@ template <
class Polyhedron, class Polyhedron,
class GeomTraits, class GeomTraits,
bool fast_bbox_intersection = true, bool fast_bbox_intersection = true,
#ifdef CGAL_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE #ifndef CGAL_DO_NOT_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE
class GraphCut = Alpha_expansion_graph_cut_boykov_kolmogorov, class GraphCut = Alpha_expansion_graph_cut_boykov_kolmogorov,
#else #else
class GraphCut = Alpha_expansion_graph_cut_boost, class GraphCut = Alpha_expansion_graph_cut_boost,