11 #ifndef __GRAPH_CUT_H__
12 #define __GRAPH_CUT_H__
24 #define TERMINAL_EDGE ( (Edge *) 1 ) // to terminal
25 #define ORPHAN_EDGE ( (Edge *) 2 ) // orphan
27 #define INFINITE_D 1000000000 // infinite distance to the terminal
97 CGraphCut(int32_t num_nodes, int32_t num_edges);
209 void add_factor(
CFactor* factor);
231 void set_active(
Node* node_i);
240 void set_orphan_front(
Node* node_i);
246 void set_orphan_rear(
Node* node_i);
262 bool grow(
Edge* &edge,
Node* ¤t_node);
268 void augment_path(
Edge* connecting_edge);
274 void test_consistency(
Node* current_node = NULL);
279 int32_t m_num_variables;
292 Node* m_active_first[2];
293 Node* m_active_last[2];
virtual const char * get_name() const
float64_t residual_capacity
void add_edge(int32_t i, int32_t j, float64_t capacity, float64_t reverse_capacity)
Class CMAPInferImpl abstract class of MAP inference implementation.
void build_st_graph(int32_t num_nodes, int32_t num_edges)
float64_t compute_maxflow()
void add_tweights(int32_t i, float64_t cap_source, float64_t cap_sink)
Template Dynamic array class that creates an array that can be used like a list or an array...
ETerminalType get_assignment(int32_t i, ETerminalType default_termainl=SOURCE)
Class CFactorGraph a factor graph is a structured input in general.
Class CFactor A factor is defined on a clique in the factor graph. Each factor can have its own data...
virtual float64_t inference(SGVector< int32_t > assignment)