MCPcopy Create free account
hub / github.com/HiLab-git/SimpleCRF / add_node

Method add_node

dependency/maxflow-v3.0/graph.h:360–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358
359template <typename captype, typename tcaptype, typename flowtype>
360 inline typename Graph<captype,tcaptype,flowtype>::node_id Graph<captype,tcaptype,flowtype>::add_node(int num)
361{
362 assert(num > 0);
363
364 if (node_last + num > node_max) reallocate_nodes(num);
365
366 if (num == 1)
367 {
368 node_last -> first = NULL;
369 node_last -> tr_cap = 0;
370 node_last -> is_marked = 0;
371 node_last -> is_in_changed_list = 0;
372
373 node_last ++;
374 return node_num ++;
375 }
376 else
377 {
378 memset(node_last, 0, num*sizeof(node));
379
380 node_id i = node_num;
381 node_num += num;
382 node_last += num;
383 return i;
384 }
385}
386
387template <typename captype, typename tcaptype, typename flowtype>
388 inline void Graph<captype,tcaptype,flowtype>::add_tweights(node_id i, tcaptype cap_source, tcaptype cap_sink)

Callers 4

mexFunctionFunction · 0.80
mexFunctionFunction · 0.80
maxflow_inferenceFunction · 0.80
maxflow3d_inferenceFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected