| 358 | |
| 359 | template <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 | |
| 387 | template <typename captype, typename tcaptype, typename flowtype> |
| 388 | inline void Graph<captype,tcaptype,flowtype>::add_tweights(node_id i, tcaptype cap_source, tcaptype cap_sink) |
no outgoing calls
no test coverage detected