Changes in / [278:931190050520:279:6307bbbf285b] in lemon-1.1
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r236 r274 1 1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 2 3 #EXECUTE_PROCESS(4 # COMMAND hg id -i5 # OUTPUT_VARIABLE HG_REVISION6 # OUTPUT_STRIP_TRAILING_WHITESPACE)7 8 3 SET(PROJECT_NAME "LEMON") 9 SET(PROJECT_VERSION_MAJOR "0") 10 SET(PROJECT_VERSION_MINOR "99") 11 SET(PROJECT_VERSION_PATCH "0") 12 SET(PROJECT_VERSION 13 "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") 4 SET(PROJECT_VERSION "hg-tip" CACHE STRING "The version string.") 14 5 15 6 PROJECT(${PROJECT_NAME}) … … 40 31 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") 41 32 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})45 33 SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) 46 34 47 35 SET(CPACK_PACKAGE_INSTALL_DIRECTORY 48 "${PROJECT_NAME} ${PROJECT_VERSION _MAJOR}.${PROJECT_VERSION_MINOR}")36 "${PROJECT_NAME} ${PROJECT_VERSION}") 49 37 SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY 50 "${PROJECT_NAME} ${PROJECT_VERSION _MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")38 "${PROJECT_NAME} ${PROJECT_VERSION}") 51 39 52 40 # Variables to generate a component-based installer. -
NEWS
r5 r262 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
r259 r273 2 2 3 3 dnl Version information. 4 m4_define([lemon_version_number], []) 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]))]) 5 8 m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))]) 6 m4_define([lemon_version], [ifelse(lemon_version_number(), [], [lemon_hg_revision()], [lemon_version_number()])]) 9 m4_define([lemon_version], [ifelse(lemon_version_number(), 10 [], 11 [lemon_hg_path().lemon_hg_revision()], 12 [lemon_version_number()])]) 7 13 8 14 AC_PREREQ([2.59]) -
doc/Makefile.am
r227 r270 7 7 doc/license.dox \ 8 8 doc/mainpage.dox \ 9 doc/named-param.dox \ 9 10 doc/namespaces.dox \ 10 11 doc/html \ -
lemon/arg_parser.h
r214 r261 17 17 */ 18 18 19 #ifndef LEMON_ARG_PARSER 20 #define LEMON_ARG_PARSER 19 #ifndef LEMON_ARG_PARSER_H 20 #define LEMON_ARG_PARSER_H 21 21 22 22 #include <vector> … … 383 383 } 384 384 385 #endif // LEMON_ARG_PARSER 385 #endif // LEMON_ARG_PARSER_H -
lemon/assert.h
r218 r277 28 28 namespace lemon { 29 29 30 inline void assert_fail_log(const char *file, int line, const char *function, 31 const char *message, const char *assertion) 30 inline void assert_fail_abort(const char *file, int line, 31 const char *function, const char* message, 32 const char *assertion) 32 33 { 33 34 std::cerr << file << ":" << line << ": "; … … 38 39 std::cerr << " (assertion '" << assertion << "' failed)"; 39 40 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);47 41 std::abort(); 48 42 } … … 64 58 65 59 #undef LEMON_ASSERT 66 #undef LEMON_FIXME67 60 #undef LEMON_DEBUG 68 61 69 #if (defined(LEMON_ASSERT_LOG) ? 1 : 0) + \ 70 (defined(LEMON_ASSERT_ABORT) ? 1 : 0) + \ 62 #if (defined(LEMON_ASSERT_ABORT) ? 1 : 0) + \ 71 63 (defined(LEMON_ASSERT_CUSTOM) ? 1 : 0) > 1 72 64 #error "LEMON assertion system is not set properly" 73 65 #endif 74 66 75 #if ((defined(LEMON_ASSERT_LOG) ? 1 : 0) + \ 76 (defined(LEMON_ASSERT_ABORT) ? 1 : 0) + \ 67 #if ((defined(LEMON_ASSERT_ABORT) ? 1 : 0) + \ 77 68 (defined(LEMON_ASSERT_CUSTOM) ? 1 : 0) == 1 || \ 78 69 defined(LEMON_ENABLE_ASSERTS)) && \ … … 83 74 84 75 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 76 #if defined LEMON_ASSERT_ABORT 89 77 # undef LEMON_ASSERT_HANDLER 90 78 # define LEMON_ASSERT_HANDLER ::lemon::assert_fail_abort … … 108 96 # elif defined _MSC_VER 109 97 # define LEMON_FUNCTION_NAME (__FUNCSIG__) 98 # elif __STDC_VERSION__ >= 199901L 99 # define LEMON_FUNCTION_NAME (__func__) 110 100 # else 111 # define LEMON_FUNCTION_NAME ( __func__)101 # define LEMON_FUNCTION_NAME ("<unknown>") 112 102 # endif 113 103 #endif … … 119 109 /// \brief Macro for assertion with customizable message 120 110 /// 121 /// Macro for assertion with customizable message. \param exp An122 /// expression that must be convertible to \c bool. If it is \c123 /// false, then an assertion is raised. The concrete behaviour depends 124 /// on the settings of the assertion system. \param msg A <tt>const125 /// char*</tt> parameter, which can be used to provide information126 /// about the circumstances of the failed assertion.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. 127 117 /// 128 118 /// The assertions are enabled in the default behaviour. … … 138 128 /// The checking is also disabled when the standard macro \c NDEBUG is defined. 139 129 /// 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. 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. 151 136 /// - \c LEMON_ASSERT_CUSTOM The user can define own assertion handler 152 137 /// function. … … 176 161 /// \ingroup exceptions 177 162 /// 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 /// \code183 /// LEMON_ASSERT(false, msg);184 /// \endcode185 ///186 /// \see LEMON_ASSERT187 # 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 exceptions193 ///194 163 /// \brief Macro for internal assertions 195 164 /// … … 223 192 # ifndef LEMON_ASSERT_HANDLER 224 193 # define LEMON_ASSERT(exp, msg) (static_cast<void>(0)) 225 # define LEMON_FIXME(msg) (static_cast<void>(0))226 194 # define LEMON_DEBUG(exp, msg) (static_cast<void>(0)) 227 195 # else … … 232 200 ::lemon::_assert_bits::cstringify(msg), \ 233 201 #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 239 202 # if LEMON_ENABLE_DEBUG 240 203 # define LEMON_DEBUG(exp, msg) \ -
lemon/bits/array_map.h
r209 r263 104 104 } 105 105 106 private: 106 107 /// \brief Constructor to copy a map of the same map type. 107 108 /// … … 151 152 } 152 153 154 public: 153 155 /// \brief The destructor of the map. 154 156 /// -
lemon/bits/graph_extender.h
r220 r263 228 228 : Parent(digraph, value) {} 229 229 230 private: 230 231 NodeMap& operator=(const NodeMap& cmap) { 231 232 return operator=<NodeMap>(cmap); … … 252 253 : Parent(digraph, value) {} 253 254 255 private: 254 256 ArcMap& operator=(const ArcMap& cmap) { 255 257 return operator=<ArcMap>(cmap); … … 609 611 : Parent(graph, value) {} 610 612 613 private: 611 614 NodeMap& operator=(const NodeMap& cmap) { 612 615 return operator=<NodeMap>(cmap); … … 633 636 : Parent(graph, value) {} 634 637 638 private: 635 639 ArcMap& operator=(const ArcMap& cmap) { 636 640 return operator=<ArcMap>(cmap); … … 658 662 : Parent(graph, value) {} 659 663 664 private: 660 665 EdgeMap& operator=(const EdgeMap& cmap) { 661 666 return operator=<EdgeMap>(cmap); -
lemon/bits/map_extender.h
r209 r263 63 63 : Parent(graph, value) {} 64 64 65 private: 65 66 MapExtender& operator=(const MapExtender& cmap) { 66 67 return operator=<MapExtender>(cmap); … … 73 74 } 74 75 76 public: 75 77 class MapIt : public Item { 76 78 public: … … 201 203 : Parent(_graph, _value), graph(_graph) {} 202 204 205 private: 203 206 SubMapExtender& operator=(const SubMapExtender& cmap) { 204 207 return operator=<MapExtender>(cmap); … … 215 218 } 216 219 220 public: 217 221 class MapIt : public Item { 218 222 public: -
lemon/bits/vector_map.h
r220 r263 101 101 } 102 102 103 private: 103 104 /// \brief Copy constructor 104 105 /// -
lemon/concepts/digraph.h
r220 r263 435 435 NodeMap(const Digraph&, T) { } 436 436 437 private: 437 438 ///Copy constructor 438 439 NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { } … … 457 458 ///\e 458 459 ArcMap(const Digraph&, T) { } 460 private: 459 461 ///Copy constructor 460 462 ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { } -
lemon/concepts/graph.h
r220 r263 513 513 NodeMap(const Graph&, T) { } 514 514 515 private: 515 516 ///Copy constructor 516 517 NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { } … … 536 537 ///\e 537 538 ArcMap(const Graph&, T) { } 539 private: 538 540 ///Copy constructor 539 541 ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { } … … 559 561 ///\e 560 562 EdgeMap(const Graph&, T) { } 563 private: 561 564 ///Copy constructor 562 565 EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) {} -
lemon/concepts/graph_components.h
r220 r263 1006 1006 /// Construct a new map for the graph and initalise the values. 1007 1007 GraphMap(const Graph&, const Value&) {} 1008 1009 private: 1008 1010 /// \brief Copy constructor. 1009 1011 /// … … 1022 1024 } 1023 1025 1026 public: 1024 1027 template<typename _Map> 1025 1028 struct Constraints { … … 1031 1034 _Map a2(g,t); 1032 1035 // Copy constructor. 1033 _Map b(c); 1034 1035 ReadMap<Key, Value> cmap; 1036 b = cmap; 1037 1036 // _Map b(c); 1037 1038 // ReadMap<Key, Value> cmap; 1039 // b = cmap; 1040 1041 ignore_unused_variable_warning(a); 1038 1042 ignore_unused_variable_warning(a2); 1039 ignore_unused_variable_warning(b);1043 // ignore_unused_variable_warning(b); 1040 1044 } 1041 1045 … … 1083 1087 : Parent(digraph, value) {} 1084 1088 1089 private: 1085 1090 /// \brief Copy constructor. 1086 1091 /// … … 1120 1125 : Parent(digraph, value) {} 1121 1126 1127 private: 1122 1128 /// \brief Copy constructor. 1123 1129 /// … … 1216 1222 : Parent(graph, value) {} 1217 1223 1224 private: 1218 1225 /// \brief Copy constructor. 1219 1226 /// -
test/error_test.cc
r223 r277 48 48 } 49 49 50 void fixme_disable() {51 LEMON_FIXME("fixme_disable() is fixme!");52 }53 54 50 void check_assertion_disable() { 55 51 no_assertion_text_disable(); 56 52 assertion_text_disable(); 57 fixme_disable();58 53 } 59 54 #undef LEMON_DISABLE_ASSERTS … … 79 74 } 80 75 81 void fixme_custom() {82 LEMON_FIXME("fixme_custom() is fixme!");83 }84 85 76 void check_assertion_custom() { 86 77 no_assertion_text_custom(); 87 78 assertion_text_custom(); 88 fixme_custom(); 89 check(cnt == 2, "The custom assert handler does not work"); 79 check(cnt == 1, "The custom assert handler does not work"); 90 80 } 91 81 -
test/graph_test.h
r228 r263 213 213 check(s == 0, "Wrong sum."); 214 214 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 // } 219 219 } 220 220 … … 243 243 check(s == 0, "Wrong sum."); 244 244 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 // } 249 249 } 250 250 … … 273 273 check(s == 0, "Wrong sum."); 274 274 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 // } 279 279 } 280 280
Note: See TracChangeset
for help on using the changeset viewer.