Negate the meaning of the delta parameter
authoralpar
Tue, 05 Jun 2007 17:27:54 +0000
changeset 2450719220885b90
parent 2449 1d685ac667ec
child 2451 d7b7048e045b
Negate the meaning of the delta parameter
lemon/circulation.h
     1.1 --- a/lemon/circulation.h	Tue Jun 05 17:24:35 2007 +0000
     1.2 +++ b/lemon/circulation.h	Tue Jun 05 17:27:54 2007 +0000
     1.3 @@ -37,7 +37,7 @@
     1.4    ///This class implements a preflow algorithm
     1.5    ///for the Network Circulation Problem.
     1.6    ///The exact formulation of this problem is the following.
     1.7 -  /// \f[\sum_{e\in\rho(v)}x(e)-\sum_{e\in\delta(v)}x(e)\leq delta(v)\quad \forall v\in V \f]
     1.8 +  /// \f[\sum_{e\in\rho(v)}x(e)-\sum_{e\in\delta(v)}x(e)\leq -delta(v)\quad \forall v\in V \f]
     1.9    /// \f[ lo(e)\leq x(e) \leq up(e) \quad \forall e\in E \f]
    1.10    ///
    1.11    template<class Graph,
    1.12 @@ -95,7 +95,7 @@
    1.13       
    1.14        _x=_lo;
    1.15  
    1.16 -      for(NodeIt n(_g);n!=INVALID;++n) _excess[n]=-_delta[n];
    1.17 +      for(NodeIt n(_g);n!=INVALID;++n) _excess[n]=_delta[n];
    1.18  
    1.19        for(EdgeIt e(_g);e!=INVALID;++e)
    1.20  	{
    1.21 @@ -120,7 +120,7 @@
    1.22  	if(x[e]<_lo[e]||x[e]>_up[e]) return false;
    1.23        for(NodeIt n(_g);n!=INVALID;++n)
    1.24  	{
    1.25 -	  Value dif=_delta[n];
    1.26 +	  Value dif=-_delta[n];
    1.27  	  for(InEdgeIt e(_g,n);e!=INVALID;++e) dif-=x[e];
    1.28  	  for(OutEdgeIt e(_g,n);e!=INVALID;++e) dif+=x[e];
    1.29  	  if(_tol.negative(dif)) return false;
    1.30 @@ -140,7 +140,7 @@
    1.31        Value delta=0;
    1.32        for(NodeIt n(_g);n!=INVALID;++n)
    1.33  	if(bar[n])
    1.34 -	  delta+=_delta[n];
    1.35 +	  delta-=_delta[n];
    1.36        for(EdgeIt e(_g);e!=INVALID;++e)
    1.37  	{
    1.38  	  Node s=_g.source(e);
    1.39 @@ -279,7 +279,7 @@
    1.40      ///Return a barrier
    1.41      
    1.42      ///Barrier is a set \e B of nodes for which
    1.43 -    /// \f[ \sum_{v\in B}delta(v)<\sum_{e\in\rho(B)}lo(e)-\sum_{e\in\delta(B)}up(e) \f]
    1.44 +    /// \f[ \sum_{v\in B}-delta(v)<\sum_{e\in\rho(B)}lo(e)-\sum_{e\in\delta(B)}up(e) \f]
    1.45      ///holds. The existence of a set with this property prooves that a feasible
    1.46      ///flow cannot exists.
    1.47      ///\pre The run() must have been executed, and its return value was -1.