Commit 2e2b3176 authored by Davis King's avatar Davis King

Added some compile time asserts.

parent 19ccb387
......@@ -591,6 +591,7 @@ namespace dlib
}
}
#endif
COMPILE_TIME_ASSERT(is_signed_type<typename potts_model::value_type>::value);
min_cut mc;
dlib::impl::potts_flow_graph<potts_model> pfg(prob);
mc(pfg, prob.number_of_nodes(), prob.number_of_nodes()+1);
......@@ -615,6 +616,7 @@ namespace dlib
// The edges and node's have to use the same type to represent factor weights!
COMPILE_TIME_ASSERT((is_same_type<edge_type, type>::value == true));
COMPILE_TIME_ASSERT(is_signed_type<edge_type>::value);
#ifdef ENABLE_ASSERTS
for (unsigned long i = 0; i < g.number_of_nodes(); ++i)
......
......@@ -149,6 +149,8 @@ namespace dlib
orphans.clear();
typedef typename flow_graph::edge_type edge_type;
COMPILE_TIME_ASSERT(is_signed_type<edge_type>::value);
typedef typename flow_graph::out_edge_iterator out_edge_iterator;
typedef typename flow_graph::in_edge_iterator in_edge_iterator;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment