Changeset 954:be7dd3a8d6a3 in lemon-1.2

Ignore:
Timestamp:
01/20/12 19:20:02 (8 years ago)
Branch:
1.2
Parents:
952:0976225b5cae (diff), 953:b873350e6258 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge Intel C++ compatibility fixes to branch 1.2

Files:
12 edited

Unmodified
Removed
• CMakeLists.txt

 r944 # C4996: 'function': was declared deprecated ELSE() SET(CXX_WARNING "-Wall -W") SET(CXX_WARNING "-Wall") ENDIF() ENDIF() SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${LEMON_CXX_WARNING_FLAGS}") SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb" CACHE STRING SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING "Flags used by the C++ compiler during maintainer builds." FORCE ) SET( CMAKE_C_FLAGS_MAINTAINER "-Werror" CACHE STRING SET( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING "Flags used by the C compiler during maintainer builds." FORCE )
• CMakeLists.txt

 r953 SET(LEMON_HAVE_LONG_LONG \${HAVE_LONG_LONG}) INCLUDE(FindPythonInterp) ENABLE_TESTING()
• lemon/bfs.h

 r877 } _Visitor& visitor; Constraints() {} }; };

• lemon/concepts/graph_components.h

 r877 const _GraphItem &ia; const _GraphItem &ib; Constraints() {} }; }; const _Digraph& digraph; Constraints() {} }; }; const _Graph& graph; Constraints() {} }; const _Digraph& digraph; Constraints() {} }; }; const _Graph& graph; Constraints() {} }; }; } const GR& g; Constraints() {} }; }; const Base& node; const GR& graph; Constraints() {} }; }; const _Digraph& digraph; Constraints() {} }; }; const _Graph& graph; Constraints() {} }; }; const _Digraph& digraph; Constraints() {} }; }; const _Graph& graph; Constraints() {} }; }; const GR &g; const typename GraphMap::Value &t; Constraints() {} }; const _Digraph& digraph; Constraints() {} }; }; const _Graph& graph; Constraints() {} }; }; _Digraph& digraph; Constraints() {} }; }; _Graph& graph; Constraints() {} }; }; _Digraph& digraph; Constraints() {} }; }; _Graph& graph; Constraints() {} }; }; _Digraph& digraph; Constraints() {} }; }; _Graph& graph; Constraints() {} }; };
• lemon/concepts/graph_components.h

 r953 * This file is a part of LEMON, a generic C++ optimization library. * * Copyright (C) 2003-2009 * Copyright (C) 2003-2010 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). ///\ingroup graph_concepts ///\file ///\brief The concept of graph components. ///\brief The concepts of graph components. #ifndef LEMON_CONCEPTS_GRAPH_COMPONENTS_H /// \note This class is a template class so that we can use it to /// create graph skeleton classes. The reason for this is that \c Node /// and \c Arc (or \c Edge) types should \e not derive from the same /// and \c Arc (or \c Edge) types should \e not derive from the same /// base class. For \c Node you should instantiate it with character /// \c 'n', for \c Arc with \c 'a' and for \c Edge with \c 'e'. /// /// This operator defines an ordering of the items. /// It makes possible to use graph item types as key types in /// It makes possible to use graph item types as key types in /// associative containers (e.g. \c std::map). /// /// \note This operator only have to define some strict ordering of /// \note This operator only has to define some strict ordering of /// the items; this order has nothing to do with the iteration /// ordering of the items. /// This class describes the base interface of directed graph types. /// All digraph %concepts have to conform to this class. /// It just provides types for nodes and arcs and functions /// It just provides types for nodes and arcs and functions /// to get the source and the target nodes of arcs. class BaseDigraphComponent { /// \brief Concept class for \c NodeIt, \c ArcIt and \c EdgeIt types. /// /// This class describes the concept of \c NodeIt, \c ArcIt and /// This class describes the concept of \c NodeIt, \c ArcIt and /// \c EdgeIt subtypes of digraph and graph types. template /// next item. GraphItemIt& operator++() { return *this; } /// \brief Equality operator /// }; /// \brief Concept class for \c InArcIt, \c OutArcIt and /// \brief Concept class for \c InArcIt, \c OutArcIt and /// \c IncEdgeIt types. /// /// This class describes the concept of \c InArcIt, \c OutArcIt /// This class describes the concept of \c InArcIt, \c OutArcIt /// and \c IncEdgeIt subtypes of digraph and graph types. /// /// \note Since these iterator classes do not inherit from the same /// base class, there is an additional template parameter (selector) /// \c sel. For \c InArcIt you should instantiate it with character /// \c sel. For \c InArcIt you should instantiate it with character /// \c 'i', for \c OutArcIt with \c 'o' and for \c IncEdgeIt with \c 'e'. template
• lemon/concepts/heap.h

 r877 _Heap& heap; ItemIntMap& map; Constraints() {} }; };
• lemon/concepts/heap.h

 r953 * This file is a part of LEMON, a generic C++ optimization library. * * Copyright (C) 2003-2009 * Copyright (C) 2003-2010 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). */ #ifndef LEMON_CONCEPTS_HEAP_H #define LEMON_CONCEPTS_HEAP_H ///\ingroup concept ///\file ///\brief The concept of heaps. #ifndef LEMON_CONCEPTS_HEAP_H #define LEMON_CONCEPTS_HEAP_H #include #include /// \brief The heap concept. /// /// Concept class describing the main interface of heaps. A \e heap /// is a data structure for storing items with specified values called /// \e priorities in such a way that finding the item with minimum /// priority is efficient. In a heap one can change the priority of an /// item, add or erase an item, etc. /// This concept class describes the main interface of heaps. /// The various \ref heaps "heap structures" are efficient /// implementations of the abstract data type \e priority \e queue. /// They store items with specified values called \e priorities /// in such a way that finding and removing the item with minimum /// priority are efficient. The basic operations are adding and /// erasing items, changing the priority of an item, etc. /// /// \tparam PR Type of the priority of the items. /// \tparam IM A read and writable item map with int values, used /// Heaps are crucial in several algorithms, such as Dijkstra and Prim. /// Any class that conforms to this concept can be used easily in such /// algorithms. /// /// \tparam PR Type of the priorities of the items. /// \tparam IM A read-writable item map with \c int values, used /// internally to handle the cross references. /// \tparam Comp A functor class for the ordering of the priorities. /// \tparam CMP A functor class for comparing the priorities. /// The default is \c std::less. #ifdef DOXYGEN template > #else template template #else template > #endif class Heap { /// /// Each item has a state associated to it. It can be "in heap", /// "pre heap" or "post heap". The later two are indifferent /// from the point of view of the heap, but may be useful for /// the user. /// "pre-heap" or "post-heap". The latter two are indifferent from the /// heap's point of view, but may be useful to the user. /// /// The item-int map must be initialized in such way that it assigns enum State { IN_HEAP = 0,    ///< = 0. The "in heap" state constant. PRE_HEAP = -1,  ///< = -1. The "pre heap" state constant. POST_HEAP = -2  ///< = -2. The "post heap" state constant. PRE_HEAP = -1,  ///< = -1. The "pre-heap" state constant. POST_HEAP = -2  ///< = -2. The "post-heap" state constant. }; /// \brief The constructor. /// /// The constructor. /// \brief Constructor. /// /// Constructor. /// \param map A map that assigns \c int values to keys of type /// \c Item. It is used internally by the heap implementations to /// handle the cross references. The assigned value must be /// \c PRE_HEAP (-1) for every item. /// \c PRE_HEAP (-1) for each item. #ifdef DOXYGEN explicit Heap(ItemIntMap &map) {} #else explicit Heap(ItemIntMap&) {} #endif /// \brief Constructor. /// /// Constructor. /// \param map A map that assigns \c int values to keys of type /// \c Item. It is used internally by the heap implementations to /// handle the cross references. The assigned value must be /// \c PRE_HEAP (-1) for each item. /// \param comp The function object used for comparing the priorities. #ifdef DOXYGEN explicit Heap(ItemIntMap &map, const CMP &comp) {} #else explicit Heap(ItemIntMap&, const CMP&) {} #endif /// \brief The number of items stored in the heap. /// /// Returns the number of items stored in the heap. /// This function returns the number of items stored in the heap. int size() const { return 0; } /// \brief Checks if the heap is empty. /// /// Returns \c true if the heap is empty. /// \brief Check if the heap is empty. /// /// This function returns \c true if the heap is empty. bool empty() const { return false; } /// \brief Makes the heap empty. /// /// Makes the heap empty. void clear(); /// \brief Inserts an item into the heap with the given priority. /// /// Inserts the given item into the heap with the given priority. /// \brief Make the heap empty. /// /// This functon makes the heap empty. /// It does not change the cross reference map. If you want to reuse /// a heap that is not surely empty, you should first clear it and /// then you should set the cross reference map to \c PRE_HEAP /// for each item. void clear() {} /// \brief Insert an item into the heap with the given priority. /// /// This function inserts the given item into the heap with the /// given priority. /// \param i The item to insert. /// \param p The priority of the item. /// \pre \e i must not be stored in the heap. #ifdef DOXYGEN void push(const Item &i, const Prio &p) {} /// \brief Returns the item having minimum priority. /// /// Returns the item having minimum priority. #else void push(const Item&, const Prio&) {} #endif /// \brief Return the item having minimum priority. /// /// This function returns the item having minimum priority. /// \pre The heap must be non-empty. Item top() const {} Item top() const { return Item(); } /// \brief The minimum priority. /// /// Returns the minimum priority. /// This function returns the minimum priority. /// \pre The heap must be non-empty. Prio prio() const {} /// \brief Removes the item having minimum priority. /// /// Removes the item having minimum priority. Prio prio() const { return Prio(); } /// \brief Remove the item having minimum priority. /// /// This function removes the item having minimum priority. /// \pre The heap must be non-empty. void pop() {} /// \brief Removes an item from the heap. /// /// Removes the given item from the heap if it is already stored. /// \brief Remove the given item from the heap. /// /// This function removes the given item from the heap if it is /// already stored. /// \param i The item to delete. /// \pre \e i must be in the heap. #ifdef DOXYGEN void erase(const Item &i) {} /// \brief The priority of an item. /// /// Returns the priority of the given item. /// \param i The item. /// \pre \c i must be in the heap. #else void erase(const Item&) {} #endif /// \brief The priority of the given item. /// /// This function returns the priority of the given item. /// \param i The item. /// \pre \e i must be in the heap. #ifdef DOXYGEN Prio operator[](const Item &i) const {} /// \brief Sets the priority of an item or inserts it, if it is #else Prio operator[](const Item&) const { return Prio(); } #endif /// \brief Set the priority of an item or insert it, if it is /// not stored in the heap. /// /// This method sets the priority of the given item if it is /// already stored in the heap. /// Otherwise it inserts the given item with the given priority. /// already stored in the heap. Otherwise it inserts the given /// item into the heap with the given priority. /// /// \param i The item. /// \param p The priority. #ifdef DOXYGEN void set(const Item &i, const Prio &p) {} /// \brief Decreases the priority of an item to the given value. /// /// Decreases the priority of an item to the given value. #else void set(const Item&, const Prio&) {} #endif /// \brief Decrease the priority of an item to the given value. /// /// This function decreases the priority of an item to the given value. /// \param i The item. /// \param p The priority. /// \pre \c i must be stored in the heap with priority at least \c p. /// \pre \e i must be stored in the heap with priority at least \e p. #ifdef DOXYGEN void decrease(const Item &i, const Prio &p) {} /// \brief Increases the priority of an item to the given value. /// /// Increases the priority of an item to the given value. #else void decrease(const Item&, const Prio&) {} #endif /// \brief Increase the priority of an item to the given value. /// /// This function increases the priority of an item to the given value. /// \param i The item. /// \param p The priority. /// \pre \c i must be stored in the heap with priority at most \c p. /// \pre \e i must be stored in the heap with priority at most \e p. #ifdef DOXYGEN void increase(const Item &i, const Prio &p) {} /// \brief Returns if an item is in, has already been in, or has /// never been in the heap. #else void increase(const Item&, const Prio&) {} #endif /// \brief Return the state of an item. /// /// This method returns \c PRE_HEAP if the given item has never /// to the heap again. /// \param i The item. #ifdef DOXYGEN State state(const Item &i) const {} /// \brief Sets the state of an item in the heap. /// /// Sets the state of the given item in the heap. It can be used /// to manually clear the heap when it is important to achive the /// better time complexity. #else State state(const Item&) const { return PRE_HEAP; } #endif /// \brief Set the state of an item in the heap. /// /// This function sets the state of the given item in the heap. /// It can be used to manually clear the heap when it is important /// to achive better time complexity. /// \param i The item. /// \param st The state. It should not be \c IN_HEAP. #ifdef DOXYGEN void state(const Item& i, State st) {} #else void state(const Item&, State) {} #endif
• lemon/concepts/path.h

 r785 } _Path& p; PathDumperConstraints() {} }; } _Path& p; PathDumperConstraints() {} };
• lemon/concepts/path.h

 r953 ///\ingroup concept ///\file ///\brief Classes for representing paths in digraphs. ///\brief The concept of paths /// /// A skeleton structure for representing directed paths in a /// digraph. /// In a sense, a path can be treated as a list of arcs. /// LEMON path types just store this list. As a consequence, they cannot /// enumerate the nodes on the path directly and a zero length path /// cannot store its source node. /// /// The arcs of a path should be stored in the order of their directions, /// i.e. the target node of each arc should be the same as the source /// node of the next arc. This consistency could be checked using /// \ref checkPath(). /// The source and target nodes of a (consistent) path can be obtained /// using \ref pathSource() and \ref pathTarget(). /// /// A path can be constructed from another path of any type using the /// copy constructor or the assignment operator. /// /// \tparam GR The digraph type in which the path is. /// /// In a sense, the path can be treated as a list of arcs. The /// lemon path type stores just this list. As a consequence it /// cannot enumerate the nodes in the path and the zero length /// paths cannot store the source. /// template class Path { Path() {} /// \brief Template constructor /// \brief Template copy constructor template Path(const CPath& cpath) {} /// \brief Template assigment /// \brief Template assigment operator template Path& operator=(const CPath& cpath) { } /// Length of the path ie. the number of arcs in the path. /// Length of the path, i.e. the number of arcs on the path. int length() const { return 0;} void clear() {} /// \brief LEMON style iterator for path arcs /// \brief LEMON style iterator for enumerating the arcs of a path. /// /// This class is used to iterate on the arcs of the paths. /// LEMON style iterator class for enumerating the arcs of a path. class ArcIt { public: /// Invalid constructor ArcIt(Invalid) {} /// Constructor for first arc /// Sets the iterator to the first arc of the given path ArcIt(const Path &) {} /// Conversion to Arc /// Conversion to \c Arc operator Arc() const { return INVALID; } /// /// A skeleton structure for path dumpers. The path dumpers are /// the generalization of the paths. The path dumpers can /// enumerate the arcs of the path wheter in forward or in /// backward order.  In most time these classes are not used /// directly rather it used to assign a dumped class to a real /// path type. /// the generalization of the paths, they can enumerate the arcs /// of the path either in forward or in backward order. /// These classes are typically not used directly, they are rather /// used to be assigned to a real path type. /// /// The main purpose of this concept is that the shortest path /// algorithms can enumerate easily the arcs in reverse order. /// If we would like to give back a real path from these /// algorithms then we should create a temporarly path object. In /// LEMON such algorithms gives back a path dumper what can /// assigned to a real path and the dumpers can be implemented as /// algorithms can enumerate the arcs easily in reverse order. /// In LEMON, such algorithms give back a (reverse) path dumper that /// can be assigned to a real path. The dumpers can be implemented as /// an adaptor class to the predecessor map. /// /// \tparam GR The digraph type in which the path is. /// /// The paths can be constructed from any path type by a /// template constructor or a template assignment operator. template class PathDumper { typedef typename Digraph::Arc Arc; /// Length of the path ie. the number of arcs in the path. /// Length of the path, i.e. the number of arcs on the path. int length() const { return 0;} /// \brief Forward or reverse dumping /// /// If the RevPathTag is defined and true then reverse dumping /// is provided in the path dumper. In this case instead of the /// ArcIt the RevArcIt iterator should be implemented in the /// dumper. /// If this tag is defined to be \c True, then reverse dumping /// is provided in the path dumper. In this case, \c RevArcIt /// iterator should be implemented instead of \c ArcIt iterator. typedef False RevPathTag; /// \brief LEMON style iterator for path arcs /// \brief LEMON style iterator for enumerating the arcs of a path. /// /// This class is used to iterate on the arcs of the paths. /// LEMON style iterator class for enumerating the arcs of a path. class ArcIt { public: /// Invalid constructor ArcIt(Invalid) {} /// Constructor for first arc /// Sets the iterator to the first arc of the given path ArcIt(const PathDumper&) {} /// Conversion to Arc /// Conversion to \c Arc operator Arc() const { return INVALID; } }; /// \brief LEMON style iterator for path arcs /// \brief LEMON style iterator for enumerating the arcs of a path /// in reverse direction. /// /// This class is used to iterate on the arcs of the paths in /// reverse direction. /// LEMON style iterator class for enumerating the arcs of a path /// in reverse direction. class RevArcIt { public: /// Invalid constructor RevArcIt(Invalid) {} /// Constructor for first arc /// Sets the iterator to the last arc of the given path RevArcIt(const PathDumper &) {} /// Conversion to Arc /// Conversion to \c Arc operator Arc() const { return INVALID; }
• lemon/dfs.h

 r944 } _Visitor& visitor; Constraints() {} }; };