42 #ifndef _D_GEOCUTSTOOLS_HPP_
43 #define _D_GEOCUTSTOOLS_HPP_
56 #ifndef __BOOST_INCLUDED__
57 #define __BOOST_INCLUDED__
63 #include <boost/config.hpp>
65 #include <boost/utility.hpp>
67 #include <boost/graph/graph_traits.hpp>
68 #include <boost/graph/adjacency_list.hpp>
69 #include <boost/version.hpp>
71 #if BOOST_VERSION >= 104700
72 #include <boost/graph/boykov_kolmogorov_max_flow.hpp>
73 #elif BOOST_VERSION >= 103500
74 #include <boost/graph/kolmogorov_max_flow.hpp>
82 static int debugOn =
false;
94 #ifndef SMIL_ENTER_FUNCTION
95 #define SMIL_ENTER_FUNCTION(a) \
98 std::cout << "Entering function " << __func__ << " " << (a) \
102 #define SMIL_REGISTER_ERROR(a)
105 #define M_PI 3.14159265358979323846
106 #define INFINI_POSITIF std::numeric_limits<double>::max)()
107 #define _SECURE_SCL 0
112 inline vector<IntPoint> filterStrElt(StrElt se)
114 vector<IntPoint> pts(0);
116 vector<IntPoint>::iterator it, itStart, itEnd;
117 itStart = se.points.begin();
118 itEnd = se.points.end();
120 for (it = itStart; it != itEnd; it++) {
121 bool ok = (4 * it->z + 2 * it->y + it->x) > 0;
126 std::cout << (ok ?
"GOOD " :
"BAD ") << std::right <<
" "
127 << std::setw(6) << it->x <<
" " << std::setw(6) << it->y
128 <<
" " << std::setw(6) << it->z << endl;
135 typedef graph_traits<Graph>::vertex_descriptor vertexDescriptor_T;
137 inline kolmogorovMaxFlow(Graph& g,
138 CapacityEdgeMap capacity,
139 ResidualCapacityEdgeMap residual_capacity,
143 vertexDescriptor_T vSource,
144 vertexDescriptor_T vSink);
148 #if BOOST_VERSION >= 104700
149 flow = boykov_kolmogorov_max_flow(g, capacity, residual_capacity, rev,
150 color, indexmap, vSource, vSink);
152 flow = kolmogorov_max_flow(g, capacity, residual_capacity, rev,
153 color, indexmap, vSource, vSink);