ANIMA  4.0
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
anima::Graph< captype, tcaptype, flowtype > Class Template Reference

#include <animaGraph.h>

+ Collaboration diagram for anima::Graph< captype, tcaptype, flowtype >:

Classes

struct  arc
 
struct  node
 
struct  nodeptr
 

Public Types

typedef arcarc_id
 
typedef int node_id
 
enum  termtype {
  SOURCE = 0,
  SINK = 1
}
 

Public Member Functions

void add_edge (node_id i, node_id j, captype cap, captype rev_cap)
 
node_id add_node (int num=1)
 
void add_to_changed_list (node *i)
 
void add_tweights (node_id i, tcaptype cap_source, tcaptype cap_sink)
 
void augment (arc *middle_arc)
 
void get_arc_ends (arc_id a, node_id &i, node_id &j)
 
int get_arc_num ()
 
arc_id get_first_arc ()
 
arc_id get_next_arc (arc_id a)
 
int get_node_num ()
 
captype get_rcap (arc *a)
 
tcaptype get_trcap (node_id i)
 
 Graph (int node_num_max, int edge_num_max, void(*err_function)(char *)=NULL)
 
void mark_node (node_id i)
 
flowtype maxflow (bool reuse_trees=false, Block< node_id > *changed_list=NULL)
 
void maxflow_init ()
 
void maxflow_reuse_trees_init ()
 
nodenext_active ()
 
void process_sink_orphan (node *i)
 
void process_source_orphan (node *i)
 
void reallocate_arcs ()
 
void reallocate_nodes (int num)
 
void remove_from_changed_list (node_id i)
 
void reset ()
 
void set_active (node *i)
 
void set_orphan_front (node *i)
 
void set_orphan_rear (node *i)
 
void set_rcap (arc *a, captype rcap)
 
void set_trcap (node_id i, tcaptype trcap)
 
void test_consistency (node *current_node=NULL)
 
termtype what_segment (node_id i, termtype default_segm=SOURCE)
 
 ~Graph ()
 

Public Attributes

arcarc_last
 
arcarc_max
 
arcarcs
 
Block< node_id > * changed_list
 
void(* error_function )(char *)
 
flowtype flow
 
int maxflow_iteration
 
nodenode_last
 
nodenode_max
 
int node_num
 
DBlock< nodeptr > * nodeptr_block
 
nodenodes
 
nodeptrorphan_first
 
nodeptrorphan_last
 
nodequeue_first [2]
 
nodequeue_last [2]
 
int TIME
 

Static Public Attributes

static const int NODEPTR_BLOCK_SIZE = 128
 

Detailed Description

template<typename captype, typename tcaptype, typename flowtype>
class anima::Graph< captype, tcaptype, flowtype >

Definition at line 91 of file animaGraph.h.

Member Typedef Documentation

◆ arc_id

template<typename captype, typename tcaptype, typename flowtype>
typedef arc* anima::Graph< captype, tcaptype, flowtype >::arc_id

Definition at line 193 of file animaGraph.h.

◆ node_id

template<typename captype, typename tcaptype, typename flowtype>
typedef int anima::Graph< captype, tcaptype, flowtype >::node_id

Definition at line 99 of file animaGraph.h.

Member Enumeration Documentation

◆ termtype

template<typename captype, typename tcaptype, typename flowtype>
enum anima::Graph::termtype
Enumerator
SOURCE 
SINK 

Definition at line 94 of file animaGraph.h.

Constructor & Destructor Documentation

◆ Graph()

template<typename captype , typename tcaptype , typename flowtype >
anima::Graph< captype, tcaptype, flowtype >::Graph ( int  node_num_max,
int  edge_num_max,
void(*)(char *)  err_function = NULL 
)
inline

◆ ~Graph()

template<typename captype , typename tcaptype , typename flowtype >
anima::Graph< captype, tcaptype, flowtype >::~Graph ( )
inline

Member Function Documentation

◆ add_edge()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::add_edge ( node_id  i,
node_id  j,
captype  cap,
captype  rev_cap 
)
inline

◆ add_node()

template<typename captype , typename tcaptype , typename flowtype >
Graph< captype, tcaptype, flowtype >::node_id anima::Graph< captype, tcaptype, flowtype >::add_node ( int  num = 1)
inline

◆ add_to_changed_list()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::add_to_changed_list ( node i)
inline

◆ add_tweights()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::add_tweights ( node_id  i,
tcaptype  cap_source,
tcaptype  cap_sink 
)
inline

◆ augment()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::augment ( arc middle_arc)
inline

◆ get_arc_ends()

template<typename captype, typename tcaptype, typename flowtype>
void anima::Graph< captype, tcaptype, flowtype >::get_arc_ends ( arc_id  a,
node_id i,
node_id j 
)
inline

◆ get_arc_num()

template<typename captype, typename tcaptype, typename flowtype>
int anima::Graph< captype, tcaptype, flowtype >::get_arc_num ( )
inline

◆ get_first_arc()

template<typename captype , typename tcaptype , typename flowtype >
Graph< captype, tcaptype, flowtype >::arc * anima::Graph< captype, tcaptype, flowtype >::get_first_arc ( )
inline

Definition at line 572 of file animaGraph.h.

References anima::Graph< captype, tcaptype, flowtype >::arcs.

◆ get_next_arc()

template<typename captype, typename tcaptype, typename flowtype>
Graph< captype, tcaptype, flowtype >::arc * anima::Graph< captype, tcaptype, flowtype >::get_next_arc ( arc_id  a)
inline

Definition at line 578 of file animaGraph.h.

◆ get_node_num()

template<typename captype, typename tcaptype, typename flowtype>
int anima::Graph< captype, tcaptype, flowtype >::get_node_num ( )
inline

◆ get_rcap()

template<typename captype , typename tcaptype , typename flowtype >
captype anima::Graph< captype, tcaptype, flowtype >::get_rcap ( arc a)
inline

◆ get_trcap()

template<typename captype , typename tcaptype , typename flowtype >
tcaptype anima::Graph< captype, tcaptype, flowtype >::get_trcap ( node_id  i)
inline

◆ mark_node()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::mark_node ( node_id  i)
inline

◆ maxflow()

template<typename captype , typename tcaptype , typename flowtype >
flowtype anima::Graph< captype, tcaptype, flowtype >::maxflow ( bool  reuse_trees = false,
Block< node_id > *  changed_list = NULL 
)
inline

Definition at line 1112 of file animaGraph.h.

References anima::Graph< captype, tcaptype, flowtype >::add_to_changed_list(), anima::Graph< captype, tcaptype, flowtype >::augment(), anima::Graph< captype, tcaptype, flowtype >::changed_list, anima::Graph< captype, tcaptype, flowtype >::node::DIST, anima::Graph< captype, tcaptype, flowtype >::error_function, anima::Graph< captype, tcaptype, flowtype >::node::first, anima::Graph< captype, tcaptype, flowtype >::flow, anima::Graph< captype, tcaptype, flowtype >::node::is_sink, anima::Graph< captype, tcaptype, flowtype >::maxflow_init(), anima::Graph< captype, tcaptype, flowtype >::maxflow_iteration, anima::Graph< captype, tcaptype, flowtype >::maxflow_reuse_trees_init(), anima::Graph< captype, tcaptype, flowtype >::arc::next, anima::Graph< captype, tcaptype, flowtype >::next_active(), anima::Graph< captype, tcaptype, flowtype >::nodeptr_block, anima::Graph< captype, tcaptype, flowtype >::NODEPTR_BLOCK_SIZE, anima::Graph< captype, tcaptype, flowtype >::orphan_first, anima::Graph< captype, tcaptype, flowtype >::orphan_last, anima::Graph< captype, tcaptype, flowtype >::node::parent, anima::Graph< captype, tcaptype, flowtype >::process_sink_orphan(), anima::Graph< captype, tcaptype, flowtype >::process_source_orphan(), anima::Graph< captype, tcaptype, flowtype >::arc::r_cap, anima::Graph< captype, tcaptype, flowtype >::set_active(), anima::Graph< captype, tcaptype, flowtype >::arc::sister, anima::Graph< captype, tcaptype, flowtype >::TIME, and anima::Graph< captype, tcaptype, flowtype >::node::TS.

◆ maxflow_init()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::maxflow_init ( )
inline

◆ maxflow_reuse_trees_init()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::maxflow_reuse_trees_init ( )
inline

◆ next_active()

template<typename captype , typename tcaptype , typename flowtype >
Graph< captype, tcaptype, flowtype >::node * anima::Graph< captype, tcaptype, flowtype >::next_active ( )
inline

◆ process_sink_orphan()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::process_sink_orphan ( node i)
inline

◆ process_source_orphan()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::process_source_orphan ( node i)
inline

◆ reallocate_arcs()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::reallocate_arcs ( )
inline

◆ reallocate_nodes()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::reallocate_nodes ( int  num)
inline

◆ remove_from_changed_list()

template<typename captype, typename tcaptype, typename flowtype>
void anima::Graph< captype, tcaptype, flowtype >::remove_from_changed_list ( node_id  i)
inline

◆ reset()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::reset ( )
inline

◆ set_active()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::set_active ( node i)
inline

◆ set_orphan_front()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::set_orphan_front ( node i)
inline

◆ set_orphan_rear()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::set_orphan_rear ( node i)
inline

◆ set_rcap()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::set_rcap ( arc a,
captype  rcap 
)
inline

◆ set_trcap()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::set_trcap ( node_id  i,
tcaptype  trcap 
)
inline

◆ test_consistency()

template<typename captype , typename tcaptype , typename flowtype >
void anima::Graph< captype, tcaptype, flowtype >::test_consistency ( node current_node = NULL)
inline

◆ what_segment()

template<typename captype , typename tcaptype , typename flowtype >
Graph< captype, tcaptype, flowtype >::termtype anima::Graph< captype, tcaptype, flowtype >::what_segment ( node_id  i,
termtype  default_segm = SOURCE 
)
inline

Member Data Documentation

◆ arc_last

template<typename captype, typename tcaptype, typename flowtype>
arc * anima::Graph< captype, tcaptype, flowtype >::arc_last

◆ arc_max

template<typename captype, typename tcaptype, typename flowtype>
arc * anima::Graph< captype, tcaptype, flowtype >::arc_max

◆ arcs

template<typename captype, typename tcaptype, typename flowtype>
arc* anima::Graph< captype, tcaptype, flowtype >::arcs

◆ changed_list

template<typename captype, typename tcaptype, typename flowtype>
Block<node_id>* anima::Graph< captype, tcaptype, flowtype >::changed_list

◆ error_function

template<typename captype, typename tcaptype, typename flowtype>
void(* anima::Graph< captype, tcaptype, flowtype >::error_function) (char *)

Definition at line 341 of file animaGraph.h.

Referenced by anima::Graph< captype, tcaptype, flowtype >::maxflow().

◆ flow

template<typename captype, typename tcaptype, typename flowtype>
flowtype anima::Graph< captype, tcaptype, flowtype >::flow

◆ maxflow_iteration

template<typename captype, typename tcaptype, typename flowtype>
int anima::Graph< captype, tcaptype, flowtype >::maxflow_iteration

◆ node_last

template<typename captype, typename tcaptype, typename flowtype>
node * anima::Graph< captype, tcaptype, flowtype >::node_last

◆ node_max

template<typename captype, typename tcaptype, typename flowtype>
node * anima::Graph< captype, tcaptype, flowtype >::node_max

◆ node_num

template<typename captype, typename tcaptype, typename flowtype>
int anima::Graph< captype, tcaptype, flowtype >::node_num

◆ nodeptr_block

template<typename captype, typename tcaptype, typename flowtype>
DBlock<nodeptr>* anima::Graph< captype, tcaptype, flowtype >::nodeptr_block

◆ NODEPTR_BLOCK_SIZE

template<typename captype, typename tcaptype, typename flowtype>
const int anima::Graph< captype, tcaptype, flowtype >::NODEPTR_BLOCK_SIZE = 128
static

Definition at line 332 of file animaGraph.h.

Referenced by anima::Graph< captype, tcaptype, flowtype >::maxflow().

◆ nodes

template<typename captype, typename tcaptype, typename flowtype>
node* anima::Graph< captype, tcaptype, flowtype >::nodes

◆ orphan_first

template<typename captype, typename tcaptype, typename flowtype>
nodeptr* anima::Graph< captype, tcaptype, flowtype >::orphan_first

◆ orphan_last

template<typename captype, typename tcaptype, typename flowtype>
nodeptr * anima::Graph< captype, tcaptype, flowtype >::orphan_last

◆ queue_first

template<typename captype, typename tcaptype, typename flowtype>
node* anima::Graph< captype, tcaptype, flowtype >::queue_first[2]

◆ queue_last

template<typename captype, typename tcaptype, typename flowtype>
node * anima::Graph< captype, tcaptype, flowtype >::queue_last[2]

◆ TIME

template<typename captype, typename tcaptype, typename flowtype>
int anima::Graph< captype, tcaptype, flowtype >::TIME

The documentation for this class was generated from the following file: