COIN-OR::LEMON - Graph Library

Changes in / [279:6307bbbf285b:278:931190050520] in lemon-main


Ignore:
Files:
2 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r274 r236  
    11CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
    22
     3#EXECUTE_PROCESS(
     4#  COMMAND hg id -i
     5#  OUTPUT_VARIABLE HG_REVISION
     6#  OUTPUT_STRIP_TRAILING_WHITESPACE)
     7
    38SET(PROJECT_NAME "LEMON")
    4 SET(PROJECT_VERSION "hg-tip" CACHE STRING "The version string.")
     9SET(PROJECT_VERSION_MAJOR "0")
     10SET(PROJECT_VERSION_MINOR "99")
     11SET(PROJECT_VERSION_PATCH "0")
     12SET(PROJECT_VERSION
     13  "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
    514
    615PROJECT(${PROJECT_NAME})
     
    3140  SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
    3241
     42  SET(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
     43  SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
     44  SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
    3345  SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
    3446
    3547  SET(CPACK_PACKAGE_INSTALL_DIRECTORY
    36     "${PROJECT_NAME} ${PROJECT_VERSION}")
     48    "${PROJECT_NAME} ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
    3749  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
    38     "${PROJECT_NAME} ${PROJECT_VERSION}")
     50    "${PROJECT_NAME} ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
    3951
    4052  # Variables to generate a component-based installer.
  • NEWS

    r262 r5  
    1 20XX-XX-XX Version 1.0 released
    2 
    3         This is the first stable release of LEMON. Compared to the 0.x
    4         release series, it features a considerably smaller but more
    5         matured set of tools. The API has also completely revised and
    6         changed in several places.
    7 
    8         * The major name changes compared to the 0.x series
    9           * Graph -> Digraph, UGraph -> Graph
    10           * Edge -> Arc, UEdge -> Edge
    11           * source(UEdge)/target(UEdge) -> u(Edge)/v(Edge)
    12         * Other improvements
    13           * Better documentation
    14           * Reviewed and cleaned up codebase
    15           * CMake based build system (along with the autotools based one)
    16         * Contents of the library (ported from 0.x)
    17           * Algorithms
    18             * breadth-first search (bfs.h)
    19             * depth-first search (dfs.h)
    20             * Dijkstra's algorithm (dijkstra.h)
    21             * Kruskal's algorithm (kruskal.h)
    22           * Data structures
    23             * graph data structures (list_graph.h, smart_graph.h)
    24             * path data structures (path.h)
    25             * binary heap data structure (bin_heap.h)
    26             * union-find data structures (unionfind.h)
    27             * miscellaneous property maps (maps.h)
    28             * two dimensional vector and bounding box (dim2.h)
    29           * Concepts
    30             * graph structure concepts (concepts/digraph.h, concepts/graph.h,
    31               concepts/graph_components.h)
    32             * concepts for other structures (concepts/heap.h, concepts/maps.h,
    33               concepts/path.h)
    34           * Tools
    35             * Mersenne twister random number generator (random.h)
    36             * tools for measuring cpu and wall clock time (time_measure.h)
    37             * tools for counting steps and events (counter.h)
    38             * tool for parsing command line arguments (arg_parser.h)
    39             * tool for visualizing graphs (graph_to_eps.h)
    40             * tools for reading and writing data in LEMON Graph Format
    41               (lgf_reader.h, lgf_writer.h)
    42             * tools to handle the anomalies of calculations with
    43               floating point numbers (tolerance.h)
    44             * tools to manage RGB colors (color.h)
    45           * Infrastructure
    46             * extended assertion handling (assert.h)
    47             * exception classes and error handling (error.h)
    48             * concept checking (concept_check.h)
    49             * commonly used mathematical constants (math.h)
  • configure.ac

    r273 r259  
    22
    33dnl Version information.
    4 m4_define([lemon_version_number],
    5         [m4_normalize(esyscmd([echo ${LEMON_VERSION}]))])
    6 dnl m4_define([lemon_version_number], [])
    7 m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))])
     4m4_define([lemon_version_number], [])
    85m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))])
    9 m4_define([lemon_version], [ifelse(lemon_version_number(),
    10                            [],
    11                            [lemon_hg_path().lemon_hg_revision()],
    12                            [lemon_version_number()])])
     6m4_define([lemon_version], [ifelse(lemon_version_number(), [], [lemon_hg_revision()], [lemon_version_number()])])
    137
    148AC_PREREQ([2.59])
  • doc/Makefile.am

    r270 r227  
    77        doc/license.dox \
    88        doc/mainpage.dox \
    9         doc/named-param.dox \
    109        doc/namespaces.dox \
    1110        doc/html \
  • lemon/arg_parser.h

    r261 r214  
    1717 */
    1818
    19 #ifndef LEMON_ARG_PARSER_H
    20 #define LEMON_ARG_PARSER_H
     19#ifndef LEMON_ARG_PARSER
     20#define LEMON_ARG_PARSER
    2121
    2222#include <vector>
     
    383383}
    384384
    385 #endif // LEMON_ARG_PARSER_H
     385#endif // LEMON_ARG_PARSER
  • lemon/assert.h

    r277 r218  
    2828namespace lemon {
    2929
    30   inline void assert_fail_abort(const char *file, int line,
    31                                 const char *function, const char* message,
    32                                 const char *assertion)
     30  inline void assert_fail_log(const char *file, int line, const char *function,
     31                              const char *message, const char *assertion)
    3332  {
    3433    std::cerr << file << ":" << line << ": ";
     
    3938      std::cerr << " (assertion '" << assertion << "' failed)";
    4039    std::cerr << std::endl;
     40  }
     41
     42  inline void assert_fail_abort(const char *file, int line,
     43                                const char *function, const char* message,
     44                                const char *assertion)
     45  {
     46    assert_fail_log(file, line, function, message, assertion);
    4147    std::abort();
    4248  }
     
    5864
    5965#undef LEMON_ASSERT
     66#undef LEMON_FIXME
    6067#undef LEMON_DEBUG
    6168
    62 #if (defined(LEMON_ASSERT_ABORT) ? 1 : 0) +               \
     69#if (defined(LEMON_ASSERT_LOG) ? 1 : 0) +               \
     70  (defined(LEMON_ASSERT_ABORT) ? 1 : 0) +               \
    6371  (defined(LEMON_ASSERT_CUSTOM) ? 1 : 0) > 1
    6472#error "LEMON assertion system is not set properly"
    6573#endif
    6674
    67 #if ((defined(LEMON_ASSERT_ABORT) ? 1 : 0) +            \
     75#if ((defined(LEMON_ASSERT_LOG) ? 1 : 0) +              \
     76     (defined(LEMON_ASSERT_ABORT) ? 1 : 0) +            \
    6877     (defined(LEMON_ASSERT_CUSTOM) ? 1 : 0) == 1 ||     \
    6978     defined(LEMON_ENABLE_ASSERTS)) &&                  \
     
    7483
    7584
    76 #if defined LEMON_ASSERT_ABORT
     85#if defined LEMON_ASSERT_LOG
     86#  undef LEMON_ASSERT_HANDLER
     87#  define LEMON_ASSERT_HANDLER ::lemon::assert_fail_log
     88#elif defined LEMON_ASSERT_ABORT
    7789#  undef LEMON_ASSERT_HANDLER
    7890#  define LEMON_ASSERT_HANDLER ::lemon::assert_fail_abort
     
    96108#  elif defined _MSC_VER
    97109#    define LEMON_FUNCTION_NAME (__FUNCSIG__)
    98 #  elif __STDC_VERSION__ >= 199901L
     110#  else
    99111#    define LEMON_FUNCTION_NAME (__func__)
    100 #  else
    101 #    define LEMON_FUNCTION_NAME ("<unknown>")
    102112#  endif
    103113#endif
     
    109119/// \brief Macro for assertion with customizable message
    110120///
    111 /// Macro for assertion with customizable message. 
    112 /// \param exp An expression that must be convertible to \c bool.  If it is \c
    113 /// false, then an assertion is raised. The concrete behaviour depends on the
    114 /// settings of the assertion system.
    115 /// \param msg A <tt>const char*</tt> parameter, which can be used to provide
    116 /// information about the circumstances of the failed assertion.
     121/// Macro for assertion with customizable message.  \param exp An
     122/// expression that must be convertible to \c bool.  If it is \c
     123/// false, then an assertion is raised. The concrete behaviour depends
     124/// on the settings of the assertion system.  \param msg A <tt>const
     125/// char*</tt> parameter, which can be used to provide information
     126/// about the circumstances of the failed assertion.
    117127///
    118128/// The assertions are enabled in the default behaviour.
     
    128138/// The checking is also disabled when the standard macro \c NDEBUG is defined.
    129139///
    130 /// As a default behaviour the failed assertion prints a short log message to
    131 /// the standard error and aborts the execution.
    132 ///
    133 /// However, the following modes can be used in the assertion system:
    134 /// - \c LEMON_ASSERT_ABORT The failed assertion prints a short log message to
    135 ///   the standard error and aborts the program. It is the default behaviour.
     140/// The LEMON assertion system has a wide range of customization
     141/// properties. As a default behaviour the failed assertion prints a
     142/// short log message to the standard error and aborts the execution.
     143///
     144/// The following modes can be used in the assertion system:
     145///
     146/// - \c LEMON_ASSERT_LOG The failed assertion prints a short log
     147///   message to the standard error and continues the execution.
     148/// - \c LEMON_ASSERT_ABORT This mode is similar to the \c
     149///   LEMON_ASSERT_LOG, but it aborts the program. It is the default
     150///   behaviour.
    136151/// - \c LEMON_ASSERT_CUSTOM The user can define own assertion handler
    137152///   function.
     
    161176/// \ingroup exceptions
    162177///
     178/// \brief Macro for mark not yet implemented features.
     179///
     180/// Macro for mark not yet implemented features and outstanding bugs.
     181/// It is close to be the shortcut of the following code:
     182/// \code
     183///   LEMON_ASSERT(false, msg);
     184/// \endcode
     185///
     186/// \see LEMON_ASSERT
     187#  define LEMON_FIXME(msg)                                              \
     188  (LEMON_ASSERT_HANDLER(__FILE__, __LINE__, LEMON_FUNCTION_NAME,        \
     189                        ::lemon::_assert_bits::cstringify(msg),         \
     190                        static_cast<const char*>(0)))
     191
     192/// \ingroup exceptions
     193///
    163194/// \brief Macro for internal assertions
    164195///
     
    192223#  ifndef LEMON_ASSERT_HANDLER
    193224#    define LEMON_ASSERT(exp, msg)  (static_cast<void>(0))
     225#    define LEMON_FIXME(msg) (static_cast<void>(0))
    194226#    define LEMON_DEBUG(exp, msg) (static_cast<void>(0))
    195227#  else
     
    200232                             ::lemon::_assert_bits::cstringify(msg),    \
    201233                             #exp), 0)))
     234#    define LEMON_FIXME(msg)                                            \
     235       (LEMON_ASSERT_HANDLER(__FILE__, __LINE__, LEMON_FUNCTION_NAME,   \
     236                             ::lemon::_assert_bits::cstringify(msg),    \
     237                             static_cast<const char*>(0)))
     238
    202239#    if LEMON_ENABLE_DEBUG
    203240#      define LEMON_DEBUG(exp, msg)                                     \
  • lemon/bits/array_map.h

    r263 r209  
    104104    }
    105105
    106   private:
    107106    /// \brief Constructor to copy a map of the same map type.
    108107    ///
     
    152151    }
    153152
    154   public:
    155153    /// \brief The destructor of the map.
    156154    ///
  • lemon/bits/graph_extender.h

    r263 r220  
    228228        : Parent(digraph, value) {}
    229229
    230     private:
    231230      NodeMap& operator=(const NodeMap& cmap) {
    232231        return operator=<NodeMap>(cmap);
     
    253252        : Parent(digraph, value) {}
    254253
    255     private:
    256254      ArcMap& operator=(const ArcMap& cmap) {
    257255        return operator=<ArcMap>(cmap);
     
    611609        : Parent(graph, value) {}
    612610
    613     private:
    614611      NodeMap& operator=(const NodeMap& cmap) {
    615612        return operator=<NodeMap>(cmap);
     
    636633        : Parent(graph, value) {}
    637634
    638     private:
    639635      ArcMap& operator=(const ArcMap& cmap) {
    640636        return operator=<ArcMap>(cmap);
     
    662658        : Parent(graph, value) {}
    663659
    664     private:
    665660      EdgeMap& operator=(const EdgeMap& cmap) {
    666661        return operator=<EdgeMap>(cmap);
  • lemon/bits/map_extender.h

    r263 r209  
    6363      : Parent(graph, value) {}
    6464
    65   private:
    6665    MapExtender& operator=(const MapExtender& cmap) {
    6766      return operator=<MapExtender>(cmap);
     
    7473    }
    7574
    76   public:
    7775    class MapIt : public Item {
    7876    public:
     
    203201      : Parent(_graph, _value), graph(_graph) {}
    204202
    205   private:
    206203    SubMapExtender& operator=(const SubMapExtender& cmap) {
    207204      return operator=<MapExtender>(cmap);
     
    218215    }
    219216
    220   public:
    221217    class MapIt : public Item {
    222218    public:
  • lemon/bits/vector_map.h

    r263 r220  
    101101    }
    102102
    103   private:
    104103    /// \brief Copy constructor
    105104    ///
  • lemon/concepts/digraph.h

    r263 r220  
    435435        NodeMap(const Digraph&, T) { }
    436436
    437       private:
    438437        ///Copy constructor
    439438        NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
     
    458457        ///\e
    459458        ArcMap(const Digraph&, T) { }
    460       private:
    461459        ///Copy constructor
    462460        ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
  • lemon/concepts/graph.h

    r263 r220  
    513513        NodeMap(const Graph&, T) { }
    514514
    515       private:
    516515        ///Copy constructor
    517516        NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
     
    537536        ///\e
    538537        ArcMap(const Graph&, T) { }
    539       private:
    540538        ///Copy constructor
    541539        ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
     
    561559        ///\e
    562560        EdgeMap(const Graph&, T) { }
    563       private:
    564561        ///Copy constructor
    565562        EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) {}
  • lemon/concepts/graph_components.h

    r263 r220  
    10061006      /// Construct a new map for the graph and initalise the values.
    10071007      GraphMap(const Graph&, const Value&) {}
    1008 
    1009     private:
    10101008      /// \brief Copy constructor.
    10111009      ///
     
    10241022      }
    10251023
    1026     public:
    10271024      template<typename _Map>
    10281025      struct Constraints {
     
    10341031          _Map a2(g,t);
    10351032          // Copy constructor.
    1036           // _Map b(c);
    1037 
    1038           // ReadMap<Key, Value> cmap;
    1039           // b = cmap;
    1040 
    1041           ignore_unused_variable_warning(a);
     1033          _Map b(c);
     1034
     1035          ReadMap<Key, Value> cmap;
     1036          b = cmap;
     1037
    10421038          ignore_unused_variable_warning(a2);
    1043           // ignore_unused_variable_warning(b);
     1039          ignore_unused_variable_warning(b);
    10441040        }
    10451041
     
    10871083          : Parent(digraph, value) {}
    10881084
    1089       private:
    10901085        /// \brief Copy constructor.
    10911086        ///
     
    11251120          : Parent(digraph, value) {}
    11261121
    1127       private:
    11281122        /// \brief Copy constructor.
    11291123        ///
     
    12221216          : Parent(graph, value) {}
    12231217
    1224       private:
    12251218        /// \brief Copy constructor.
    12261219        ///
  • test/error_test.cc

    r277 r223  
    4848}
    4949
     50void fixme_disable() {
     51  LEMON_FIXME("fixme_disable() is fixme!");
     52}
     53
    5054void check_assertion_disable() {
    5155  no_assertion_text_disable();
    5256  assertion_text_disable();
     57  fixme_disable();
    5358}
    5459#undef LEMON_DISABLE_ASSERTS
     
    7479}
    7580
     81void fixme_custom() {
     82  LEMON_FIXME("fixme_custom() is fixme!");
     83}
     84
    7685void check_assertion_custom() {
    7786  no_assertion_text_custom();
    7887  assertion_text_custom();
    79   check(cnt == 1, "The custom assert handler does not work");
     88  fixme_custom();
     89  check(cnt == 2, "The custom assert handler does not work");
    8090}
    8191
  • test/graph_test.h

    r263 r228  
    213213    check(s == 0, "Wrong sum.");
    214214
    215     // map = constMap<Node>(12);
    216     // for (NodeIt it(G); it != INVALID; ++it) {
    217     //   check(map[it] == 12, "Wrong operator[].");
    218     // }
     215    map = constMap<Node>(12);
     216    for (NodeIt it(G); it != INVALID; ++it) {
     217      check(map[it] == 12, "Wrong operator[].");
     218    }
    219219  }
    220220
     
    243243    check(s == 0, "Wrong sum.");
    244244
    245     // map = constMap<Arc>(12);
    246     // for (ArcIt it(G); it != INVALID; ++it) {
    247     //   check(map[it] == 12, "Wrong operator[].");
    248     // }
     245    map = constMap<Arc>(12);
     246    for (ArcIt it(G); it != INVALID; ++it) {
     247      check(map[it] == 12, "Wrong operator[].");
     248    }
    249249  }
    250250
     
    273273    check(s == 0, "Wrong sum.");
    274274
    275     // map = constMap<Edge>(12);
    276     // for (EdgeIt it(G); it != INVALID; ++it) {
    277     //   check(map[it] == 12, "Wrong operator[].");
    278     // }
     275    map = constMap<Edge>(12);
     276    for (EdgeIt it(G); it != INVALID; ++it) {
     277      check(map[it] == 12, "Wrong operator[].");
     278    }
    279279  }
    280280
Note: See TracChangeset for help on using the changeset viewer.