... | ... |
@@ -432,58 +432,58 @@ |
432 | 432 |
/// of course. |
433 | 433 |
/// \return <tt>(*this)</tt> |
434 | 434 |
Circulation& elevator(Elevator& elevator) { |
435 | 435 |
if (_local_level) { |
436 | 436 |
delete _level; |
437 | 437 |
_local_level = false; |
438 | 438 |
} |
439 | 439 |
_level = &elevator; |
440 | 440 |
return *this; |
441 | 441 |
} |
442 | 442 |
|
443 | 443 |
/// \brief Returns a const reference to the elevator. |
444 | 444 |
/// |
445 | 445 |
/// Returns a const reference to the elevator. |
446 | 446 |
/// |
447 | 447 |
/// \pre Either \ref run() or \ref init() must be called before |
448 | 448 |
/// using this function. |
449 | 449 |
const Elevator& elevator() const { |
450 | 450 |
return *_level; |
451 | 451 |
} |
452 | 452 |
|
453 | 453 |
/// \brief Sets the tolerance used by algorithm. |
454 | 454 |
/// |
455 | 455 |
/// Sets the tolerance used by algorithm. |
456 |
Circulation& tolerance(const Tolerance& tolerance) |
|
456 |
Circulation& tolerance(const Tolerance& tolerance) { |
|
457 | 457 |
_tol = tolerance; |
458 | 458 |
return *this; |
459 | 459 |
} |
460 | 460 |
|
461 | 461 |
/// \brief Returns a const reference to the tolerance. |
462 | 462 |
/// |
463 | 463 |
/// Returns a const reference to the tolerance. |
464 | 464 |
const Tolerance& tolerance() const { |
465 |
return |
|
465 |
return _tol; |
|
466 | 466 |
} |
467 | 467 |
|
468 | 468 |
/// \name Execution Control |
469 | 469 |
/// The simplest way to execute the algorithm is to call \ref run().\n |
470 | 470 |
/// If you need more control on the initial solution or the execution, |
471 | 471 |
/// first you have to call one of the \ref init() functions, then |
472 | 472 |
/// the \ref start() function. |
473 | 473 |
|
474 | 474 |
///@{ |
475 | 475 |
|
476 | 476 |
/// Initializes the internal data structures. |
477 | 477 |
|
478 | 478 |
/// Initializes the internal data structures and sets all flow values |
479 | 479 |
/// to the lower bound. |
480 | 480 |
void init() |
481 | 481 |
{ |
482 | 482 |
LEMON_DEBUG(checkBoundMaps(), |
483 | 483 |
"Upper bounds must be greater or equal to the lower bounds"); |
484 | 484 |
|
485 | 485 |
createStructures(); |
486 | 486 |
|
487 | 487 |
for(NodeIt n(_g);n!=INVALID;++n) { |
488 | 488 |
(*_excess)[n] = (*_supply)[n]; |
489 | 489 |
} |
... | ... |
@@ -353,58 +353,58 @@ |
353 | 353 |
/// of course. |
354 | 354 |
/// \return <tt>(*this)</tt> |
355 | 355 |
Preflow& elevator(Elevator& elevator) { |
356 | 356 |
if (_local_level) { |
357 | 357 |
delete _level; |
358 | 358 |
_local_level = false; |
359 | 359 |
} |
360 | 360 |
_level = &elevator; |
361 | 361 |
return *this; |
362 | 362 |
} |
363 | 363 |
|
364 | 364 |
/// \brief Returns a const reference to the elevator. |
365 | 365 |
/// |
366 | 366 |
/// Returns a const reference to the elevator. |
367 | 367 |
/// |
368 | 368 |
/// \pre Either \ref run() or \ref init() must be called before |
369 | 369 |
/// using this function. |
370 | 370 |
const Elevator& elevator() const { |
371 | 371 |
return *_level; |
372 | 372 |
} |
373 | 373 |
|
374 | 374 |
/// \brief Sets the tolerance used by algorithm. |
375 | 375 |
/// |
376 | 376 |
/// Sets the tolerance used by algorithm. |
377 |
Preflow& tolerance(const Tolerance& tolerance) |
|
377 |
Preflow& tolerance(const Tolerance& tolerance) { |
|
378 | 378 |
_tolerance = tolerance; |
379 | 379 |
return *this; |
380 | 380 |
} |
381 | 381 |
|
382 | 382 |
/// \brief Returns a const reference to the tolerance. |
383 | 383 |
/// |
384 | 384 |
/// Returns a const reference to the tolerance. |
385 | 385 |
const Tolerance& tolerance() const { |
386 |
return |
|
386 |
return _tolerance; |
|
387 | 387 |
} |
388 | 388 |
|
389 | 389 |
/// \name Execution Control |
390 | 390 |
/// The simplest way to execute the preflow algorithm is to use |
391 | 391 |
/// \ref run() or \ref runMinCut().\n |
392 | 392 |
/// If you need more control on the initial solution or the execution, |
393 | 393 |
/// first you have to call one of the \ref init() functions, then |
394 | 394 |
/// \ref startFirstPhase() and if you need it \ref startSecondPhase(). |
395 | 395 |
|
396 | 396 |
///@{ |
397 | 397 |
|
398 | 398 |
/// \brief Initializes the internal data structures. |
399 | 399 |
/// |
400 | 400 |
/// Initializes the internal data structures and sets the initial |
401 | 401 |
/// flow to zero on each arc. |
402 | 402 |
void init() { |
403 | 403 |
createStructures(); |
404 | 404 |
|
405 | 405 |
_phase = true; |
406 | 406 |
for (NodeIt n(_graph); n != INVALID; ++n) { |
407 | 407 |
(*_excess)[n] = 0; |
408 | 408 |
} |
409 | 409 |
|
410 | 410 |
for (ArcIt e(_graph); e != INVALID; ++e) { |
0 comments (0 inline)