Changes in / [913:64260c0f58eb:938:98ddf8d5fda9] in lemon-1.2
- Files:
-
- 5 added
- 1 deleted
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
AUTHORS
r320 r924 24 24 25 25 Again, please visit the history of the old LEMON repository for more 26 details: http://lemon.cs.elte.hu/ svn/lemon/trunk26 details: http://lemon.cs.elte.hu/hg/lemon-0.x -
cmake/FindCOIN.cmake
r634 r920 6 6 FIND_LIBRARY(COIN_CBC_LIBRARY 7 7 NAMES Cbc libCbc 8 HINTS ${COIN_ROOT_DIR}/lib/coin 8 9 HINTS ${COIN_ROOT_DIR}/lib 9 10 ) 10 11 FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY 11 12 NAMES CbcSolver libCbcSolver 13 HINTS ${COIN_ROOT_DIR}/lib/coin 12 14 HINTS ${COIN_ROOT_DIR}/lib 13 15 ) 14 16 FIND_LIBRARY(COIN_CGL_LIBRARY 15 17 NAMES Cgl libCgl 18 HINTS ${COIN_ROOT_DIR}/lib/coin 16 19 HINTS ${COIN_ROOT_DIR}/lib 17 20 ) 18 21 FIND_LIBRARY(COIN_CLP_LIBRARY 19 22 NAMES Clp libClp 23 HINTS ${COIN_ROOT_DIR}/lib/coin 20 24 HINTS ${COIN_ROOT_DIR}/lib 21 25 ) 22 26 FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY 23 27 NAMES CoinUtils libCoinUtils 28 HINTS ${COIN_ROOT_DIR}/lib/coin 24 29 HINTS ${COIN_ROOT_DIR}/lib 25 30 ) 26 31 FIND_LIBRARY(COIN_OSI_LIBRARY 27 32 NAMES Osi libOsi 33 HINTS ${COIN_ROOT_DIR}/lib/coin 28 34 HINTS ${COIN_ROOT_DIR}/lib 29 35 ) 30 36 FIND_LIBRARY(COIN_OSI_CBC_LIBRARY 31 37 NAMES OsiCbc libOsiCbc 38 HINTS ${COIN_ROOT_DIR}/lib/coin 32 39 HINTS ${COIN_ROOT_DIR}/lib 33 40 ) 34 41 FIND_LIBRARY(COIN_OSI_CLP_LIBRARY 35 42 NAMES OsiClp libOsiClp 43 HINTS ${COIN_ROOT_DIR}/lib/coin 36 44 HINTS ${COIN_ROOT_DIR}/lib 37 45 ) 38 46 FIND_LIBRARY(COIN_OSI_VOL_LIBRARY 39 47 NAMES OsiVol libOsiVol 48 HINTS ${COIN_ROOT_DIR}/lib/coin 40 49 HINTS ${COIN_ROOT_DIR}/lib 41 50 ) 42 51 FIND_LIBRARY(COIN_VOL_LIBRARY 43 52 NAMES Vol libVol 53 HINTS ${COIN_ROOT_DIR}/lib/coin 44 54 HINTS ${COIN_ROOT_DIR}/lib 45 55 ) … … 56 66 COIN_OSI_CBC_LIBRARY 57 67 COIN_OSI_CLP_LIBRARY 58 COIN_OSI_VOL_LIBRARY59 COIN_VOL_LIBRARY68 # COIN_OSI_VOL_LIBRARY 69 # COIN_VOL_LIBRARY 60 70 ) 61 71 62 72 IF(COIN_FOUND) 63 73 SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR}) 64 SET(COIN_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY} ;${COIN_OSI_VOL_LIBRARY};${COIN_VOL_LIBRARY}")74 SET(COIN_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY}") 65 75 SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}") 66 76 SET(COIN_CBC_LIBRARIES ${COIN_LIBRARIES}) -
configure.ac
r680 r907 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
r904 r907 9 9 ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in 10 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 11 17 @ONLY 12 18 ) -
doc/Doxyfile.in
r904 r907 1 # Doxyfile 1. 5.91 # 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 … … 30 32 OPTIMIZE_FOR_FORTRAN = NO 31 33 OPTIMIZE_OUTPUT_VHDL = NO 34 EXTENSION_MAPPING = 32 35 BUILTIN_STL_SUPPORT = YES 33 36 CPP_CLI_SUPPORT = NO … … 55 58 HIDE_SCOPE_NAMES = YES 56 59 SHOW_INCLUDE_FILES = YES 60 FORCE_LOCAL_INCLUDES = NO 57 61 INLINE_INFO = YES 58 62 SORT_MEMBER_DOCS = NO 59 63 SORT_BRIEF_DOCS = NO 64 SORT_MEMBERS_CTORS_1ST = NO 60 65 SORT_GROUP_NAMES = NO 61 66 SORT_BY_SCOPE_NAME = NO 67 STRICT_PROTO_MATCHING = NO 62 68 GENERATE_TODOLIST = YES 63 69 GENERATE_TESTLIST = YES … … 91 97 "@abs_top_srcdir@/demo" \ 92 98 "@abs_top_srcdir@/tools" \ 93 "@abs_top_srcdir@/test/test_tools.h" 99 "@abs_top_srcdir@/test/test_tools.h" \ 100 "@abs_top_builddir@/doc/mainpage.dox" 94 101 INPUT_ENCODING = UTF-8 95 102 FILE_PATTERNS = *.h \ … … 111 118 FILTER_PATTERNS = 112 119 FILTER_SOURCE_FILES = NO 120 FILTER_SOURCE_PATTERNS = 113 121 #--------------------------------------------------------------------------- 114 122 # configuration options related to source browsing … … 137 145 HTML_FOOTER = 138 146 HTML_STYLESHEET = 147 HTML_COLORSTYLE_HUE = 220 148 HTML_COLORSTYLE_SAT = 100 149 HTML_COLORSTYLE_GAMMA = 80 150 HTML_TIMESTAMP = YES 139 151 HTML_ALIGN_MEMBERS = YES 140 HTML_DYNAMIC_SECTIONS = NO152 HTML_DYNAMIC_SECTIONS = YES 141 153 GENERATE_DOCSET = NO 142 154 DOCSET_FEEDNAME = "Doxygen generated docs" 143 155 DOCSET_BUNDLE_ID = org.doxygen.Project 156 DOCSET_PUBLISHER_ID = org.doxygen.Publisher 157 DOCSET_PUBLISHER_NAME = Publisher 144 158 GENERATE_HTMLHELP = NO 145 159 CHM_FILE = … … 153 167 QHP_NAMESPACE = org.doxygen.Project 154 168 QHP_VIRTUAL_FOLDER = doc 169 QHP_CUST_FILTER_NAME = 170 QHP_CUST_FILTER_ATTRS = 171 QHP_SECT_FILTER_ATTRS = 155 172 QHG_LOCATION = 173 GENERATE_ECLIPSEHELP = NO 174 ECLIPSE_DOC_ID = org.doxygen.Project 156 175 DISABLE_INDEX = NO 157 176 ENUM_VALUES_PER_LINE = 4 158 177 GENERATE_TREEVIEW = NO 178 USE_INLINE_TREES = NO 159 179 TREEVIEW_WIDTH = 250 180 EXT_LINKS_IN_WINDOW = NO 160 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 161 187 #--------------------------------------------------------------------------- 162 188 # configuration options related to the LaTeX output … … 175 201 LATEX_BATCHMODE = NO 176 202 LATEX_HIDE_INDICES = NO 203 LATEX_SOURCE_CODE = NO 177 204 #--------------------------------------------------------------------------- 178 205 # configuration options related to the RTF output … … 223 250 SKIP_FUNCTION_MACROS = YES 224 251 #--------------------------------------------------------------------------- 225 # Options related to the search engine252 # Configuration::additions related to external references 226 253 #--------------------------------------------------------------------------- 227 254 TAGFILES = "@abs_top_builddir@/doc/libstdc++.tag = http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/ " … … 237 264 HIDE_UNDOC_RELATIONS = YES 238 265 HAVE_DOT = YES 266 DOT_NUM_THREADS = 0 239 267 DOT_FONTNAME = FreeSans 240 268 DOT_FONTSIZE = 10 … … 254 282 DOT_PATH = 255 283 DOTFILE_DIRS = 284 MSCFILE_DIRS = 256 285 DOT_GRAPH_MAX_NODES = 50 257 286 MAX_DOT_GRAPH_DEPTH = 0 … … 260 289 GENERATE_LEGEND = YES 261 290 DOT_CLEANUP = YES 262 #---------------------------------------------------------------------------263 # Configuration::additions related to the search engine264 #---------------------------------------------------------------------------265 SEARCHENGINE = NO -
doc/DoxygenLayout.xml
r316 r906 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 -
doc/lgf.dox
r440 r923 64 64 \endcode 65 65 66 The \c \@arcs section is very similar to the \c \@nodes section, 67 it again starts with a header line describing the names of the maps, 68 butthe \c "label" map is not obligatory here. The following lines69 describe the arcs. The first two tokens of each line are 70 the sourceand the target node of the arc, respectively, then come the map66 The \c \@arcs section is very similar to the \c \@nodes section, it 67 again starts with a header line describing the names of the maps, but 68 the \c "label" map is not obligatory here. The following lines 69 describe the arcs. The first two tokens of each line are the source 70 and the target node of the arc, respectively, then come the map 71 71 values. The source and target tokens must be node labels. 72 72 … … 79 79 \endcode 80 80 81 If there is no map in the \c \@arcs section at all, then it must be 82 indicated by a sole '-' sign in the first line. 83 84 \code 85 @arcs 86 - 87 1 2 88 1 3 89 2 3 90 \endcode 91 81 92 The \c \@edges is just a synonym of \c \@arcs. The \@arcs section can 82 93 also store the edge set of an undirected graph. In such case there is 83 94 a conventional method for store arc maps in the file, if two columns 84 ha sthe same caption with \c '+' and \c '-' prefix, then these columns95 have the same caption with \c '+' and \c '-' prefix, then these columns 85 96 can be regarded as the values of an arc map. 86 97 -
lemon/Makefile.am
r667 r937 1 1 EXTRA_DIST += \ 2 2 lemon/lemon.pc.in \ 3 lemon/lemon.pc.cmake \ 3 4 lemon/CMakeLists.txt \ 4 5 lemon/config.h.cmake … … 60 61 lemon/bfs.h \ 61 62 lemon/bin_heap.h \ 63 lemon/bucket_heap.h \ 62 64 lemon/cbc.h \ 63 65 lemon/circulation.h \ … … 77 79 lemon/error.h \ 78 80 lemon/euler.h \ 81 lemon/fib_heap.h \ 79 82 lemon/full_graph.h \ 80 83 lemon/glpk.h \ … … 100 103 lemon/path.h \ 101 104 lemon/preflow.h \ 105 lemon/radix_heap.h \ 102 106 lemon/radix_sort.h \ 103 107 lemon/random.h \ -
lemon/bin_heap.h
r584 r683 34 34 ///\brief A Binary Heap implementation. 35 35 /// 36 ///This class implements the \e binary \e heap data structure. 37 /// 36 ///This class implements the \e binary \e heap data structure. 37 /// 38 38 ///A \e heap is a data structure for storing items with specified values 39 39 ///called \e priorities in such a way that finding the item with minimum 40 ///priority is efficient. \c C ompspecifies the ordering of the priorities.40 ///priority is efficient. \c CMP specifies the ordering of the priorities. 41 41 ///In a heap one can change the priority of an item, add or erase an 42 42 ///item, etc. … … 45 45 ///\tparam IM A read and writable item map with int values, used internally 46 46 ///to handle the cross references. 47 ///\tparam C ompA functor class for the ordering of the priorities.47 ///\tparam CMP A functor class for the ordering of the priorities. 48 48 ///The default is \c std::less<PR>. 49 49 /// 50 50 ///\sa FibHeap 51 51 ///\sa Dijkstra 52 template <typename PR, typename IM, typename C omp= std::less<PR> >52 template <typename PR, typename IM, typename CMP = std::less<PR> > 53 53 class BinHeap { 54 54 … … 63 63 typedef std::pair<Item,Prio> Pair; 64 64 ///\e 65 typedef C ompCompare;65 typedef CMP Compare; 66 66 67 67 /// \brief Type to represent the items states. -
lemon/bits/map_extender.h
r617 r802 50 50 typedef typename Parent::ConstReference ConstReference; 51 51 52 typedef typename Parent::ReferenceMapTag ReferenceMapTag; 53 52 54 class MapIt; 53 55 class ConstMapIt; … … 83 85 typedef typename Map::Value Value; 84 86 85 MapIt() {}86 87 MapIt(Invalid i) : Parent(i) {}88 89 explicit MapIt(Map& _map) : map( _map) {90 map .notifier()->first(*this);87 MapIt() : map(NULL) {} 88 89 MapIt(Invalid i) : Parent(i), map(NULL) {} 90 91 explicit MapIt(Map& _map) : map(&_map) { 92 map->notifier()->first(*this); 91 93 } 92 94 93 95 MapIt(const Map& _map, const Item& item) 96 : Parent(item), map(&_map) {} 97 98 MapIt& operator++() { 99 map->notifier()->next(*this); 100 return *this; 101 } 102 103 typename MapTraits<Map>::ConstReturnValue operator*() const { 104 return (*map)[*this]; 105 } 106 107 typename MapTraits<Map>::ReturnValue operator*() { 108 return (*map)[*this]; 109 } 110 111 void set(const Value& value) { 112 map->set(*this, value); 113 } 114 115 protected: 116 Map* map; 117 118 }; 119 120 class ConstMapIt : public Item { 121 typedef Item Parent; 122 123 public: 124 125 typedef typename Map::Value Value; 126 127 ConstMapIt() : map(NULL) {} 128 129 ConstMapIt(Invalid i) : Parent(i), map(NULL) {} 130 131 explicit ConstMapIt(Map& _map) : map(&_map) { 132 map->notifier()->first(*this); 133 } 134 135 ConstMapIt(const Map& _map, const Item& item) 94 136 : Parent(item), map(_map) {} 95 137 96 MapIt& operator++() {97 map .notifier()->next(*this);138 ConstMapIt& operator++() { 139 map->notifier()->next(*this); 98 140 return *this; 99 141 } … … 103 145 } 104 146 105 typename MapTraits<Map>::ReturnValue operator*() { 106 return map[*this]; 107 } 108 109 void set(const Value& value) { 110 map.set(*this, value); 111 } 112 113 protected: 114 Map& map; 115 116 }; 117 118 class ConstMapIt : public Item { 119 typedef Item Parent; 120 121 public: 122 123 typedef typename Map::Value Value; 124 125 ConstMapIt() {} 126 127 ConstMapIt(Invalid i) : Parent(i) { } 128 129 explicit ConstMapIt(Map& _map) : map(_map) { 130 map.notifier()->first(*this); 131 } 132 133 ConstMapIt(const Map& _map, const Item& item) 134 : Parent(item), map(_map) {} 135 136 ConstMapIt& operator++() { 137 map.notifier()->next(*this); 138 return *this; 139 } 140 141 typename MapTraits<Map>::ConstReturnValue operator*() const { 142 return map[*this]; 143 } 144 145 protected: 146 const Map& map; 147 protected: 148 const Map* map; 147 149 }; 148 150 … … 151 153 152 154 public: 153 154 ItemIt() {} 155 156 ItemIt(Invalid i) : Parent(i) {}157 158 explicit ItemIt(Map& _map) : map( _map) {159 map .notifier()->first(*this);155 ItemIt() : map(NULL) {} 156 157 158 ItemIt(Invalid i) : Parent(i), map(NULL) {} 159 160 explicit ItemIt(Map& _map) : map(&_map) { 161 map->notifier()->first(*this); 160 162 } 161 163 162 164 ItemIt(const Map& _map, const Item& item) 163 : Parent(item), map( _map) {}165 : Parent(item), map(&_map) {} 164 166 165 167 ItemIt& operator++() { 166 map .notifier()->next(*this);167 return *this; 168 } 169 170 protected: 171 const Map ↦168 map->notifier()->next(*this); 169 return *this; 170 } 171 172 protected: 173 const Map* map; 172 174 173 175 }; … … 192 194 typedef typename Parent::ConstReference ConstReference; 193 195 196 typedef typename Parent::ReferenceMapTag ReferenceMapTag; 197 194 198 class MapIt; 195 199 class ConstMapIt; … … 228 232 typedef typename Map::Value Value; 229 233 230 MapIt() {}231 232 MapIt(Invalid i) : Parent(i) { }233 234 explicit MapIt(Map& _map) : map( _map) {235 map .graph.first(*this);234 MapIt() : map(NULL) {} 235 236 MapIt(Invalid i) : Parent(i), map(NULL) { } 237 238 explicit MapIt(Map& _map) : map(&_map) { 239 map->graph.first(*this); 236 240 } 237 241 238 242 MapIt(const Map& _map, const Item& item) 239 : Parent(item), map( _map) {}243 : Parent(item), map(&_map) {} 240 244 241 245 MapIt& operator++() { 242 map .graph.next(*this);246 map->graph.next(*this); 243 247 return *this; 244 248 } 245 249 246 250 typename MapTraits<Map>::ConstReturnValue operator*() const { 247 return map[*this];251 return (*map)[*this]; 248 252 } 249 253 250 254 typename MapTraits<Map>::ReturnValue operator*() { 251 return map[*this];255 return (*map)[*this]; 252 256 } 253 257 254 258 void set(const Value& value) { 255 map .set(*this, value);256 } 257 258 protected: 259 Map ↦259 map->set(*this, value); 260 } 261 262 protected: 263 Map* map; 260 264 261 265 }; … … 268 272 typedef typename Map::Value Value; 269 273 270 ConstMapIt() {}271 272 ConstMapIt(Invalid i) : Parent(i) { }273 274 explicit ConstMapIt(Map& _map) : map( _map) {275 map .graph.first(*this);274 ConstMapIt() : map(NULL) {} 275 276 ConstMapIt(Invalid i) : Parent(i), map(NULL) { } 277 278 explicit ConstMapIt(Map& _map) : map(&_map) { 279 map->graph.first(*this); 276 280 } 277 281 278 282 ConstMapIt(const Map& _map, const Item& item) 279 : Parent(item), map( _map) {}283 : Parent(item), map(&_map) {} 280 284 281 285 ConstMapIt& operator++() { 282 map .graph.next(*this);286 map->graph.next(*this); 283 287 return *this; 284 288 } 285 289 286 290 typename MapTraits<Map>::ConstReturnValue operator*() const { 287 return map[*this];288 } 289 290 protected: 291 const Map ↦291 return (*map)[*this]; 292 } 293 294 protected: 295 const Map* map; 292 296 }; 293 297 … … 296 300 297 301 public: 298 299 ItemIt() {} 300 301 ItemIt(Invalid i) : Parent(i) { }302 303 explicit ItemIt(Map& _map) : map( _map) {304 map .graph.first(*this);302 ItemIt() : map(NULL) {} 303 304 305 ItemIt(Invalid i) : Parent(i), map(NULL) { } 306 307 explicit ItemIt(Map& _map) : map(&_map) { 308 map->graph.first(*this); 305 309 } 306 310 307 311 ItemIt(const Map& _map, const Item& item) 308 : Parent(item), map( _map) {}312 : Parent(item), map(&_map) {} 309 313 310 314 ItemIt& operator++() { 311 map .graph.next(*this);312 return *this; 313 } 314 315 protected: 316 const Map ↦315 map->graph.next(*this); 316 return *this; 317 } 318 319 protected: 320 const Map* map; 317 321 318 322 }; -
lemon/bits/path_dump.h
r529 r890 50 50 51 51 bool empty() const { 52 return predMap[target] != INVALID;52 return predMap[target] == INVALID; 53 53 } 54 54 … … 124 124 125 125 bool empty() const { 126 return source != target;126 return predMatrixMap(source, target) == INVALID; 127 127 } 128 128 -
lemon/concepts/maps.h
r529 r718 183 183 template<typename _ReferenceMap> 184 184 struct Constraints { 185 void constraints() { 185 typename enable_if<typename _ReferenceMap::ReferenceMapTag, void>::type 186 constraints() { 186 187 checkConcept<ReadWriteMap<K, T>, _ReferenceMap >(); 187 188 ref = m[key]; -
lemon/core.h
r671 r937 395 395 static void copy(const From& from, Digraph &to, 396 396 NodeRefMap& nodeRefMap, ArcRefMap& arcRefMap) { 397 to.clear(); 397 398 for (typename From::NodeIt it(from); it != INVALID; ++it) { 398 399 nodeRefMap[it] = to.addNode(); … … 422 423 static void copy(const From& from, Graph &to, 423 424 NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) { 425 to.clear(); 424 426 for (typename From::NodeIt it(from); it != INVALID; ++it) { 425 427 nodeRefMap[it] = to.addNode(); -
lemon/dfs.h
r584 r937 558 558 void start(Node t) 559 559 { 560 while ( !emptyQueue() && G->target(_stack[_stack_head])!=t)560 while ( !emptyQueue() && !(*_reached)[t] ) 561 561 processNextArc(); 562 562 } … … 1510 1510 /// with addSource() before using this function. 1511 1511 void start(Node t) { 1512 while ( !emptyQueue() && _digraph->target(_stack[_stack_head]) != t)1512 while ( !emptyQueue() && !(*_reached)[t] ) 1513 1513 processNextArc(); 1514 1514 } -
lemon/glpk.h
r650 r832 26 26 #include <lemon/lp_base.h> 27 27 28 // forward declaration29 #if !defined _GLP_PROB && !defined GLP_PROB30 #define _GLP_PROB31 #define GLP_PROB32 typedef struct { double _opaque_prob; } glp_prob;33 /* LP/MIP problem object */34 #endif35 36 28 namespace lemon { 37 29 30 namespace _solver_bits { 31 class VoidPtr { 32 private: 33 void *_ptr; 34 public: 35 VoidPtr() : _ptr(0) {} 36 37 template <typename T> 38 VoidPtr(T* ptr) : _ptr(reinterpret_cast<void*>(ptr)) {} 39 40 template <typename T> 41 VoidPtr& operator=(T* ptr) { 42 _ptr = reinterpret_cast<void*>(ptr); 43 return *this; 44 } 45 46 template <typename T> 47 operator T*() const { return reinterpret_cast<T*>(_ptr); } 48 }; 49 } 38 50 39 51 /// \brief Base interface for the GLPK LP and MIP solver … … 44 56 protected: 45 57 46 typedef glp_prob LPX; 47 glp_prob* lp; 58 _solver_bits::VoidPtr lp; 48 59 49 60 GlpkBase(); … … 123 134 124 135 ///Pointer to the underlying GLPK data structure. 125 LPX *lpx() {return lp;}136 _solver_bits::VoidPtr lpx() {return lp;} 126 137 ///Const pointer to the underlying GLPK data structure. 127 const LPX *lpx() const {return lp;}138 _solver_bits::VoidPtr lpx() const {return lp;} 128 139 129 140 ///Returns the constraint identifier understood by GLPK. -
lemon/graph_to_eps.h
r617 r937 685 685 #else 686 686 os << bits::getWinFormattedDate(); 687 os << std::endl; 687 688 #endif 688 689 } 689 os << std::endl;690 690 691 691 if (_autoArcWidthScale) { -
lemon/lgf_reader.h
r599 r937 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 965 965 int index = 0; 966 966 while (_reader_bits::readToken(line, map)) { 967 if(map == "-") { 968 if(index!=0) 969 throw FormatError("'-' is not allowed as a map name"); 970 else if (line >> std::ws >> c) 971 throw FormatError("Extra character at the end of line"); 972 else break; 973 } 967 974 if (maps.find(map) != maps.end()) { 968 975 std::ostringstream msg; … … 1835 1842 int index = 0; 1836 1843 while (_reader_bits::readToken(line, map)) { 1844 if(map == "-") { 1845 if(index!=0) 1846 throw FormatError("'-' is not allowed as a map name"); 1847 else if (line >> std::ws >> c) 1848 throw FormatError("Extra character at the end of line"); 1849 else break; 1850 } 1837 1851 if (maps.find(map) != maps.end()) { 1838 1852 std::ostringstream msg; -
lemon/lp_base.h
r584 r932 1605 1605 inline LpBase::Constr operator<=(const LpBase::Expr &e, 1606 1606 const LpBase::Expr &f) { 1607 return LpBase::Constr(0, f - e, LpBase:: INF);1607 return LpBase::Constr(0, f - e, LpBase::NaN); 1608 1608 } 1609 1609 … … 1623 1623 inline LpBase::Constr operator<=(const LpBase::Expr &e, 1624 1624 const LpBase::Value &f) { 1625 return LpBase::Constr( - LpBase::INF, e, f);1625 return LpBase::Constr(LpBase::NaN, e, f); 1626 1626 } 1627 1627 … … 1632 1632 inline LpBase::Constr operator>=(const LpBase::Expr &e, 1633 1633 const LpBase::Expr &f) { 1634 return LpBase::Constr(0, e - f, LpBase:: INF);1634 return LpBase::Constr(0, e - f, LpBase::NaN); 1635 1635 } 1636 1636 … … 1652 1652 inline LpBase::Constr operator>=(const LpBase::Expr &e, 1653 1653 const LpBase::Value &f) { 1654 return LpBase::Constr(f, e, LpBase:: INF);1654 return LpBase::Constr(f, e, LpBase::NaN); 1655 1655 } 1656 1656 -
lemon/path.h
r559 r802 71 71 template <typename CPath> 72 72 Path(const CPath& cpath) { 73 copyPath(*this, cpath);73 pathCopy(cpath, *this); 74 74 } 75 75 … … 79 79 template <typename CPath> 80 80 Path& operator=(const CPath& cpath) { 81 copyPath(*this, cpath);81 pathCopy(cpath, *this); 82 82 return *this; 83 83 } … … 259 259 template <typename CPath> 260 260 SimplePath(const CPath& cpath) { 261 copyPath(*this, cpath);261 pathCopy(cpath, *this); 262 262 } 263 263 … … 268 268 template <typename CPath> 269 269 SimplePath& operator=(const CPath& cpath) { 270 copyPath(*this, cpath);270 pathCopy(cpath, *this); 271 271 return *this; 272 272 } … … 438 438 template <typename CPath> 439 439 ListPath(const CPath& cpath) : first(0), last(0) { 440 copyPath(*this, cpath);440 pathCopy(cpath, *this); 441 441 } 442 442 … … 454 454 template <typename CPath> 455 455 ListPath& operator=(const CPath& cpath) { 456 copyPath(*this, cpath);456 pathCopy(cpath, *this); 457 457 return *this; 458 458 } … … 764 764 template <typename CPath> 765 765 StaticPath(const CPath& cpath) : arcs(0) { 766 copyPath(*this, cpath);766 pathCopy(cpath, *this); 767 767 } 768 768 … … 780 780 template <typename CPath> 781 781 StaticPath& operator=(const CPath& cpath) { 782 copyPath(*this, cpath);782 pathCopy(cpath, *this); 783 783 return *this; 784 784 } … … 929 929 }; 930 930 931 template <typename Target, typename Source,932 bool buildEnable = BuildTagIndicator<T arget>::value>931 template <typename From, typename To, 932 bool buildEnable = BuildTagIndicator<To>::value> 933 933 struct PathCopySelectorForward { 934 static void copy( Target& target, const Source& source) {935 t arget.clear();936 for (typename Source::ArcIt it(source); it != INVALID; ++it) {937 t arget.addBack(it);934 static void copy(const From& from, To& to) { 935 to.clear(); 936 for (typename From::ArcIt it(from); it != INVALID; ++it) { 937 to.addBack(it); 938 938 } 939 939 } 940 940 }; 941 941 942 template <typename Target, typename Source>943 struct PathCopySelectorForward< Target, Source, true> {944 static void copy( Target& target, const Source& source) {945 t arget.clear();946 t arget.build(source);947 } 948 }; 949 950 template <typename Target, typename Source,951 bool buildEnable = BuildTagIndicator<T arget>::value>942 template <typename From, typename To> 943 struct PathCopySelectorForward<From, To, true> { 944 static void copy(const From& from, To& to) { 945 to.clear(); 946 to.build(from); 947 } 948 }; 949 950 template <typename From, typename To, 951 bool buildEnable = BuildTagIndicator<To>::value> 952 952 struct PathCopySelectorBackward { 953 static void copy( Target& target, const Source& source) {954 t arget.clear();955 for (typename Source::RevArcIt it(source); it != INVALID; ++it) {956 t arget.addFront(it);953 static void copy(const From& from, To& to) { 954 to.clear(); 955 for (typename From::RevArcIt it(from); it != INVALID; ++it) { 956 to.addFront(it); 957 957 } 958 958 } 959 959 }; 960 960 961 template <typename Target, typename Source>962 struct PathCopySelectorBackward< Target, Source, true> {963 static void copy( Target& target, const Source& source) {964 t arget.clear();965 t arget.buildRev(source);961 template <typename From, typename To> 962 struct PathCopySelectorBackward<From, To, true> { 963 static void copy(const From& from, To& to) { 964 to.clear(); 965 to.buildRev(from); 966 966 } 967 967 }; 968 968 969 969 970 template <typename Target, typename Source,971 bool revEnable = RevPathTagIndicator< Source>::value>970 template <typename From, typename To, 971 bool revEnable = RevPathTagIndicator<From>::value> 972 972 struct PathCopySelector { 973 static void copy( Target& target, const Source& source) {974 PathCopySelectorForward< Target, Source>::copy(target, source);973 static void copy(const From& from, To& to) { 974 PathCopySelectorForward<From, To>::copy(from, to); 975 975 } 976 976 }; 977 977 978 template <typename Target, typename Source>979 struct PathCopySelector< Target, Source, true> {980 static void copy( Target& target, const Source& source) {981 PathCopySelectorBackward< Target, Source>::copy(target, source);978 template <typename From, typename To> 979 struct PathCopySelector<From, To, true> { 980 static void copy(const From& from, To& to) { 981 PathCopySelectorBackward<From, To>::copy(from, to); 982 982 } 983 983 }; … … 988 988 /// \brief Make a copy of a path. 989 989 /// 990 /// This function makes a copy of a path. 991 template <typename Target, typename Source> 992 void copyPath(Target& target, const Source& source) { 993 checkConcept<concepts::PathDumper<typename Source::Digraph>, Source>(); 994 _path_bits::PathCopySelector<Target, Source>::copy(target, source); 990 /// This function makes a copy of a path. 991 template <typename From, typename To> 992 void pathCopy(const From& from, To& to) { 993 checkConcept<concepts::PathDumper<typename From::Digraph>, From>(); 994 _path_bits::PathCopySelector<From, To>::copy(from, to); 995 } 996 997 /// \brief Deprecated version of \ref pathCopy(). 998 /// 999 /// Deprecated version of \ref pathCopy() (only for reverse compatibility). 1000 template <typename To, typename From> 1001 void copyPath(To& to, const From& from) { 1002 pathCopy(from, to); 995 1003 } 996 1004 … … 1016 1024 /// \brief The source of a path 1017 1025 /// 1018 /// This function returns the source of the given path. 1026 /// This function returns the source node of the given path. 1027 /// If the path is empty, then it returns \c INVALID. 1019 1028 template <typename Digraph, typename Path> 1020 1029 typename Digraph::Node pathSource(const Digraph& digraph, const Path& path) { 1021 return digraph.source(path.front());1030 return path.empty() ? INVALID : digraph.source(path.front()); 1022 1031 } 1023 1032 1024 1033 /// \brief The target of a path 1025 1034 /// 1026 /// This function returns the target of the given path. 1035 /// This function returns the target node of the given path. 1036 /// If the path is empty, then it returns \c INVALID. 1027 1037 template <typename Digraph, typename Path> 1028 1038 typename Digraph::Node pathTarget(const Digraph& digraph, const Path& path) { 1029 return digraph.target(path.back());1039 return path.empty() ? INVALID : digraph.target(path.back()); 1030 1040 } 1031 1041 -
test/CMakeLists.txt
r904 r937 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 … … 28 32 heap_test 29 33 kruskal_test 34 lgf_test 30 35 maps_test 31 36 matching_test … … 62 67 TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS}) 63 68 ADD_TEST(lp_test lp_test) 69 ADD_DEPENDENCIES(check lp_test) 64 70 65 71 IF(WIN32 AND LEMON_HAVE_GLPK) … … 103 109 TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS}) 104 110 ADD_TEST(mip_test mip_test) 111 ADD_DEPENDENCIES(check mip_test) 105 112 106 113 IF(WIN32 AND LEMON_HAVE_GLPK) … … 130 137 ENDIF() 131 138 TARGET_LINK_LIBRARIES(${TEST_NAME} lemon) 132 ADD_TEST(${TEST_NAME} ${TEST_NAME}) 139 IF(TEST_WITH_VALGRIND) 140 ADD_TEST(${TEST_NAME} 141 valgrind --error-exitcode=1 ${VALGRIND_FLAGS} 142 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} ) 143 ELSE() 144 ADD_TEST(${TEST_NAME} ${TEST_NAME}) 145 ENDIF() 133 146 ADD_DEPENDENCIES(check ${TEST_NAME}) 134 147 ENDFOREACH() -
test/Makefile.am
r649 r937 26 26 test/heap_test \ 27 27 test/kruskal_test \ 28 test/lgf_test \ 28 29 test/maps_test \ 29 30 test/matching_test \ … … 71 72 test_kruskal_test_SOURCES = test/kruskal_test.cc 72 73 test_hao_orlin_test_SOURCES = test/hao_orlin_test.cc 74 test_lgf_test_SOURCES = test/lgf_test.cc 73 75 test_lp_test_SOURCES = test/lp_test.cc 74 76 test_maps_test_SOURCES = test/maps_test.cc -
test/dfs_test.cc
r585 r937 51 51 "@attributes\n" 52 52 "source 0\n" 53 "target 5\n"; 53 "target 5\n" 54 "source1 6\n" 55 "target1 3\n"; 56 54 57 55 58 void checkDfsCompile() … … 180 183 Digraph G; 181 184 Node s, t; 185 Node s1, t1; 182 186 183 187 std::istringstream input(test_lgf); … … 185 189 node("source", s). 186 190 node("target", t). 191 node("source1", s1). 192 node("target1", t1). 187 193 run(); 188 194 … … 211 217 212 218 { 219 Dfs<Digraph> dfs(G); 220 check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6."); 221 } 222 223 { 213 224 NullMap<Node,Arc> myPredMap; 214 225 dfs(G).predMap(myPredMap).run(s); -
test/graph_copy_test.cc
r440 r896 30 30 const int nn = 10; 31 31 32 // Build a digraph 32 33 SmartDigraph from; 33 34 SmartDigraph::NodeMap<int> fnm(from); … … 52 53 } 53 54 55 // Test digraph copy 54 56 ListDigraph to; 55 57 ListDigraph::NodeMap<int> tnm(to); … … 69 71 nodeCrossRef(ncr).arcCrossRef(ecr). 70 72 node(fn, tn).arc(fa, ta).run(); 73 74 check(countNodes(from) == countNodes(to), "Wrong copy."); 75 check(countArcs(from) == countArcs(to), "Wrong copy."); 71 76 72 77 for (SmartDigraph::NodeIt it(from); it != INVALID; ++it) { … … 91 96 check(tn == nr[fn], "Wrong copy."); 92 97 check(ta == er[fa], "Wrong copy."); 98 99 // Test repeated copy 100 digraphCopy(from, to).run(); 101 102 check(countNodes(from) == countNodes(to), "Wrong copy."); 103 check(countArcs(from) == countArcs(to), "Wrong copy."); 93 104 } 94 105 … … 96 107 const int nn = 10; 97 108 109 // Build a graph 98 110 SmartGraph from; 99 111 SmartGraph::NodeMap<int> fnm(from); … … 123 135 } 124 136 137 // Test graph copy 125 138 ListGraph to; 126 139 ListGraph::NodeMap<int> tnm(to); … … 144 157 nodeCrossRef(ncr).arcCrossRef(acr).edgeCrossRef(ecr). 145 158 node(fn, tn).arc(fa, ta).edge(fe, te).run(); 159 160 check(countNodes(from) == countNodes(to), "Wrong copy."); 161 check(countEdges(from) == countEdges(to), "Wrong copy."); 162 check(countArcs(from) == countArcs(to), "Wrong copy."); 146 163 147 164 for (SmartGraph::NodeIt it(from); it != INVALID; ++it) { … … 181 198 check(ta == ar[fa], "Wrong copy."); 182 199 check(te == er[fe], "Wrong copy."); 200 201 // Test repeated copy 202 graphCopy(from, to).run(); 203 204 check(countNodes(from) == countNodes(to), "Wrong copy."); 205 check(countEdges(from) == countEdges(to), "Wrong copy."); 206 check(countArcs(from) == countArcs(to), "Wrong copy."); 183 207 } 184 208 -
test/heap_test.cc
r440 r681 32 32 33 33 #include <lemon/bin_heap.h> 34 #include <lemon/fib_heap.h> 35 #include <lemon/radix_heap.h> 36 #include <lemon/bucket_heap.h> 34 37 35 38 #include "test_tools.h" … … 184 187 } 185 188 189 { 190 typedef FibHeap<Prio, ItemIntMap> IntHeap; 191 checkConcept<Heap<Prio, ItemIntMap>, IntHeap>(); 192 heapSortTest<IntHeap>(); 193 heapIncreaseTest<IntHeap>(); 194 195 typedef FibHeap<Prio, IntNodeMap > NodeHeap; 196 checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>(); 197 dijkstraHeapTest<NodeHeap>(digraph, length, source); 198 } 199 200 { 201 typedef RadixHeap<ItemIntMap> IntHeap; 202 checkConcept<Heap<Prio, ItemIntMap>, IntHeap>(); 203 heapSortTest<IntHeap>(); 204 heapIncreaseTest<IntHeap>(); 205 206 typedef RadixHeap<IntNodeMap > NodeHeap; 207 checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>(); 208 dijkstraHeapTest<NodeHeap>(digraph, length, source); 209 } 210 211 { 212 typedef BucketHeap<ItemIntMap> IntHeap; 213 checkConcept<Heap<Prio, ItemIntMap>, IntHeap>(); 214 heapSortTest<IntHeap>(); 215 heapIncreaseTest<IntHeap>(); 216 217 typedef BucketHeap<IntNodeMap > NodeHeap; 218 checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>(); 219 dijkstraHeapTest<NodeHeap>(digraph, length, source); 220 } 221 222 186 223 return 0; 187 224 } -
test/lp_test.cc
r631 r932 167 167 c = ((2 >= p1) >= 3); 168 168 169 { //Tests for #430 170 LP::Col v=lp.addCol(); 171 LP::Constr c = v >= -3; 172 c = c <= 4; 173 LP::Constr c2; 174 c2 = -3 <= v <= 4; 175 } 176 169 177 e[x[3]]=2; 170 178 e[x[3]]=4;
Note: See TracChangeset
for help on using the changeset viewer.