11 #ifndef __GRAPH_CUT_H__
12 #define __GRAPH_CUT_H__
24 #define TERMINAL_EDGE ( (GCEdge *) 1 ) // to terminal
25 #define ORPHAN_EDGE ( (GCEdge *) 2 ) // orphan
27 #define INFINITE_D 1000000000 // infinite distance to the terminal
127 CGraphCut(int32_t num_nodes, int32_t num_edges);
239 void add_factor(
CFactor* factor);
261 void set_active(
GCNode* node_i);
270 void set_orphan_front(
GCNode* node_i);
276 void set_orphan_rear(
GCNode* node_i);
298 void augment_path(
GCEdge* connecting_edge);
304 void test_consistency(
GCNode* current_node = NULL);
311 int32_t m_num_variables;
334 GCNode* m_active_first[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...
all of classes and functions are contained in the shogun namespace
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)
ETerminalType get_assignment(int32_t i, ETerminalType default_terminal=SOURCE)