Changes in / [832:5100072d83ca:944:b4af20d02ae0] in lemon-main
- Files:
-
- 2 added
- 1 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r680 r927 3 3 SET(PROJECT_NAME "LEMON") 4 4 PROJECT(${PROJECT_NAME}) 5 6 INCLUDE(FindPythonInterp) 7 INCLUDE(FindWget) 5 8 6 9 IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake) … … 10 13 ELSE() 11 14 EXECUTE_PROCESS( 15 COMMAND ${PYTHON_EXECUTABLE} ./scripts/chg-len.py 16 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 17 OUTPUT_VARIABLE HG_REVISION_PATH 18 ERROR_QUIET 19 OUTPUT_STRIP_TRAILING_WHITESPACE 20 ) 21 EXECUTE_PROCESS( 12 22 COMMAND hg id -i 13 23 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} … … 17 27 ) 18 28 IF(HG_REVISION STREQUAL "") 19 SET(HG_REVISION "hg-tip") 29 SET(HG_REVISION_ID "hg-tip") 30 ELSE() 31 IF(HG_REVISION_PATH STREQUAL "") 32 SET(HG_REVISION_ID ${HG_REVISION}) 33 ELSE() 34 SET(HG_REVISION_ID ${HG_REVISION_PATH}.${HG_REVISION}) 35 ENDIF() 20 36 ENDIF() 21 SET(LEMON_VERSION ${HG_REVISION } CACHE STRING "LEMON version string.")37 SET(LEMON_VERSION ${HG_REVISION_ID} CACHE STRING "LEMON version string.") 22 38 ENDIF() 23 39 … … 32 48 FIND_PACKAGE(COIN) 33 49 50 IF(DEFINED ENV{LEMON_CXX_WARNING}) 51 SET(CXX_WARNING $ENV{LEMON_CXX_WARNING}) 52 ELSE() 53 IF(CMAKE_COMPILER_IS_GNUCXX) 54 SET(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas") 55 SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb") 56 SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb") 57 ELSEIF(MSVC) 58 # This part is unnecessary 'casue the same is set by the lemon/core.h. 59 # Still keep it as an example. 60 SET(CXX_WARNING "/wd4250 /wd4355 /wd4503 /wd4800 /wd4996") 61 # Suppressed warnings: 62 # C4250: 'class1' : inherits 'class2::member' via dominance 63 # C4355: 'this' : used in base member initializer list 64 # C4503: 'function' : decorated name length exceeded, name was truncated 65 # C4800: 'type' : forcing value to bool 'true' or 'false' 66 # (performance warning) 67 # C4996: 'function': was declared deprecated 68 ELSE() 69 SET(CXX_WARNING "-Wall -W") 70 ENDIF() 71 ENDIF() 72 SET(LEMON_CXX_WARNING_FLAGS ${CXX_WARNING} CACHE STRING "LEMON warning flags.") 73 74 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}") 75 76 SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb" CACHE STRING 77 "Flags used by the C++ compiler during maintainer builds." 78 FORCE ) 79 SET( CMAKE_C_FLAGS_MAINTAINER "-Werror" CACHE STRING 80 "Flags used by the C compiler during maintainer builds." 81 FORCE ) 82 SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER 83 "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING 84 "Flags used for linking binaries during maintainer builds." 85 FORCE ) 86 SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER 87 "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING 88 "Flags used by the shared libraries linker during maintainer builds." 89 FORCE ) 90 MARK_AS_ADVANCED( 91 CMAKE_CXX_FLAGS_MAINTAINER 92 CMAKE_C_FLAGS_MAINTAINER 93 CMAKE_EXE_LINKER_FLAGS_MAINTAINER 94 CMAKE_SHARED_LINKER_FLAGS_MAINTAINER ) 95 96 IF(CMAKE_CONFIGURATION_TYPES) 97 LIST(APPEND CMAKE_CONFIGURATION_TYPES Maintainer) 98 LIST(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES) 99 SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING 100 "Add the configurations that we need" 101 FORCE) 102 endif() 103 104 IF(NOT CMAKE_BUILD_TYPE) 105 SET(CMAKE_BUILD_TYPE "Release") 106 ENDIF() 107 108 SET( CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING 109 "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel Maintainer." 110 FORCE ) 111 112 34 113 INCLUDE(CheckTypeSize) 35 114 CHECK_TYPE_SIZE("long long" LONG_LONG) … … 37 116 38 117 ENABLE_TESTING() 118 119 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") 120 ADD_CUSTOM_TARGET(check ALL COMMAND ${CMAKE_CTEST_COMMAND}) 121 ELSE() 122 ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND}) 123 ENDIF() 39 124 40 125 ADD_SUBDIRECTORY(lemon) … … 63 148 ENDIF() 64 149 65 IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} AND WIN32)150 IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) 66 151 SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) 67 152 SET(CPACK_PACKAGE_VENDOR "EGRES") -
Makefile.am
r629 r752 18 18 cmake/FindGLPK.cmake \ 19 19 cmake/FindCOIN.cmake \ 20 cmake/LEMONConfig.cmake.in \ 20 21 cmake/version.cmake.in \ 21 22 cmake/version.cmake \ -
configure.ac
r680 r929 99 99 dnl Add dependencies on files generated by configure. 100 100 AC_SUBST([CONFIG_STATUS_DEPENDENCIES], 101 ['$(top_srcdir)/doc/Doxyfile.in $(top_srcdir)/ lemon/lemon.pc.in $(top_srcdir)/cmake/version.cmake.in'])101 ['$(top_srcdir)/doc/Doxyfile.in $(top_srcdir)/doc/mainpage.dox.in $(top_srcdir)/lemon/lemon.pc.in $(top_srcdir)/cmake/version.cmake.in']) 102 102 103 103 AC_CONFIG_FILES([ … … 106 106 cmake/version.cmake 107 107 doc/Doxyfile 108 doc/mainpage.dox 108 109 lemon/lemon.pc 109 110 ]) -
doc/CMakeLists.txt
r679 r929 4 4 SET(abs_top_builddir ${PROJECT_BINARY_DIR}) 5 5 6 SET(LEMON_DOC_SOURCE_BROWSER "NO" CACHE STRING "Include source into the doc (YES/NO).") 7 6 8 CONFIGURE_FILE( 7 9 ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in 8 10 ${PROJECT_BINARY_DIR}/doc/Doxyfile 11 @ONLY 12 ) 13 14 CONFIGURE_FILE( 15 ${PROJECT_SOURCE_DIR}/doc/mainpage.dox.in 16 ${PROJECT_BINARY_DIR}/doc/mainpage.dox 9 17 @ONLY 10 18 ) … … 50 58 51 59 ENDIF() 60 61 IF(WGET_FOUND) 62 ADD_CUSTOM_TARGET(update-external-tags 63 COMMAND ${CMAKE_COMMAND} -E make_directory dl 64 # COMMAND ${CMAKE_COMMAND} -E copy libstdc++.tag dl 65 COMMAND ${WGET_EXECUTABLE} wget -P dl -N libstdc++.tag.tmp http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/libstdc++.tag 66 COMMAND ${CMAKE_COMMAND} -E rename dl/libstdc++.tag libstdc++.tag 67 COMMAND ${CMAKE_COMMAND} -E remove dl/libstdc++.tag 68 COMMAND ${CMAKE_COMMAND} -E remove_directory dl 69 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 70 ) 71 ENDIF() -
doc/Doxyfile.in
r367 r929 1 # Doxyfile 1. 5.7.11 # Doxyfile 1.7.3 2 2 3 3 #--------------------------------------------------------------------------- … … 5 5 #--------------------------------------------------------------------------- 6 6 DOXYFILE_ENCODING = UTF-8 7 PROJECT_NAME = @PACKAGE_NAME@ 8 PROJECT_NUMBER = @PACKAGE_VERSION@ 7 PROJECT_NAME = 8 PROJECT_NUMBER = 9 PROJECT_BRIEF = 10 PROJECT_LOGO = 9 11 OUTPUT_DIRECTORY = 10 12 CREATE_SUBDIRS = NO … … 22 24 QT_AUTOBRIEF = NO 23 25 MULTILINE_CPP_IS_BRIEF = NO 24 DETAILS_AT_TOP = YES25 26 INHERIT_DOCS = NO 26 27 SEPARATE_MEMBER_PAGES = NO … … 31 32 OPTIMIZE_FOR_FORTRAN = NO 32 33 OPTIMIZE_OUTPUT_VHDL = NO 34 EXTENSION_MAPPING = 33 35 BUILTIN_STL_SUPPORT = YES 34 36 CPP_CLI_SUPPORT = NO … … 56 58 HIDE_SCOPE_NAMES = YES 57 59 SHOW_INCLUDE_FILES = YES 60 FORCE_LOCAL_INCLUDES = NO 58 61 INLINE_INFO = YES 59 62 SORT_MEMBER_DOCS = NO 60 63 SORT_BRIEF_DOCS = NO 64 SORT_MEMBERS_CTORS_1ST = NO 61 65 SORT_GROUP_NAMES = NO 62 66 SORT_BY_SCOPE_NAME = NO 67 STRICT_PROTO_MATCHING = NO 63 68 GENERATE_TODOLIST = YES 64 69 GENERATE_TESTLIST = YES … … 72 77 SHOW_NAMESPACES = YES 73 78 FILE_VERSION_FILTER = 74 LAYOUT_FILE = DoxygenLayout.xml79 LAYOUT_FILE = "@abs_top_srcdir@/doc/DoxygenLayout.xml" 75 80 #--------------------------------------------------------------------------- 76 81 # configuration options related to warning and progress messages … … 92 97 "@abs_top_srcdir@/demo" \ 93 98 "@abs_top_srcdir@/tools" \ 94 "@abs_top_srcdir@/test/test_tools.h" 99 "@abs_top_srcdir@/test/test_tools.h" \ 100 "@abs_top_builddir@/doc/mainpage.dox" 95 101 INPUT_ENCODING = UTF-8 96 102 FILE_PATTERNS = *.h \ … … 112 118 FILTER_PATTERNS = 113 119 FILTER_SOURCE_FILES = NO 120 FILTER_SOURCE_PATTERNS = 114 121 #--------------------------------------------------------------------------- 115 122 # configuration options related to source browsing 116 123 #--------------------------------------------------------------------------- 117 SOURCE_BROWSER = NO124 SOURCE_BROWSER = @LEMON_DOC_SOURCE_BROWSER@ 118 125 INLINE_SOURCES = NO 119 126 STRIP_CODE_COMMENTS = YES … … 138 145 HTML_FOOTER = 139 146 HTML_STYLESHEET = 147 HTML_COLORSTYLE_HUE = 220 148 HTML_COLORSTYLE_SAT = 100 149 HTML_COLORSTYLE_GAMMA = 80 150 HTML_TIMESTAMP = YES 140 151 HTML_ALIGN_MEMBERS = YES 141 HTML_DYNAMIC_SECTIONS = NO152 HTML_DYNAMIC_SECTIONS = YES 142 153 GENERATE_DOCSET = NO 143 154 DOCSET_FEEDNAME = "Doxygen generated docs" 144 155 DOCSET_BUNDLE_ID = org.doxygen.Project 156 DOCSET_PUBLISHER_ID = org.doxygen.Publisher 157 DOCSET_PUBLISHER_NAME = Publisher 145 158 GENERATE_HTMLHELP = NO 146 159 CHM_FILE = … … 154 167 QHP_NAMESPACE = org.doxygen.Project 155 168 QHP_VIRTUAL_FOLDER = doc 169 QHP_CUST_FILTER_NAME = 170 QHP_CUST_FILTER_ATTRS = 171 QHP_SECT_FILTER_ATTRS = 156 172 QHG_LOCATION = 173 GENERATE_ECLIPSEHELP = NO 174 ECLIPSE_DOC_ID = org.doxygen.Project 157 175 DISABLE_INDEX = NO 158 176 ENUM_VALUES_PER_LINE = 4 159 177 GENERATE_TREEVIEW = NO 178 USE_INLINE_TREES = NO 160 179 TREEVIEW_WIDTH = 250 180 EXT_LINKS_IN_WINDOW = NO 161 181 FORMULA_FONTSIZE = 10 182 FORMULA_TRANSPARENT = YES 183 USE_MATHJAX = NO 184 MATHJAX_RELPATH = http://www.mathjax.org/mathjax 185 SEARCHENGINE = YES 186 SERVER_BASED_SEARCH = NO 162 187 #--------------------------------------------------------------------------- 163 188 # configuration options related to the LaTeX output … … 176 201 LATEX_BATCHMODE = NO 177 202 LATEX_HIDE_INDICES = NO 203 LATEX_SOURCE_CODE = NO 178 204 #--------------------------------------------------------------------------- 179 205 # configuration options related to the RTF output … … 224 250 SKIP_FUNCTION_MACROS = YES 225 251 #--------------------------------------------------------------------------- 226 # Configuration::additions related to external references 227 #--------------------------------------------------------------------------- 228 TAGFILES = "@abs_top_ srcdir@/doc/libstdc++.tag = http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/ "252 # Configuration::additions related to external references 253 #--------------------------------------------------------------------------- 254 TAGFILES = "@abs_top_builddir@/doc/libstdc++.tag = http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/ " 229 255 GENERATE_TAGFILE = html/lemon.tag 230 256 ALLEXTERNALS = NO … … 238 264 HIDE_UNDOC_RELATIONS = YES 239 265 HAVE_DOT = YES 266 DOT_NUM_THREADS = 0 240 267 DOT_FONTNAME = FreeSans 241 268 DOT_FONTSIZE = 10 … … 255 282 DOT_PATH = 256 283 DOTFILE_DIRS = 284 MSCFILE_DIRS = 257 285 DOT_GRAPH_MAX_NODES = 50 258 286 MAX_DOT_GRAPH_DEPTH = 0 … … 261 289 GENERATE_LEGEND = YES 262 290 DOT_CLEANUP = YES 263 #---------------------------------------------------------------------------264 # Configuration::additions related to the search engine265 #---------------------------------------------------------------------------266 SEARCHENGINE = NO -
doc/DoxygenLayout.xml
r316 r928 3 3 <navindex> 4 4 <tab type="mainpage" visible="yes" title=""/> 5 <tab type="modules" visible="yes" title="" />5 <tab type="modules" visible="yes" title="" intro=""/> 6 6 <tab type="classes" visible="yes" title=""> 7 <tab type="classes" visible="yes" title="" />8 <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/> 9 <tab type="hierarchy" visible="yes" title="" />10 <tab type="classmembers" visible="yes" title="" />7 <tab type="classes" visible="yes" title="" intro=""/> 8 <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/> 9 <tab type="hierarchy" visible="yes" title="" intro=""/> 10 <tab type="classmembers" visible="yes" title="" intro=""/> 11 11 </tab> 12 12 <tab type="namespaces" visible="yes" title=""> 13 <tab type="namespaces" visible="yes" title="" />14 <tab type="namespacemembers" visible="yes" title="" />13 <tab type="namespaces" visible="yes" title="" intro=""/> 14 <tab type="namespacemembers" visible="yes" title="" intro=""/> 15 15 </tab> 16 16 <tab type="files" visible="yes" title=""> 17 <tab type="files" visible="yes" title="" />18 <tab type="globals" visible="yes" title="" />17 <tab type="files" visible="yes" title="" intro=""/> 18 <tab type="globals" visible="yes" title="" intro=""/> 19 19 </tab> 20 <tab type="dirs" visible="yes" title="" />21 <tab type="examples" visible="yes" title="" />22 <tab type="pages" visible="yes" title="" />20 <tab type="dirs" visible="yes" title="" intro=""/> 21 <tab type="examples" visible="yes" title="" intro=""/> 22 <tab type="pages" visible="yes" title="" intro=""/> 23 23 </navindex> 24 24 -
lemon/CMakeLists.txt
r679 r908 7 7 ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake 8 8 ${CMAKE_CURRENT_BINARY_DIR}/config.h 9 ) 10 11 CONFIGURE_FILE( 12 ${CMAKE_CURRENT_SOURCE_DIR}/lemon.pc.cmake 13 ${CMAKE_CURRENT_BINARY_DIR}/lemon.pc 14 @ONLY 9 15 ) 10 16 … … 67 73 COMPONENT headers 68 74 ) 75 76 INSTALL( 77 FILES ${CMAKE_CURRENT_BINARY_DIR}/lemon.pc 78 DESTINATION lib/pkgconfig 79 ) 80 -
lemon/circulation.h
r641 r688 454 454 /// 455 455 /// Sets the tolerance used by algorithm. 456 Circulation& tolerance(const Tolerance& tolerance) const{456 Circulation& tolerance(const Tolerance& tolerance) { 457 457 _tol = tolerance; 458 458 return *this; … … 463 463 /// Returns a const reference to the tolerance. 464 464 const Tolerance& tolerance() const { 465 return tolerance;465 return _tol; 466 466 } 467 467 -
lemon/matching.h
r651 r867 806 806 _matching = new MatchingMap(_graph); 807 807 } 808 808 809 if (!_node_potential) { 809 810 _node_potential = new NodePotential(_graph); 810 811 } 812 811 813 if (!_blossom_set) { 812 814 _blossom_index = new IntNodeMap(_graph); 813 815 _blossom_set = new BlossomSet(*_blossom_index); 814 816 _blossom_data = new RangeMap<BlossomData>(_blossom_num); 817 } else if (_blossom_data->size() != _blossom_num) { 818 delete _blossom_data; 819 _blossom_data = new RangeMap<BlossomData>(_blossom_num); 815 820 } 816 821 … … 819 824 _node_heap_index = new IntArcMap(_graph); 820 825 _node_data = new RangeMap<NodeData>(_node_num, 821 NodeData(*_node_heap_index)); 826 NodeData(*_node_heap_index)); 827 } else { 828 delete _node_data; 829 _node_data = new RangeMap<NodeData>(_node_num, 830 NodeData(*_node_heap_index)); 822 831 } 823 832 … … 825 834 _tree_set_index = new IntIntMap(_blossom_num); 826 835 _tree_set = new TreeSet(*_tree_set_index); 827 } 836 } else { 837 _tree_set_index->resize(_blossom_num); 838 } 839 828 840 if (!_delta1) { 829 841 _delta1_index = new IntNodeMap(_graph); 830 842 _delta1 = new BinHeap<Value, IntNodeMap>(*_delta1_index); 831 843 } 844 832 845 if (!_delta2) { 833 846 _delta2_index = new IntIntMap(_blossom_num); 834 847 _delta2 = new BinHeap<Value, IntIntMap>(*_delta2_index); 835 } 848 } else { 849 _delta2_index->resize(_blossom_num); 850 } 851 836 852 if (!_delta3) { 837 853 _delta3_index = new IntEdgeMap(_graph); 838 854 _delta3 = new BinHeap<Value, IntEdgeMap>(*_delta3_index); 839 855 } 856 840 857 if (!_delta4) { 841 858 _delta4_index = new IntIntMap(_blossom_num); 842 859 _delta4 = new BinHeap<Value, IntIntMap>(*_delta4_index); 860 } else { 861 _delta4_index->resize(_blossom_num); 843 862 } 844 863 } … … 1686 1705 createStructures(); 1687 1706 1707 _blossom_node_list.clear(); 1708 _blossom_potential.clear(); 1709 1688 1710 for (ArcIt e(_graph); e != INVALID; ++e) { 1689 1711 (*_node_heap_index)[e] = BinHeap<Value, IntArcMap>::PRE_HEAP; … … 1699 1721 (*_delta4_index)[i] = _delta4->PRE_HEAP; 1700 1722 } 1723 1724 _delta1->clear(); 1725 _delta2->clear(); 1726 _delta3->clear(); 1727 _delta4->clear(); 1728 _blossom_set->clear(); 1729 _tree_set->clear(); 1701 1730 1702 1731 int index = 0; … … 1710 1739 } 1711 1740 (*_node_index)[n] = index; 1741 (*_node_data)[index].heap_index.clear(); 1742 (*_node_data)[index].heap.clear(); 1712 1743 (*_node_data)[index].pot = max; 1713 1744 _delta1->push(n, max); … … 2199 2230 _matching = new MatchingMap(_graph); 2200 2231 } 2232 2201 2233 if (!_node_potential) { 2202 2234 _node_potential = new NodePotential(_graph); 2203 2235 } 2236 2204 2237 if (!_blossom_set) { 2205 2238 _blossom_index = new IntNodeMap(_graph); 2206 2239 _blossom_set = new BlossomSet(*_blossom_index); 2240 _blossom_data = new RangeMap<BlossomData>(_blossom_num); 2241 } else if (_blossom_data->size() != _blossom_num) { 2242 delete _blossom_data; 2207 2243 _blossom_data = new RangeMap<BlossomData>(_blossom_num); 2208 2244 } … … 2213 2249 _node_data = new RangeMap<NodeData>(_node_num, 2214 2250 NodeData(*_node_heap_index)); 2251 } else if (_node_data->size() != _node_num) { 2252 delete _node_data; 2253 _node_data = new RangeMap<NodeData>(_node_num, 2254 NodeData(*_node_heap_index)); 2215 2255 } 2216 2256 … … 2218 2258 _tree_set_index = new IntIntMap(_blossom_num); 2219 2259 _tree_set = new TreeSet(*_tree_set_index); 2220 } 2260 } else { 2261 _tree_set_index->resize(_blossom_num); 2262 } 2263 2221 2264 if (!_delta2) { 2222 2265 _delta2_index = new IntIntMap(_blossom_num); 2223 2266 _delta2 = new BinHeap<Value, IntIntMap>(*_delta2_index); 2224 } 2267 } else { 2268 _delta2_index->resize(_blossom_num); 2269 } 2270 2225 2271 if (!_delta3) { 2226 2272 _delta3_index = new IntEdgeMap(_graph); 2227 2273 _delta3 = new BinHeap<Value, IntEdgeMap>(*_delta3_index); 2228 2274 } 2275 2229 2276 if (!_delta4) { 2230 2277 _delta4_index = new IntIntMap(_blossom_num); 2231 2278 _delta4 = new BinHeap<Value, IntIntMap>(*_delta4_index); 2279 } else { 2280 _delta4_index->resize(_blossom_num); 2232 2281 } 2233 2282 } … … 2927 2976 createStructures(); 2928 2977 2978 _blossom_node_list.clear(); 2979 _blossom_potential.clear(); 2980 2929 2981 for (ArcIt e(_graph); e != INVALID; ++e) { 2930 2982 (*_node_heap_index)[e] = BinHeap<Value, IntArcMap>::PRE_HEAP; … … 2937 2989 (*_delta4_index)[i] = _delta4->PRE_HEAP; 2938 2990 } 2991 2992 _delta2->clear(); 2993 _delta3->clear(); 2994 _delta4->clear(); 2995 _blossom_set->clear(); 2996 _tree_set->clear(); 2939 2997 2940 2998 int index = 0; … … 2948 3006 } 2949 3007 (*_node_index)[n] = index; 3008 (*_node_data)[index].heap_index.clear(); 3009 (*_node_data)[index].heap.clear(); 2950 3010 (*_node_data)[index].pot = max; 2951 3011 int blossom = -
lemon/network_simplex.h
r663 r888 1043 1043 ART_COST = std::numeric_limits<Cost>::max() / 2 + 1; 1044 1044 } else { 1045 ART_COST = std::numeric_limits<Cost>::min();1045 ART_COST = 0; 1046 1046 for (int i = 0; i != _arc_num; ++i) { 1047 1047 if (_cost[i] > ART_COST) ART_COST = _cost[i]; … … 1458 1458 if (_sum_supply == 0) { 1459 1459 if (_stype == GEQ) { 1460 Cost max_pot = std::numeric_limits<Cost>::min();1460 Cost max_pot = -std::numeric_limits<Cost>::max(); 1461 1461 for (int i = 0; i != _node_num; ++i) { 1462 1462 if (_pi[i] > max_pot) max_pot = _pi[i]; -
lemon/preflow.h
r641 r923 375 375 /// 376 376 /// Sets the tolerance used by algorithm. 377 Preflow& tolerance(const Tolerance& tolerance) const{377 Preflow& tolerance(const Tolerance& tolerance) { 378 378 _tolerance = tolerance; 379 379 return *this; … … 384 384 /// Returns a const reference to the tolerance. 385 385 const Tolerance& tolerance() const { 386 return tolerance;386 return _tolerance; 387 387 } 388 388 … … 526 526 _flow->set(e, (*_capacity)[e]); 527 527 (*_excess)[u] += rem; 528 if (u != _target && !_level->active(u)) {529 _level->activate(u);530 }531 528 } 532 529 } … … 538 535 _flow->set(e, 0); 539 536 (*_excess)[v] += rem; 540 if (v != _target && !_level->active(v)) { 541 _level->activate(v); 542 } 543 } 544 } 537 } 538 } 539 for (NodeIt n(_graph); n != INVALID; ++n) 540 if(n!=_source && n!=_target && _tolerance.positive((*_excess)[n])) 541 _level->activate(n); 542 545 543 return true; 546 544 } … … 559 557 _phase = true; 560 558 561 Node n = _level->highestActive(); 562 int level = _level->highestActiveLevel(); 563 while (n != INVALID) { 559 while (true) { 564 560 int num = _node_num; 565 561 566 while (num > 0 && n != INVALID) { 562 Node n = INVALID; 563 int level = -1; 564 565 while (num > 0) { 566 n = _level->highestActive(); 567 if (n == INVALID) goto first_phase_done; 568 level = _level->highestActiveLevel(); 569 --num; 570 567 571 Value excess = (*_excess)[n]; 568 572 int new_level = _level->maxLevel(); … … 630 634 _level->deactivate(n); 631 635 } 632 633 n = _level->highestActive(); 634 level = _level->highestActiveLevel(); 636 } 637 638 num = _node_num * 20; 639 while (num > 0) { 640 while (level >= 0 && _level->activeFree(level)) { 641 --level; 642 } 643 if (level == -1) { 644 n = _level->highestActive(); 645 level = _level->highestActiveLevel(); 646 if (n == INVALID) goto first_phase_done; 647 } else { 648 n = _level->activeOn(level); 649 } 635 650 --num; 636 } 637 638 num = _node_num * 20; 639 while (num > 0 && n != INVALID) { 651 640 652 Value excess = (*_excess)[n]; 641 653 int new_level = _level->maxLevel(); … … 703 715 _level->deactivate(n); 704 716 } 705 706 while (level >= 0 && _level->activeFree(level)) { 707 --level; 708 } 709 if (level == -1) { 710 n = _level->highestActive(); 711 level = _level->highestActiveLevel(); 712 } else { 713 n = _level->activeOn(level); 714 } 715 --num; 716 } 717 } 717 } 718 } 719 first_phase_done:; 718 720 } 719 721 -
lemon/suurballe.h
r623 r852 56 56 /// The default value is <tt>GR::ArcMap<int></tt>. 57 57 /// 58 /// \warning Length values should be \e non-negative \e integers.58 /// \warning Length values should be \e non-negative. 59 59 /// 60 60 /// \note For finding node-disjoint paths this algorithm can be used … … 253 253 _graph(graph), _length(length), _flow(0), _local_flow(false), 254 254 _potential(0), _local_potential(false), _pred(graph) 255 { 256 LEMON_ASSERT(std::numeric_limits<Length>::is_integer, 257 "The length type of Suurballe must be integer"); 258 } 255 {} 259 256 260 257 /// Destructor. … … 521 518 /// \pre \ref run() or \ref findPaths() must be called before using 522 519 /// this function. 523 Pathpath(int i) const {520 const Path& path(int i) const { 524 521 return paths[i]; 525 522 } -
lemon/unionfind.h
r559 r867 740 740 void clear() { 741 741 items.clear(); 742 classes.clear ;742 classes.clear(); 743 743 firstClass = firstFreeClass = firstFreeItem = -1; 744 744 } … … 1289 1289 first_free_class(-1), first_free_node(-1) {} 1290 1290 1291 /// \brief Clears the union-find data structure 1292 /// 1293 /// Erase each item from the data structure. 1294 void clear() { 1295 nodes.clear(); 1296 classes.clear(); 1297 first_free_node = first_free_class = first_class = -1; 1298 } 1299 1291 1300 /// \brief Insert a new node into a new component. 1292 1301 /// -
m4/lx_check_coin.m4
r627 r749 89 89 CBC_LDFLAGS="-L$with_coin/lib" 90 90 fi 91 CBC_LIBS="-lOsi -lCbc -l OsiCbc -lCbcSolver -lClp -lOsiClp -lCoinUtils -lVol -lOsiVol -lCgl -lm -llapack -lblas"91 CBC_LIBS="-lOsi -lCbc -lCbcSolver -lClp -lOsiClp -lCoinUtils -lVol -lOsiVol -lCgl -lm -llapack -lblas" 92 92 93 93 lx_save_cxxflags="$CXXFLAGS" -
test/CMakeLists.txt
r679 r933 7 7 ${PROJECT_BINARY_DIR}/lemon 8 8 ) 9 10 SET(TEST_WITH_VALGRIND "NO" CACHE STRING 11 "Run the test with valgrind (YES/NO).") 12 SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.") 9 13 10 14 SET(TESTS … … 42 46 43 47 IF(LEMON_HAVE_LP) 44 ADD_EXECUTABLE(lp_test lp_test.cc) 48 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") 49 ADD_EXECUTABLE(lp_test lp_test.cc) 50 ELSE() 51 ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc) 52 ENDIF() 53 45 54 SET(LP_TEST_LIBS lemon) 46 55 … … 78 87 79 88 IF(LEMON_HAVE_MIP) 80 ADD_EXECUTABLE(mip_test mip_test.cc) 89 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") 90 ADD_EXECUTABLE(mip_test mip_test.cc) 91 ELSE() 92 ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc) 93 ENDIF() 94 81 95 SET(MIP_TEST_LIBS lemon) 82 96 … … 114 128 115 129 FOREACH(TEST_NAME ${TESTS}) 116 ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc) 130 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") 131 ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc) 132 ELSE() 133 ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc) 134 ENDIF() 117 135 TARGET_LINK_LIBRARIES(${TEST_NAME} lemon) 118 ADD_TEST(${TEST_NAME} ${TEST_NAME}) 136 IF(TEST_WITH_VALGRIND) 137 ADD_TEST(${TEST_NAME} 138 valgrind --error-exitcode=1 ${VALGRIND_FLAGS} 139 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} ) 140 ELSE() 141 ADD_TEST(${TEST_NAME} ${TEST_NAME}) 142 ENDIF() 143 ADD_DEPENDENCIES(check ${TEST_NAME}) 119 144 ENDFOREACH() -
test/mip_test.cc
r631 r748 51 51 if (stat == MipSolver::OPTIMAL) { 52 52 std::ostringstream sbuf; 53 buf << "Wrong optimal value: the right optimum is " << exp_opt; 53 sbuf << "Wrong optimal value ("<< mip.solValue() 54 <<" instead of " << exp_opt << ")"; 54 55 check(std::abs(mip.solValue()-exp_opt) < 1e-3, sbuf.str()); 55 56 //+ecvt(exp_opt,2) -
test/preflow_test.cc
r585 r923 152 152 } 153 153 154 void initFlowTest() 155 { 156 DIGRAPH_TYPEDEFS(SmartDigraph); 157 158 SmartDigraph g; 159 SmartDigraph::ArcMap<int> cap(g),iflow(g); 160 Node s=g.addNode(); Node t=g.addNode(); 161 Node n1=g.addNode(); Node n2=g.addNode(); 162 Arc a; 163 a=g.addArc(s,n1); cap[a]=20; iflow[a]=20; 164 a=g.addArc(n1,n2); cap[a]=10; iflow[a]=0; 165 a=g.addArc(n2,t); cap[a]=20; iflow[a]=0; 166 167 Preflow<SmartDigraph> pre(g,cap,s,t); 168 pre.init(iflow); 169 pre.startFirstPhase(); 170 check(pre.flowValue() == 10, "The incorrect max flow value."); 171 check(pre.minCut(s), "Wrong min cut (Node s)."); 172 check(pre.minCut(n1), "Wrong min cut (Node n1)."); 173 check(!pre.minCut(n2), "Wrong min cut (Node n2)."); 174 check(!pre.minCut(t), "Wrong min cut (Node t)."); 175 } 176 177 154 178 int main() { 155 179 … … 242 266 "The max flow value or the three min cut values are incorrect."); 243 267 268 initFlowTest(); 269 244 270 return 0; 245 271 }
Note: See TracChangeset
for help on using the changeset viewer.