Changes in /[796:36857046492b:797:b7e3662faf02] in lemon

Ignore:
Files:
56 edited

Unmodified
Removed

• lemon/glpk.cc

 r623 int i = glp_add_rows(lp, 1); glp_set_row_bnds(lp, i, GLP_FR, 0.0, 0.0); return i; } int GlpkBase::_addRow(Value lo, ExprIterator b, ExprIterator e, Value up) { int i = glp_add_rows(lp, 1); if (lo == -INF) { if (up == INF) { glp_set_row_bnds(lp, i, GLP_FR, lo, up); } else { glp_set_row_bnds(lp, i, GLP_UP, lo, up); } } else { if (up == INF) { glp_set_row_bnds(lp, i, GLP_LO, lo, up); } else if (lo != up) { glp_set_row_bnds(lp, i, GLP_DB, lo, up); } else { glp_set_row_bnds(lp, i, GLP_FX, lo, up); } } std::vector indexes; std::vector values; indexes.push_back(0); values.push_back(0); for(ExprIterator it = b; it != e; ++it) { indexes.push_back(it->first); values.push_back(it->second); } glp_set_mat_row(lp, i, values.size() - 1, &indexes.front(), &values.front()); return i; }
• lemon/glpk.h

 r697 virtual int _addCol(); virtual int _addRow(); virtual int _addRow(Value l, ExprIterator b, ExprIterator e, Value u); virtual void _eraseCol(int i);
• lemon/gomory_hu.h

 r643 /// \c t. /// \code /// GomoruHu gom(g, capacities); /// GomoryHu gom(g, capacities); /// gom.run(); /// int cnt=0; /// for(GomoruHu::MinCutNodeIt n(gom,s,t); n!=INVALID; ++n) ++cnt; /// for(GomoryHu::MinCutNodeIt n(gom,s,t); n!=INVALID; ++n) ++cnt; /// \endcode class MinCutNodeIt /// \c t. /// \code /// GomoruHu gom(g, capacities); /// GomoryHu gom(g, capacities); /// gom.run(); /// int value=0; /// for(GomoruHu::MinCutEdgeIt e(gom,s,t); e!=INVALID; ++e) /// for(GomoryHu::MinCutEdgeIt e(gom,s,t); e!=INVALID; ++e) ///   value+=capacities[e]; /// \endcode
• lemon/grid_graph.h

 r664 /// \brief Grid graph class /// /// This class implements a special graph type. The nodes of the /// graph can be indexed by two integer \c (i,j) value where \c i is /// in the \c [0..width()-1] range and j is in the \c /// [0..height()-1] range. Two nodes are connected in the graph if /// the indexes differ exactly on one position and exactly one is /// the difference. The nodes of the graph can be indexed by position /// with the \c operator()() function. The positions of the nodes can be /// get with \c pos(), \c col() and \c row() members. The outgoing /// GridGraph implements a special graph type. The nodes of the /// graph can be indexed by two integer values \c (i,j) where \c i is /// in the range [0..width()-1] and j is in the range /// [0..height()-1]. Two nodes are connected in the graph if /// the indices differ exactly on one position and the difference is /// also exactly one. The nodes of the graph can be obtained by position /// using the \c operator()() function and the indices of the nodes can /// be obtained using \c pos(), \c col() and \c row() members. The outgoing /// arcs can be retrieved with the \c right(), \c up(), \c left() /// and \c down() functions, where the bottom-left corner is the /// origin. /// /// This class is completely static and it needs constant memory space. /// Thus you can neither add nor delete nodes or edges, however /// the structure can be resized using resize(). /// /// \image html grid_graph.png ///\endcode /// /// This graph type fully conforms to the \ref concepts::Graph /// "Graph concept". /// This type fully conforms to the \ref concepts::Graph "Graph concept". /// Most of its member functions and nested classes are documented /// only in the concept class. class GridGraph : public ExtendedGridGraphBase { typedef ExtendedGridGraphBase Parent; public: /// \brief Map to get the indices of the nodes as dim2::Point. /// /// Map to get the indices of the nodes as dim2::Point. /// \brief Map to get the indices of the nodes as \ref dim2::Point /// "dim2::Point". /// /// Map to get the indices of the nodes as \ref dim2::Point /// "dim2::Point". class IndexMap { public: /// \brief Constructor /// /// Constructor IndexMap(const GridGraph& graph) : _graph(graph) {} /// \brief The subscript operator /// /// The subscript operator. Value operator[](Key key) const { return _graph.pos(key); /// \brief Constructor /// /// Constructor ColMap(const GridGraph& graph) : _graph(graph) {} /// \brief The subscript operator /// /// The subscript operator. Value operator[](Key key) const { return _graph.col(key); /// \brief Constructor /// /// Constructor RowMap(const GridGraph& graph) : _graph(graph) {} /// \brief The subscript operator /// /// The subscript operator. Value operator[](Key key) const { return _graph.row(key); /// \brief Constructor /// /// Construct a grid graph with given size. /// Construct a grid graph with the given size. GridGraph(int width, int height) { construct(width, height); } /// \brief Resize the graph /// /// Resize the graph. The function will fully destroy and rebuild /// the graph.  This cause that the maps of the graph will /// reallocated automatically and the previous values will be /// lost. /// \brief Resizes the graph /// /// This function resizes the graph. It fully destroys and /// rebuilds the structure, therefore the maps of the graph will be /// reallocated automatically and the previous values will be lost. void resize(int width, int height) { Parent::notifier(Arc()).clear(); } /// \brief Gives back the column index of the node. /// \brief The column index of the node. /// /// Gives back the column index of the node. } /// \brief Gives back the row index of the node. /// \brief The row index of the node. /// /// Gives back the row index of the node. } /// \brief Gives back the position of the node. /// \brief The position of the node. /// /// Gives back the position of the node, ie. the (col,row) pair. } /// \brief Gives back the number of the columns. /// \brief The number of the columns. /// /// Gives back the number of the columns. } /// \brief Gives back the number of the rows. /// \brief The number of the rows. /// /// Gives back the number of the rows. } /// \brief Gives back the arc goes right from the node. /// \brief The arc goes right from the node. /// /// Gives back the arc goes right from the node. If there is not } /// \brief Gives back the arc goes left from the node. /// \brief The arc goes left from the node. /// /// Gives back the arc goes left from the node. If there is not } /// \brief Gives back the arc goes up from the node. /// \brief The arc goes up from the node. /// /// Gives back the arc goes up from the node. If there is not } /// \brief Gives back the arc goes down from the node. /// \brief The arc goes down from the node. /// /// Gives back the arc goes down from the node. If there is not
• lemon/hypercube_graph.h

 r664 /// \brief Hypercube graph class /// /// This class implements a special graph type. The nodes of the graph /// are indiced with integers with at most \c dim binary digits. /// HypercubeGraph implements a special graph type. The nodes of the /// graph are indexed with integers having at most \c dim binary digits. /// Two nodes are connected in the graph if and only if their indices /// differ only on one position in the binary form. /// This class is completely static and it needs constant memory space. /// Thus you can neither add nor delete nodes or edges, however /// the structure can be resized using resize(). /// /// This type fully conforms to the \ref concepts::Graph "Graph concept". /// Most of its member functions and nested classes are documented /// only in the concept class. /// /// \note The type of the indices is chosen to \c int for efficiency /// reasons. Thus the maximum dimension of this implementation is 26 /// (assuming that the size of \c int is 32 bit). /// /// This graph type fully conforms to the \ref concepts::Graph /// "Graph concept". class HypercubeGraph : public ExtendedHypercubeGraphBase { typedef ExtendedHypercubeGraphBase Parent; /// Constructs a hypercube graph with \c dim dimensions. HypercubeGraph(int dim) { construct(dim); } /// \brief Resizes the graph /// /// This function resizes the graph. It fully destroys and /// rebuilds the structure, therefore the maps of the graph will be /// reallocated automatically and the previous values will be lost. void resize(int dim) { Parent::notifier(Arc()).clear(); Parent::notifier(Edge()).clear(); Parent::notifier(Node()).clear(); construct(dim); Parent::notifier(Node()).build(); Parent::notifier(Edge()).build(); Parent::notifier(Arc()).build(); } /// \brief The number of dimensions. /// /// Gives back the dimension id of the given edge. /// It is in the [0..dim-1] range. /// It is in the range [0..dim-1]. int dimension(Edge edge) const { return Parent::dimension(edge); /// /// Gives back the dimension id of the given arc. /// It is in the [0..dim-1] range. /// It is in the range [0..dim-1]. int dimension(Arc arc) const { return Parent::dimension(arc);