lemon/network_simplex.h
changeset 729 be48a648d28f
parent 663 8b0df68370a4
child 730 4a45c8808b33
equal deleted inserted replaced
15:8729eb5cd438 18:126e8803c465
   159     
   159     
   160   private:
   160   private:
   161 
   161 
   162     TEMPLATE_DIGRAPH_TYPEDEFS(GR);
   162     TEMPLATE_DIGRAPH_TYPEDEFS(GR);
   163 
   163 
   164     typedef std::vector<Arc> ArcVector;
       
   165     typedef std::vector<Node> NodeVector;
       
   166     typedef std::vector<int> IntVector;
   164     typedef std::vector<int> IntVector;
   167     typedef std::vector<bool> BoolVector;
   165     typedef std::vector<bool> BoolVector;
   168     typedef std::vector<Value> ValueVector;
   166     typedef std::vector<Value> ValueVector;
   169     typedef std::vector<Cost> CostVector;
   167     typedef std::vector<Cost> CostVector;
   170 
   168 
   683         _source[i] = _node_id[_graph.source(a)];
   681         _source[i] = _node_id[_graph.source(a)];
   684         _target[i] = _node_id[_graph.target(a)];
   682         _target[i] = _node_id[_graph.target(a)];
   685         if ((i += k) >= _arc_num) i = (i % k) + 1;
   683         if ((i += k) >= _arc_num) i = (i % k) + 1;
   686       }
   684       }
   687       
   685       
   688       // Initialize maps
   686       // Reset parameters
   689       for (int i = 0; i != _node_num; ++i) {
   687       reset();
   690         _supply[i] = 0;
       
   691       }
       
   692       for (int i = 0; i != _arc_num; ++i) {
       
   693         _lower[i] = 0;
       
   694         _upper[i] = INF;
       
   695         _cost[i] = 1;
       
   696       }
       
   697       _have_lower = false;
       
   698       _stype = GEQ;
       
   699     }
   688     }
   700 
   689 
   701     /// \name Parameters
   690     /// \name Parameters
   702     /// The parameters of the algorithm can be specified using these
   691     /// The parameters of the algorithm can be specified using these
   703     /// functions.
   692     /// functions.
   766     /// \brief Set the supply values of the nodes.
   755     /// \brief Set the supply values of the nodes.
   767     ///
   756     ///
   768     /// This function sets the supply values of the nodes.
   757     /// This function sets the supply values of the nodes.
   769     /// If neither this function nor \ref stSupply() is used before
   758     /// If neither this function nor \ref stSupply() is used before
   770     /// calling \ref run(), the supply of each node will be set to zero.
   759     /// calling \ref run(), the supply of each node will be set to zero.
   771     /// (It makes sense only if non-zero lower bounds are given.)
       
   772     ///
   760     ///
   773     /// \param map A node map storing the supply values.
   761     /// \param map A node map storing the supply values.
   774     /// Its \c Value type must be convertible to the \c Value type
   762     /// Its \c Value type must be convertible to the \c Value type
   775     /// of the algorithm.
   763     /// of the algorithm.
   776     ///
   764     ///
   787     ///
   775     ///
   788     /// This function sets a single source node and a single target node
   776     /// This function sets a single source node and a single target node
   789     /// and the required flow value.
   777     /// and the required flow value.
   790     /// If neither this function nor \ref supplyMap() is used before
   778     /// If neither this function nor \ref supplyMap() is used before
   791     /// calling \ref run(), the supply of each node will be set to zero.
   779     /// calling \ref run(), the supply of each node will be set to zero.
   792     /// (It makes sense only if non-zero lower bounds are given.)
       
   793     ///
   780     ///
   794     /// Using this function has the same effect as using \ref supplyMap()
   781     /// Using this function has the same effect as using \ref supplyMap()
   795     /// with such a map in which \c k is assigned to \c s, \c -k is
   782     /// with such a map in which \c k is assigned to \c s, \c -k is
   796     /// assigned to \c t and all other nodes have zero supply value.
   783     /// assigned to \c t and all other nodes have zero supply value.
   797     ///
   784     ///