# Changeset 318:2cc60866a0c9 in lemon-1.0

Ignore:
Timestamp:
10/09/08 13:27:35 (16 years ago)
Branch:
default
Phase:
public
Message:

Doc reorganization + improvements

• Reorganize several tools (move them to other modules).
• Add new module for map concepts.
• Remove the doc of all tools in lemon/bits.
• Improvements in groups.dox.
• Fix some doxygen warnings.
Files:
17 edited

Unmodified
Added
Removed
• ## doc/groups.dox

 r236 You are free to use the graph structure that fit your requirements the best, most graph algorithms and auxiliary data structures can be used with any graph structures. with any graph structure. See also: \ref graph_concepts "Graph Structure Concepts". */ This group describes the map structures implemented in LEMON. LEMON provides several special purpose maps that e.g. combine LEMON provides several special purpose maps and map adaptors that e.g. combine new maps from existing ones. See also: \ref map_concepts "Map Concepts". */ values to the nodes and arcs of graphs. */ /** algorithms.  If a function type algorithm is called then the function type map adaptors can be used comfortable. For example let's see the usage of map adaptors with the \c digraphToEps() function. usage of map adaptors with the \c graphToEps() function. \code Color nodeColor(int deg) { Digraph::NodeMap degree_map(graph); digraphToEps(graph, "graph.eps") graphToEps(graph, "graph.eps") .coords(coords).scaleToA4().undirected() .nodeColors(composeMap(functorToMap(nodeColor), degree_map)) \endcode The \c functorToMap() function makes an \c int to \c Color map from the \e nodeColor() function. The \c composeMap() compose the \e degree_map \c nodeColor() function. The \c composeMap() compose the \c degree_map and the previously created map. The composed map is a proper function to get the color of each node. \sa lemon::concepts::Path */ */ /** @defgroup algs Algorithms This group describes the common graph search algorithms like Breadth-first search (Bfs) and Depth-first search (Dfs). */ /** @defgroup shortest_path Shortest Path algorithms Breadth-First Search (BFS) and Depth-First Search (DFS). */ /** @defgroup shortest_path Shortest Path Algorithms @ingroup algs \brief Algorithms for finding shortest paths. /** @defgroup max_flow Maximum Flow algorithms @defgroup max_flow Maximum Flow Algorithms @ingroup algs \brief Algorithms for finding maximum flows. provides functions to query the minimum cut, which is the dual linear programming problem of the maximum flow. */ /** @defgroup min_cost_flow Minimum Cost Flow algorithms */ /** @defgroup min_cost_flow Minimum Cost Flow Algorithms @ingroup algs /** @defgroup min_cut Minimum Cut algorithms @defgroup min_cut Minimum Cut Algorithms @ingroup algs If you want to find minimum cut just between two distinict nodes, please see the \ref max_flow "Maximum Flow page". */ /** @defgroup graph_prop Connectivity and other graph properties */ /** @defgroup graph_prop Connectivity and Other Graph Properties @ingroup algs \brief Algorithms for discovering the graph properties /** @defgroup planar Planarity embedding and drawing @defgroup planar Planarity Embedding and Drawing @ingroup algs \brief Algorithms for planarity checking, embedding and drawing /** @defgroup matching Matching algorithms @defgroup matching Matching Algorithms @ingroup algs \brief Algorithms for finding matchings in graphs and bipartite graphs. \image html bipartite_matching.png \image latex bipartite_matching.eps "Bipartite Matching" width=\textwidth */ /** @defgroup spantree Minimum Spanning Tree algorithms */ /** @defgroup spantree Minimum Spanning Tree Algorithms @ingroup algs \brief Algorithms for finding a minimum cost spanning tree in a graph. */ /** @defgroup auxalg Auxiliary algorithms /** @defgroup auxalg Auxiliary Algorithms @ingroup algs \brief Auxiliary algorithms implemented in LEMON. /** @defgroup approx Approximation algorithms @defgroup approx Approximation Algorithms @ingroup algs \brief Approximation algorithms. This group describes some general optimization frameworks implemented in LEMON. */ /** @defgroup lp_group Lp and Mip solvers */ /** @defgroup lp_group Lp and Mip Solvers @ingroup gen_opt_group \brief Lp and Mip solver interfaces for LEMON. various LP solvers could be used in the same manner with this interface. */ /** @defgroup lp_utils Tools for Lp and Mip solvers */ /** @defgroup lp_utils Tools for Lp and Mip Solvers @ingroup lp_group \brief Helper tools to the Lp and Mip solvers. /** @defgroup timecount Time measuring and Counting @defgroup timecount Time Measuring and Counting @ingroup misc \brief Simple tools for measuring the performance of algorithms. This group describes simple tools for measuring the performance of algorithms. */ /** @defgroup graphbits Tools for Graph Implementation @ingroup utils \brief Tools to make it easier to create graphs. This group describes the tools that makes it easier to create graphs and the maps that dynamically update with the graph changes. */ This group describes the tools for importing and exporting graphs and graph related data. Now it supports the LEMON format, the \c DIMACS format and the encapsulated postscript (EPS) format. and graph related data. Now it supports the \ref lgf-format "LEMON Graph Format", the \c DIMACS format and the encapsulated postscript (EPS) format. */ @defgroup lemon_io LEMON Input-Output @ingroup io_group \brief Reading and writing \ref lgf-format "LEMON Graph Format". \brief Reading and writing LEMON Graph Format. This group describes methods for reading and writing /** @defgroup eps_io Postscript exporting @defgroup eps_io Postscript Exporting @ingroup io_group \brief General \c EPS drawer and graph exporter graph exporting tools. */ /** - Finally, They can serve as a skeleton of a new implementation of a concept. */ */ /** */ /* --- Unused group @defgroup experimental Experimental Structures and Algorithms This group describes some Experimental structures and algorithms. The stuff here is subject to change. /** @defgroup map_concepts Map Concepts @ingroup concept \brief Skeleton and concept checking classes for maps This group describes the skeletons and concept checking classes of maps. */
• ## doc/mainpage.dox

 r311 If you want to see how LEMON works, see some \ref demoprograms "demo programs"! some \ref demoprograms "demo programs". If you know what you are looking for then try to find it under the section. If you are a user of the old (0.x) series of LEMON, please check out the \ref migration "Migration Guide" for the backward incompatibilities. If you are a user of the old (0.x) series of LEMON, please check out the \ref migration "Migration Guide" for the backward incompatibilities. */
• ## doc/migration.dox

 r312 in strings, comments etc. as well as in all identifiers. \section migration-lgf LGF tools \section migration-lgf LGF tools - The \ref lgf-format "LGF file format" has changed, \@nodeset has changed to \@nodes,
• ## lemon/bits/alteration_notifier.h

 r317 #include ///\ingroup graphbits ///\file ///\brief Observer notifier for graph alteration observers. //\ingroup graphbits //\file //\brief Observer notifier for graph alteration observers. namespace lemon { /// \ingroup graphbits /// /// \brief Notifier class to notify observes about alterations in /// a container. /// /// The simple graph's can be refered as two containers, one node container /// and one edge container. But they are not standard containers they /// does not store values directly they are just key continars for more /// value containers which are the node and edge maps. /// /// The graph's node and edge sets can be changed as we add or erase /// nodes and edges in the graph. LEMON would like to handle easily /// that the node and edge maps should contain values for all nodes or /// edges. If we want to check on every indicing if the map contains /// the current indicing key that cause a drawback in the performance /// in the library. We use another solution we notify all maps about /// an alteration in the graph, which cause only drawback on the /// alteration of the graph. /// /// This class provides an interface to the container. The \e first() and \e /// next() member functions make possible to iterate on the keys of the /// container. The \e id() function returns an integer id for each key. /// The \e maxId() function gives back an upper bound of the ids. /// /// For the proper functonality of this class, we should notify it /// about each alteration in the container. The alterations have four type /// as \e add(), \e erase(), \e build() and \e clear(). The \e add() and /// \e erase() signals that only one or few items added or erased to or /// from the graph. If all items are erased from the graph or from an empty /// graph a new graph is builded then it can be signaled with the /// clear() and build() members. Important rule that if we erase items /// from graph we should first signal the alteration and after that erase /// them from the container, on the other way on item addition we should /// first extend the container and just after that signal the alteration. /// /// The alteration can be observed with a class inherited from the /// \e ObserverBase nested class. The signals can be handled with /// overriding the virtual functions defined in the base class.  The /// observer base can be attached to the notifier with the /// \e attach() member and can be detached with detach() function. The /// alteration handlers should not call any function which signals /// an other alteration in the same notifier and should not /// detach any observer from the notifier. /// /// Alteration observers try to be exception safe. If an \e add() or /// a \e clear() function throws an exception then the remaining /// observeres will not be notified and the fulfilled additions will /// be rolled back by calling the \e erase() or \e clear() /// functions. Thence the \e erase() and \e clear() should not throw /// exception. Actullay, it can be throw only \ref ImmediateDetach /// exception which detach the observer from the notifier. /// /// There are some place when the alteration observing is not completly /// reliable. If we want to carry out the node degree in the graph /// as in the \ref InDegMap and we use the reverseEdge that cause /// unreliable functionality. Because the alteration observing signals /// only erasing and adding but not the reversing it will stores bad /// degrees. The sub graph adaptors cannot signal the alterations because /// just a setting in the filter map can modify the graph and this cannot /// be watched in any way. /// /// \param _Container The container which is observed. /// \param _Item The item type which is obserbved. // \ingroup graphbits // // \brief Notifier class to notify observes about alterations in // a container. // // The simple graph's can be refered as two containers, one node container // and one edge container. But they are not standard containers they // does not store values directly they are just key continars for more // value containers which are the node and edge maps. // // The graph's node and edge sets can be changed as we add or erase // nodes and edges in the graph. LEMON would like to handle easily // that the node and edge maps should contain values for all nodes or // edges. If we want to check on every indicing if the map contains // the current indicing key that cause a drawback in the performance // in the library. We use another solution we notify all maps about // an alteration in the graph, which cause only drawback on the // alteration of the graph. // // This class provides an interface to the container. The \e first() and \e // next() member functions make possible to iterate on the keys of the // container. The \e id() function returns an integer id for each key. // The \e maxId() function gives back an upper bound of the ids. // // For the proper functonality of this class, we should notify it // about each alteration in the container. The alterations have four type // as \e add(), \e erase(), \e build() and \e clear(). The \e add() and // \e erase() signals that only one or few items added or erased to or // from the graph. If all items are erased from the graph or from an empty // graph a new graph is builded then it can be signaled with the // clear() and build() members. Important rule that if we erase items // from graph we should first signal the alteration and after that erase // them from the container, on the other way on item addition we should // first extend the container and just after that signal the alteration. // // The alteration can be observed with a class inherited from the // \e ObserverBase nested class. The signals can be handled with // overriding the virtual functions defined in the base class.  The // observer base can be attached to the notifier with the // \e attach() member and can be detached with detach() function. The // alteration handlers should not call any function which signals // an other alteration in the same notifier and should not // detach any observer from the notifier. // // Alteration observers try to be exception safe. If an \e add() or // a \e clear() function throws an exception then the remaining // observeres will not be notified and the fulfilled additions will // be rolled back by calling the \e erase() or \e clear() // functions. Thence the \e erase() and \e clear() should not throw // exception. Actullay, it can be throw only \ref ImmediateDetach // exception which detach the observer from the notifier. // // There are some place when the alteration observing is not completly // reliable. If we want to carry out the node degree in the graph // as in the \ref InDegMap and we use the reverseEdge that cause // unreliable functionality. Because the alteration observing signals // only erasing and adding but not the reversing it will stores bad // degrees. The sub graph adaptors cannot signal the alterations because // just a setting in the filter map can modify the graph and this cannot // be watched in any way. // // \param _Container The container which is observed. // \param _Item The item type which is obserbved. template typedef _Item Item; /// \brief Exception which can be called from \e clear() and /// \e erase(). /// /// From the \e clear() and \e erase() function only this /// exception is allowed to throw. The exception immediatly /// detaches the current observer from the notifier. Because the /// \e clear() and \e erase() should not throw other exceptions /// it can be used to invalidate the observer. // \brief Exception which can be called from \e clear() and // \e erase(). // // From the \e clear() and \e erase() function only this // exception is allowed to throw. The exception immediatly // detaches the current observer from the notifier. Because the // \e clear() and \e erase() should not throw other exceptions // it can be used to invalidate the observer. struct ImmediateDetach {}; /// \brief ObserverBase is the base class for the observers. /// /// ObserverBase is the abstract base class for the observers. /// It will be notified about an item was inserted into or /// erased from the graph. /// /// The observer interface contains some pure virtual functions /// to override. The add() and erase() functions are /// to notify the oberver when one item is added or /// erased. /// /// The build() and clear() members are to notify the observer /// about the container is built from an empty container or /// is cleared to an empty container. // \brief ObserverBase is the base class for the observers. // // ObserverBase is the abstract base class for the observers. // It will be notified about an item was inserted into or // erased from the graph. // // The observer interface contains some pure virtual functions // to override. The add() and erase() functions are // to notify the oberver when one item is added or // erased. // // The build() and clear() members are to notify the observer // about the container is built from an empty container or // is cleared to an empty container. class ObserverBase { protected: friend class AlterationNotifier; /// \brief Default constructor. /// /// Default constructor for ObserverBase. /// // \brief Default constructor. // // Default constructor for ObserverBase. ObserverBase() : _notifier(0) {} /// \brief Constructor which attach the observer into notifier. /// /// Constructor which attach the observer into notifier. // \brief Constructor which attach the observer into notifier. // // Constructor which attach the observer into notifier. ObserverBase(AlterationNotifier& nf) { attach(nf); } /// \brief Constructor which attach the obserever to the same notifier. /// /// Constructor which attach the obserever to the same notifier as /// the other observer is attached to. // \brief Constructor which attach the obserever to the same notifier. // // Constructor which attach the obserever to the same notifier as // the other observer is attached to. ObserverBase(const ObserverBase& copy) { if (copy.attached()) { } /// \brief Destructor // \brief Destructor virtual ~ObserverBase() { if (attached()) { } /// \brief Attaches the observer into an AlterationNotifier. /// /// This member attaches the observer into an AlterationNotifier. /// // \brief Attaches the observer into an AlterationNotifier. // // This member attaches the observer into an AlterationNotifier. void attach(AlterationNotifier& nf) { nf.attach(*this); } /// \brief Detaches the observer into an AlterationNotifier. /// /// This member detaches the observer from an AlterationNotifier. /// // \brief Detaches the observer into an AlterationNotifier. // // This member detaches the observer from an AlterationNotifier. void detach() { _notifier->detach(*this); } /// \brief Gives back a pointer to the notifier which the map /// attached into. /// /// This function gives back a pointer to the notifier which the map /// attached into. /// // \brief Gives back a pointer to the notifier which the map // attached into. // // This function gives back a pointer to the notifier which the map // attached into. Notifier* notifier() const { return const_cast(_notifier); } /// Gives back true when the observer is attached into a notifier. // Gives back true when the observer is attached into a notifier. bool attached() const { return _notifier != 0; } typename std::list::iterator _index; /// \brief The member function to notificate the observer about an /// item is added to the container. /// /// The add() member function notificates the observer about an item /// is added to the container. It have to be overrided in the /// subclasses. // \brief The member function to notificate the observer about an // item is added to the container. // // The add() member function notificates the observer about an item // is added to the container. It have to be overrided in the // subclasses. virtual void add(const Item&) = 0; /// \brief The member function to notificate the observer about /// more item is added to the container. /// /// The add() member function notificates the observer about more item /// is added to the container. It have to be overrided in the /// subclasses. // \brief The member function to notificate the observer about // more item is added to the container. // // The add() member function notificates the observer about more item // is added to the container. It have to be overrided in the // subclasses. virtual void add(const std::vector& items) = 0; /// \brief The member function to notificate the observer about an /// item is erased from the container. /// /// The erase() member function notificates the observer about an /// item is erased from the container. It have to be overrided in /// the subclasses. // \brief The member function to notificate the observer about an // item is erased from the container. // // The erase() member function notificates the observer about an // item is erased from the container. It have to be overrided in // the subclasses. virtual void erase(const Item&) = 0; /// \brief The member function to notificate the observer about /// more item is erased from the container. /// /// The erase() member function notificates the observer about more item /// is erased from the container. It have to be overrided in the /// subclasses. // \brief The member function to notificate the observer about // more item is erased from the container. // // The erase() member function notificates the observer about more item // is erased from the container. It have to be overrided in the // subclasses. virtual void erase(const std::vector& items) = 0; /// \brief The member function to notificate the observer about the /// container is built. /// /// The build() member function notificates the observer about the /// container is built from an empty container. It have to be /// overrided in the subclasses. // \brief The member function to notificate the observer about the // container is built. // // The build() member function notificates the observer about the // container is built from an empty container. It have to be // overrided in the subclasses. virtual void build() = 0; /// \brief The member function to notificate the observer about all /// items are erased from the container. /// /// The clear() member function notificates the observer about all /// items are erased from the container. It have to be overrided in /// the subclasses. // \brief The member function to notificate the observer about all // items are erased from the container. // // The clear() member function notificates the observer about all // items are erased from the container. It have to be overrided in // the subclasses. virtual void clear() = 0; public: /// \brief Default constructor. /// /// The default constructor of the AlterationNotifier. /// It creates an empty notifier. // \brief Default constructor. // // The default constructor of the AlterationNotifier. // It creates an empty notifier. AlterationNotifier() : container(0) {} /// \brief Constructor. /// /// Constructor with the observed container parameter. // \brief Constructor. // // Constructor with the observed container parameter. AlterationNotifier(const Container& _container) : container(&_container) {} /// \brief Copy Constructor of the AlterationNotifier. /// /// Copy constructor of the AlterationNotifier. /// It creates only an empty notifier because the copiable /// notifier's observers have to be registered still into that notifier. // \brief Copy Constructor of the AlterationNotifier. // // Copy constructor of the AlterationNotifier. // It creates only an empty notifier because the copiable // notifier's observers have to be registered still into that notifier. AlterationNotifier(const AlterationNotifier& _notifier) : container(_notifier.container) {} /// \brief Destructor. /// /// Destructor of the AlterationNotifier. /// // \brief Destructor. // // Destructor of the AlterationNotifier. ~AlterationNotifier() { typename Observers::iterator it; } /// \brief Sets the container. /// /// Sets the container. // \brief Sets the container. // // Sets the container. void setContainer(const Container& _container) { container = &_container; public: /// \brief First item in the container. /// /// Returns the first item in the container. It is /// for start the iteration on the container. // \brief First item in the container. // // Returns the first item in the container. It is // for start the iteration on the container. void first(Item& item) const { container->first(item); } /// \brief Next item in the container. /// /// Returns the next item in the container. It is /// for iterate on the container. // \brief Next item in the container. // // Returns the next item in the container. It is // for iterate on the container. void next(Item& item) const { container->next(item); } /// \brief Returns the id of the item. /// /// Returns the id of the item provided by the container. // \brief Returns the id of the item. // // Returns the id of the item provided by the container. int id(const Item& item) const { return container->id(item); } /// \brief Returns the maximum id of the container. /// /// Returns the maximum id of the container. // \brief Returns the maximum id of the container. // // Returns the maximum id of the container. int maxId() const { return container->maxId(Item()); public: /// \brief Notifies all the registed observers about an item added to /// the container. /// /// It notifies all the registed observers about an item added to /// the container. /// // \brief Notifies all the registed observers about an item added to // the container. // // It notifies all the registed observers about an item added to // the container. void add(const Item& item) { typename Observers::reverse_iterator it; } /// \brief Notifies all the registed observers about more item added to /// the container. /// /// It notifies all the registed observers about more item added to /// the container. /// // \brief Notifies all the registed observers about more item added to // the container. // // It notifies all the registed observers about more item added to // the container. void add(const std::vector& items) { typename Observers::reverse_iterator it; } /// \brief Notifies all the registed observers about an item erased from /// the container. /// /// It notifies all the registed observers about an item erased from /// the container. /// // \brief Notifies all the registed observers about an item erased from // the container. // // It notifies all the registed observers about an item erased from // the container. void erase(const Item& item) throw() { typename Observers::iterator it = _observers.begin(); } /// \brief Notifies all the registed observers about more item erased /// from the container. /// /// It notifies all the registed observers about more item erased from /// the container. /// // \brief Notifies all the registed observers about more item erased // from the container. // // It notifies all the registed observers about more item erased from // the container. void erase(const std::vector& items) { typename Observers::iterator it = _observers.begin(); } /// \brief Notifies all the registed observers about the container is /// built. /// /// Notifies all the registed observers about the container is built /// from an empty container. // \brief Notifies all the registed observers about the container is // built. // // Notifies all the registed observers about the container is built // from an empty container. void build() { typename Observers::reverse_iterator it; } /// \brief Notifies all the registed observers about all items are /// erased. /// /// Notifies all the registed observers about all items are erased /// from the container. // \brief Notifies all the registed observers about all items are // erased. // // Notifies all the registed observers about all items are erased // from the container. void clear() { typename Observers::iterator it = _observers.begin();
• ## lemon/bits/array_map.h

 r263 #include /// \ingroup graphbits /// \file /// \brief Graph map based on the array storage. // \ingroup graphbits // \file // \brief Graph map based on the array storage. namespace lemon { /// \ingroup graphbits /// /// \brief Graph map based on the array storage. /// /// The ArrayMap template class is graph map structure what /// automatically updates the map when a key is added to or erased from /// the map. This map uses the allocators to implement /// the container functionality. /// /// The template parameters are the Graph the current Item type and /// the Value type of the map. // \ingroup graphbits // // \brief Graph map based on the array storage. // // The ArrayMap template class is graph map structure what // automatically updates the map when a key is added to or erased from // the map. This map uses the allocators to implement // the container functionality. // // The template parameters are the Graph the current Item type and // the Value type of the map. template class ArrayMap : public ItemSetTraits<_Graph, _Item>::ItemNotifier::ObserverBase { public: /// The graph type of the maps. // The graph type of the maps. typedef _Graph Graph; /// The item type of the map. // The item type of the map. typedef _Item Item; /// The reference map tag. // The reference map tag. typedef True ReferenceMapTag; /// The key type of the maps. // The key type of the maps. typedef _Item Key; /// The value type of the map. // The value type of the map. typedef _Value Value; /// The const reference type of the map. // The const reference type of the map. typedef const _Value& ConstReference; /// The reference type of the map. // The reference type of the map. typedef _Value& Reference; /// The notifier type. // The notifier type. typedef typename ItemSetTraits<_Graph, _Item>::ItemNotifier Notifier; /// The MapBase of the Map which imlements the core regisitry function. // The MapBase of the Map which imlements the core regisitry function. typedef typename Notifier::ObserverBase Parent; public: /// \brief Graph initialized map constructor. /// /// Graph initialized map constructor. // \brief Graph initialized map constructor. // // Graph initialized map constructor. explicit ArrayMap(const Graph& graph) { Parent::attach(graph.notifier(Item())); } /// \brief Constructor to use default value to initialize the map. /// /// It constructs a map and initialize all of the the map. // \brief Constructor to use default value to initialize the map. // // It constructs a map and initialize all of the the map. ArrayMap(const Graph& graph, const Value& value) { Parent::attach(graph.notifier(Item())); private: /// \brief Constructor to copy a map of the same map type. /// /// Constructor to copy a map of the same map type. // \brief Constructor to copy a map of the same map type. // // Constructor to copy a map of the same map type. ArrayMap(const ArrayMap& copy) : Parent() { if (copy.attached()) { } /// \brief Assign operator. /// /// This operator assigns for each item in the map the /// value mapped to the same item in the copied map. /// The parameter map should be indiced with the same /// itemset because this assign operator does not change /// the container of the map. // \brief Assign operator. // // This operator assigns for each item in the map the // value mapped to the same item in the copied map. // The parameter map should be indiced with the same // itemset because this assign operator does not change // the container of the map. ArrayMap& operator=(const ArrayMap& cmap) { return operator=(cmap); /// \brief Template assign operator. /// /// The given parameter should be conform to the ReadMap /// concecpt and could be indiced by the current item set of /// the NodeMap. In this case the value for each item /// is assigned by the value of the given ReadMap. // \brief Template assign operator. // // The given parameter should be conform to the ReadMap // concecpt and could be indiced by the current item set of // the NodeMap. In this case the value for each item // is assigned by the value of the given ReadMap. template ArrayMap& operator=(const CMap& cmap) { public: /// \brief The destructor of the map. /// /// The destructor of the map. // \brief The destructor of the map. // // The destructor of the map. virtual ~ArrayMap() { if (attached()) { public: /// \brief The subscript operator. /// /// The subscript operator. The map can be subscripted by the /// actual keys of the graph. // \brief The subscript operator. // // The subscript operator. The map can be subscripted by the // actual keys of the graph. Value& operator[](const Key& key) { int id = Parent::notifier()->id(key); } /// \brief The const subscript operator. /// /// The const subscript operator. The map can be subscripted by the /// actual keys of the graph. // \brief The const subscript operator. // // The const subscript operator. The map can be subscripted by the // actual keys of the graph. const Value& operator[](const Key& key) const { int id = Parent::notifier()->id(key); } /// \brief Setter function of the map. /// /// Setter function of the map. Equivalent with map[key] = val. /// This is a compatibility feature with the not dereferable maps. // \brief Setter function of the map. // // Setter function of the map. Equivalent with map[key] = val. // This is a compatibility feature with the not dereferable maps. void set(const Key& key, const Value& val) { (*this)[key] = val; protected: /// \brief Adds a new key to the map. /// /// It adds a new key to the map. It called by the observer notifier /// and it overrides the add() member function of the observer base. // \brief Adds a new key to the map. // // It adds a new key to the map. It called by the observer notifier // and it overrides the add() member function of the observer base. virtual void add(const Key& key) { Notifier* nf = Parent::notifier(); } /// \brief Adds more new keys to the map. /// /// It adds more new keys to the map. It called by the observer notifier /// and it overrides the add() member function of the observer base. // \brief Adds more new keys to the map. // // It adds more new keys to the map. It called by the observer notifier // and it overrides the add() member function of the observer base. virtual void add(const std::vector& keys) { Notifier* nf = Parent::notifier(); } /// \brief Erase a key from the map. /// /// Erase a key from the map. It called by the observer notifier /// and it overrides the erase() member function of the observer base. // \brief Erase a key from the map. // // Erase a key from the map. It called by the observer notifier // and it overrides the erase() member function of the observer base. virtual void erase(const Key& key) { int id = Parent::notifier()->id(key); } /// \brief Erase more keys from the map. /// /// Erase more keys from the map. It called by the observer notifier /// and it overrides the erase() member function of the observer base. // \brief Erase more keys from the map. // // Erase more keys from the map. It called by the observer notifier // and it overrides the erase() member function of the observer base. virtual void erase(const std::vector& keys) { for (int i = 0; i < int(keys.size()); ++i) { } /// \brief Buildes the map. /// /// It buildes the map. It called by the observer notifier /// and it overrides the build() member function of the observer base. // \brief Buildes the map. // // It buildes the map. It called by the observer notifier // and it overrides the build() member function of the observer base. virtual void build() { Notifier* nf = Parent::notifier(); } /// \brief Clear the map. /// /// It erase all items from the map. It called by the observer notifier /// and it overrides the clear() member function of the observer base. // \brief Clear the map. // // It erase all items from the map. It called by the observer notifier // and it overrides the clear() member function of the observer base. virtual void clear() { Notifier* nf = Parent::notifier();
• ## lemon/bits/base_extender.h

 r289 #include ///\ingroup digraphbits ///\file ///\brief Extenders for the digraph types //\ingroup digraphbits //\file //\brief Extenders for the digraph types namespace lemon { /// \ingroup digraphbits /// /// \brief BaseDigraph to BaseGraph extender // \ingroup digraphbits // // \brief BaseDigraph to BaseGraph extender template class UndirDigraphExtender : public Base { }; /// First node of the edge // First node of the edge Node u(const Edge &e) const { return Parent::source(e); } /// Source of the given arc // Source of the given arc Node source(const Arc &e) const { return e.forward ? Parent::source(e) : Parent::target(e); } /// Second node of the edge // Second node of the edge Node v(const Edge &e) const { return Parent::target(e); } /// Target of the given arc // Target of the given arc Node target(const Arc &e) const { return e.forward ? Parent::target(e) : Parent::source(e); } /// \brief Directed arc from an edge. /// /// Returns a directed arc corresponding to the specified edge. /// If the given bool is true, the first node of the given edge and /// the source node of the returned arc are the same. // \brief Directed arc from an edge. // // Returns a directed arc corresponding to the specified edge. // If the given bool is true, the first node of the given edge and // the source node of the returned arc are the same. static Arc direct(const Edge &e, bool d) { return Arc(e, d); } /// Returns whether the given directed arc has the same orientation /// as the corresponding edge. // Returns whether the given directed arc has the same orientation // as the corresponding edge. static bool direction(const Arc &a) { return a.forward; }
• ## lemon/bits/bezier.h

 r209 #define LEMON_BEZIER_H ///\ingroup misc ///\file ///\brief Classes to compute with Bezier curves. /// ///Up to now this file is used internally by \ref graph_to_eps.h //\ingroup misc //\file //\brief Classes to compute with Bezier curves. // //Up to now this file is used internally by \ref graph_to_eps.h #include
• ## lemon/bits/default_map.h

 r317 #define LEMON_BITS_DEFAULT_MAP_H #include #include //#include ///\ingroup graphbits ///\file ///\brief Graph maps that construct and destruct their elements dynamically. //\ingroup graphbits //\file //\brief Graph maps that construct and destruct their elements dynamically. namespace lemon { // #endif /// DefaultMap class // DefaultMap class template class DefaultMap
• ## lemon/bits/enable_if.h

 r220 #define LEMON_BITS_ENABLE_IF_H ///\file ///\brief Miscellaneous basic utilities //\file //\brief Miscellaneous basic utilities namespace lemon { /// Basic type for defining "tags". A "YES" condition for \c enable_if. // Basic type for defining "tags". A "YES" condition for \c enable_if. /// Basic type for defining "tags". A "YES" condition for \c enable_if. /// ///\sa False // Basic type for defining "tags". A "YES" condition for \c enable_if. // //\sa False struct True { ///\e //\e static const bool value = true; }; /// Basic type for defining "tags". A "NO" condition for \c enable_if. // Basic type for defining "tags". A "NO" condition for \c enable_if. /// Basic type for defining "tags". A "NO" condition for \c enable_if. /// ///\sa True // Basic type for defining "tags". A "NO" condition for \c enable_if. // //\sa True struct False { ///\e //\e static const bool value = false; };
• ## lemon/bits/graph_extender.h

 r263 #include ///\ingroup graphbits ///\file ///\brief Extenders for the digraph types //\ingroup graphbits //\file //\brief Extenders for the digraph types namespace lemon { /// \ingroup graphbits /// /// \brief Extender for the Digraphs // \ingroup graphbits // // \brief Extender for the Digraphs template class DigraphExtender : public Base { }; /// \brief Base node of the iterator /// /// Returns the base node (i.e. the source in this case) of the iterator // \brief Base node of the iterator // // Returns the base node (i.e. the source in this case) of the iterator Node baseNode(const OutArcIt &arc) const { return Parent::source(arc); } /// \brief Running node of the iterator /// /// Returns the running node (i.e. the target in this case) of the /// iterator // \brief Running node of the iterator // // Returns the running node (i.e. the target in this case) of the // iterator Node runningNode(const OutArcIt &arc) const { return Parent::target(arc); } /// \brief Base node of the iterator /// /// Returns the base node (i.e. the target in this case) of the iterator // \brief Base node of the iterator // // Returns the base node (i.e. the target in this case) of the iterator Node baseNode(const InArcIt &arc) const { return Parent::target(arc); } /// \brief Running node of the iterator /// /// Returns the running node (i.e. the source in this case) of the /// iterator // \brief Running node of the iterator // // Returns the running node (i.e. the source in this case) of the // iterator Node runningNode(const InArcIt &arc) const { return Parent::source(arc); }; /// \ingroup _graphbits /// /// \brief Extender for the Graphs // \ingroup _graphbits // // \brief Extender for the Graphs template class GraphExtender : public Base { }; /// \brief Base node of the iterator /// /// Returns the base node (ie. the source in this case) of the iterator // \brief Base node of the iterator // // Returns the base node (ie. the source in this case) of the iterator Node baseNode(const OutArcIt &arc) const { return Parent::source(static_cast(arc)); } /// \brief Running node of the iterator /// /// Returns the running node (ie. the target in this case) of the /// iterator // \brief Running node of the iterator // // Returns the running node (ie. the target in this case) of the // iterator Node runningNode(const OutArcIt &arc) const { return Parent::target(static_cast(arc)); } /// \brief Base node of the iterator /// /// Returns the base node (ie. the target in this case) of the iterator // \brief Base node of the iterator // // Returns the base node (ie. the target in this case) of the iterator Node baseNode(const InArcIt &arc) const { return Parent::target(static_cast(arc)); } /// \brief Running node of the iterator /// /// Returns the running node (ie. the source in this case) of the /// iterator // \brief Running node of the iterator // // Returns the running node (ie. the source in this case) of the // iterator Node runningNode(const InArcIt &arc) const { return Parent::source(static_cast(arc)); } /// Base node of the iterator /// /// Returns the base node of the iterator // Base node of the iterator // // Returns the base node of the iterator Node baseNode(const IncEdgeIt &edge) const { return edge._direction ? u(edge) : v(edge); } /// Running node of the iterator /// /// Returns the running node of the iterator // Running node of the iterator // // Returns the running node of the iterator Node runningNode(const IncEdgeIt &edge) const { return edge._direction ? v(edge) : u(edge);
• ## lemon/bits/map_extender.h

 r263 #include ///\file ///\brief Extenders for iterable maps. //\file //\brief Extenders for iterable maps. namespace lemon { /// \ingroup graphbits /// /// \brief Extender for maps // \ingroup graphbits // // \brief Extender for maps template class MapExtender : public _Map { }; /// \ingroup graphbits /// /// \brief Extender for maps which use a subset of the items. // \ingroup graphbits // // \brief Extender for maps which use a subset of the items. template class SubMapExtender : public _Map {
• ## lemon/bits/traits.h

 r220 #define LEMON_BITS_TRAITS_H ///\file ///\brief Traits for graphs and maps /// //\file //\brief Traits for graphs and maps // #include
• ## lemon/bits/vector_map.h

 r280 #include ///\ingroup graphbits /// ///\file ///\brief Vector based graph maps. //\ingroup graphbits // //\file //\brief Vector based graph maps. namespace lemon { /// \ingroup graphbits /// /// \brief Graph map based on the std::vector storage. /// /// The VectorMap template class is graph map structure what /// automatically updates the map when a key is added to or erased from /// the map. This map type uses the std::vector to store the values. /// /// \tparam _Graph The graph this map is attached to. /// \tparam _Item The item type of the graph items. /// \tparam _Value The value type of the map. // \ingroup graphbits // // \brief Graph map based on the std::vector storage. // // The VectorMap template class is graph map structure what // automatically updates the map when a key is added to or erased from // the map. This map type uses the std::vector to store the values. // // \tparam _Graph The graph this map is attached to. // \tparam _Item The item type of the graph items. // \tparam _Value The value type of the map. template class VectorMap private: /// The container type of the map. // The container type of the map. typedef std::vector<_Value> Container; public: /// The graph type of the map. // The graph type of the map. typedef _Graph Graph; /// The item type of the map. // The item type of the map. typedef _Item Item; /// The reference map tag. // The reference map tag. typedef True ReferenceMapTag; /// The key type of the map. // The key type of the map. typedef _Item Key; /// The value type of the map. // The value type of the map. typedef _Value Value; /// The notifier type. // The notifier type. typedef typename ItemSetTraits<_Graph, _Item>::ItemNotifier Notifier; /// The map type. // The map type. typedef VectorMap Map; /// The base class of the map. // The base class of the map. typedef typename Notifier::ObserverBase Parent; /// The reference type of the map; // The reference type of the map; typedef typename Container::reference Reference; /// The const reference type of the map; // The const reference type of the map; typedef typename Container::const_reference ConstReference; /// \brief Constructor to attach the new map into the notifier. /// /// It constructs a map and attachs it into the notifier. /// It adds all the items of the graph to the map. // \brief Constructor to attach the new map into the notifier. // // It constructs a map and attachs it into the notifier. // It adds all the items of the graph to the map. VectorMap(const Graph& graph) { Parent::attach(graph.notifier(Item())); } /// \brief Constructor uses given value to initialize the map. /// /// It constructs a map uses a given value to initialize the map. /// It adds all the items of the graph to the map. // \brief Constructor uses given value to initialize the map. // // It constructs a map uses a given value to initialize the map. // It adds all the items of the graph to the map. VectorMap(const Graph& graph, const Value& value) { Parent::attach(graph.notifier(Item())); private: /// \brief Copy constructor /// /// Copy constructor. // \brief Copy constructor // // Copy constructor. VectorMap(const VectorMap& _copy) : Parent() { if (_copy.attached()) { } /// \brief Assign operator. /// /// This operator assigns for each item in the map the /// value mapped to the same item in the copied map. /// The parameter map should be indiced with the same /// itemset because this assign operator does not change /// the container of the map. // \brief Assign operator. // // This operator assigns for each item in the map the // value mapped to the same item in the copied map. // The parameter map should be indiced with the same // itemset because this assign operator does not change // the container of the map. VectorMap& operator=(const VectorMap& cmap) { return operator=(cmap); /// \brief Template assign operator. /// /// The given parameter should be conform to the ReadMap /// concecpt and could be indiced by the current item set of /// the NodeMap. In this case the value for each item /// is assigned by the value of the given ReadMap. // \brief Template assign operator. // // The given parameter should be conform to the ReadMap // concecpt and could be indiced by the current item set of // the NodeMap. In this case the value for each item // is assigned by the value of the given ReadMap. template VectorMap& operator=(const CMap& cmap) { public: /// \brief The subcript operator. /// /// The subscript operator. The map can be subscripted by the /// actual items of the graph. // \brief The subcript operator. // // The subscript operator. The map can be subscripted by the // actual items of the graph. Reference operator[](const Key& key) { return container[Parent::notifier()->id(key)]; } /// \brief The const subcript operator. /// /// The const subscript operator. The map can be subscripted by the /// actual items of the graph. // \brief The const subcript operator. // // The const subscript operator. The map can be subscripted by the // actual items of the graph. ConstReference operator[](const Key& key) const { return container[Parent::notifier()->id(key)]; /// \brief The setter function of the map. /// /// It the same as operator[](key) = value expression. // \brief The setter function of the map. // // It the same as operator[](key) = value expression. void set(const Key& key, const Value& value) { (*this)[key] = value; protected: /// \brief Adds a new key to the map. /// /// It adds a new key to the map. It called by the observer notifier /// and it overrides the add() member function of the observer base. // \brief Adds a new key to the map. // // It adds a new key to the map. It called by the observer notifier // and it overrides the add() member function of the observer base. virtual void add(const Key& key) { int id = Parent::notifier()->id(key); } /// \brief Adds more new keys to the map. /// /// It adds more new keys to the map. It called by the observer notifier /// and it overrides the add() member function of the observer base. // \brief Adds more new keys to the map. // // It adds more new keys to the map. It called by the observer notifier // and it overrides the add() member function of the observer base. virtual void add(const std::vector& keys) { int max = container.size() - 1; } /// \brief Erase a key from the map. /// /// Erase a key from the map. It called by the observer notifier /// and it overrides the erase() member function of the observer base. // \brief Erase a key from the map. // // Erase a key from the map. It called by the observer notifier // and it overrides the erase() member function of the observer base. virtual void erase(const Key& key) { container[Parent::notifier()->id(key)] = Value(); } /// \brief Erase more keys from the map. /// /// Erase more keys from the map. It called by the observer notifier /// and it overrides the erase() member function of the observer base. // \brief Erase more keys from the map. // // Erase more keys from the map. It called by the observer notifier // and it overrides the erase() member function of the observer base. virtual void erase(const std::vector& keys) { for (int i = 0; i < int(keys.size()); ++i) { } /// \brief Buildes the map. /// /// It buildes the map. It called by the observer notifier /// and it overrides the build() member function of the observer base. // \brief Buildes the map. // // It buildes the map. It called by the observer notifier // and it overrides the build() member function of the observer base. virtual void build() { int size = Parent::notifier()->maxId() + 1; } /// \brief Clear the map. /// /// It erase all items from the map. It called by the observer notifier /// and it overrides the clear() member function of the observer base. // \brief Clear the map. // // It erase all items from the map. It called by the observer notifier // and it overrides the clear() member function of the observer base. virtual void clear() { container.clear();
• ## lemon/concepts/maps.h

 r220 #include ///\ingroup concept ///\ingroup map_concepts ///\file ///\brief The concept of maps. namespace concepts { /// \addtogroup concept /// \addtogroup map_concepts /// @{
• ## lemon/dim2.h

 r317 ///Map of x-coordinates of a \ref Point "Point"-map. ///\ingroup maps /// template class XMap ///This function just returns an XMap class. /// ///\ingroup maps ///\relates XMap template ///Constant (read only) version of XMap. ///\ingroup maps /// template class ConstXMap ///This function just returns a ConstXMap class. /// ///\ingroup maps ///\relates ConstXMap template ///Map of y-coordinates of a \ref Point "Point"-map. ///\ingroup maps /// template class YMap ///This function just returns a YMap class. /// ///\ingroup maps ///\relates YMap template ///Constant (read only) version of YMap. ///\ingroup maps /// template class ConstYMap ///This function just returns a ConstYMap class. /// ///\ingroup maps ///\relates ConstYMap template ///Map of the \ref Point::normSquare() "normSquare()" ///of a \ref Point "Point"-map. ///\ingroup maps template class NormSquareMap ///This function just returns a NormSquareMap class. /// ///\ingroup maps ///\relates NormSquareMap template
• ## lemon/maps.h

 r317 } /// @} /// \addtogroup maps /// @{ /// \brief Writable bool map for logging each \c true assigned element /// } /// @} /// \addtogroup graph_maps /// @{ /// Provides an immutable and unique id for each item in the graph. /// The value type of the InvertableMap. typedef typename Map::Value Value; /// \brief Constructor. return InverseMap(*this); } };
• ## lemon/time_measure.h

 r317 ///Basically a Timer can be either running or stopped, ///but it provides a bit finer control on the execution. ///The \ref lemon::Timer "Timer" also counts the number of ///\ref lemon::Timer::start() "start()" executions, and it stops ///The \ref lemon::Timer "Timer" also counts the number of ///\ref lemon::Timer::start() "start()" executions, and it stops ///only after the same amount (or more) \ref lemon::Timer::stop() ///"stop()"s. This can be useful e.g. to compute the running time
Note: See TracChangeset for help on using the changeset viewer.