Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt (revision 1346)
+++ CMakeLists.txt (revision 1264)
@@ -1,16 +1,3 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-
-IF(POLICY CMP0048)
- CMAKE_POLICY(SET CMP0048 OLD)
-ENDIF(POLICY CMP0048)
-
-IF(POLICY CMP0043)
- CMAKE_POLICY(SET CMP0043 OLD)
-ENDIF(POLICY CMP0043)
-
-IF(POLICY CMP0026)
- #This is for copying the dll's needed by glpk (in lp_test and mip_test)
- CMAKE_POLICY(SET CMP0026 OLD)
-ENDIF(POLICY CMP0026)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(PROJECT_NAME "LEMON")
@@ -75,8 +62,4 @@
FIND_PACKAGE(Doxygen)
FIND_PACKAGE(Ghostscript)
-
-IF(WIN32)
- SET(LEMON_WIN32 TRUE)
-ENDIF(WIN32)
SET(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.")
@@ -139,7 +122,4 @@
SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
"Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)" FORCE)
-ELSE()
- SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
- "Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)")
ENDIF()
IF(NOT LEMON_DEFAULT_MIP OR
@@ -149,7 +129,4 @@
SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
"Default MIP solver backend (GLPK, CPLEX or CBC)" FORCE)
-ELSE()
- SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
- "Default MIP solver backend (GLPK, CPLEX or CBC)")
ENDIF()
@@ -164,11 +141,8 @@
ELSEIF(MSVC)
# This part is unnecessary 'casue the same is set by the lemon/core.h.
- # Still kept as an example.
-
- # SET(CXX_WARNING "/wd4250 /wd4267 /wd4355 /wd4503 /wd4800 /wd4996")
-
+ # Still keep it as an example.
+ SET(CXX_WARNING "/wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
# Suppressed warnings:
# C4250: 'class1' : inherits 'class2::member' via dominance
- # C4267: conversion from 'size_t' to 'type', possible loss of data
# C4355: 'this' : used in base member initializer list
# C4503: 'function' : decorated name length exceeded, name was truncated
@@ -185,5 +159,4 @@
IF(MSVC)
- SET(CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}")
SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
"Flags used by the C++ compiler during maintainer builds."
@@ -208,9 +181,9 @@
)
SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
- "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
+ "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
"Flags used for linking binaries during maintainer builds."
)
SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
- "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
+ "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
"Flags used by the shared libraries linker during maintainer builds."
)
@@ -239,8 +212,4 @@
FORCE )
-SET_DIRECTORY_PROPERTIES(PROPERTIES
- COMPILE_DEFINITIONS_DEBUG "LEMON_ENABLE_DEBUG"
- COMPILE_DEFINITIONS_MAINTAINER "LEMON_ENABLE_DEBUG"
-)
INCLUDE(CheckTypeSize)
@@ -271,12 +240,4 @@
ENABLE_TESTING()
-
-
-INCLUDE(CheckCXXCompilerFlag)
-CHECK_CXX_COMPILER_FLAG("-std=c++11" LEMON_CXX11)
-IF(LEMON_CXX11)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-ENDIF()
-
IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
Index: NEWS
===================================================================
--- NEWS (revision 1281)
+++ NEWS (revision 962)
@@ -1,100 +1,2 @@
-2013-08-10 Version 1.3 released
-
- This is major feature release
-
- * New data structures
-
- #69 : Bipartite graph concepts and implementations
-
- * New algorithms
-
- #177: Port Edmonds-Karp algorithm
- #380, #405: Heuristic algorithm for the max clique problem
- #386: Heuristic algorithms for symmetric TSP
- ----: Nagamochi-Ibaraki algorithm [5087694945e4]
- #397, #56: Max. cardinality search
-
- * Other new features
-
- #223: Thread safe graph and graph map implementations
- #442: Different TimeStamp print formats
- #457: File export functionality to LpBase
- #362: Bidirectional iterator support for radixSort()
-
- * Implementation improvements
-
- ----: Network Simplex
- #391: Better update process, pivot rule and arc mixing
- #435: Improved Altering List pivot rule
- #417: Various fine tunings in CostScaling
- #438: Optional iteration limit in HowardMmc
- #436: Ensure strongly polynomial running time for CycleCanceling
- while keeping the same performance
- ----: Make the CBC interface be compatible with latest CBC releases
- [ee581a0ecfbf]
-
- * CMAKE has become the default build environment (#434)
-
- ----: Autotool support has been dropped
- ----: Improved LP/MIP configuration
- #465: Enable/disable options for LP/MIP backends
- #446: Better CPLEX discovery
- #460: Add cmake config to find SoPlex
- ----: Allow CPACK configuration on all platforms
- #390: Add 'Maintainer' CMAKE build type
- #388: Add 'check' target.
- #401: Add contrib dir
- #389: Better version string setting in CMAKE
- #433: Support shared library build
- #416: Support testing with valgrind
-
- * Doc improvements
-
- #395: SOURCE_BROWSER Doxygen switch is configurable from CMAKE
- update-external-tags CMAKE target
- #455: Optionally use MathJax for rendering the math formulae
- #402, #437, #459, #456, #463: Various doc improvements
-
- * Bugfixes (compared to release 1.2):
-
- #432: Add missing doc/template.h and doc/references.bib to release
- tarball
- ----: Intel C++ compatibility fixes
- #441: Fix buggy reinitialization in _solver_bits::VarIndex::clear()
- #444: Bugfix in path copy constructors and assignment operators
- #447: Bugfix in AllArcLookUp<>
- #448: Bugfix in adaptor_test.cc
- #449: Fix clang compilation warnings and errors
- #440: Fix a bug + remove redundant typedefs in dimacs-solver
- #453: Avoid GCC 4.7 compiler warnings
- #445: Fix missing initialization in CplexEnv::CplexEnv()
- #428: Add missing lemon/lemon.pc.cmake to the release tarball
- #393: Create and install lemon.pc
- #429: Fix VS warnings
- #430: Fix LpBase::Constr two-side limit bug
- #392: Bug fix in Dfs::start(s,t)
- #414: Fix wrong initialization in Preflow
- #418: Better Win CodeBlock/MinGW support
- #419: Build environment improvements
- - Build of mip_test and lp_test precede the running of the tests
- - Also search for coin libs under ${COIN_ROOT_DIR}/lib/coin
- - Do not look for COIN_VOL libraries
- #382: Allow lgf file without Arc maps
- #417: Bug fix in CostScaling
- #366: Fix Pred[Matrix]MapPath::empty()
- #371: Bug fix in (di)graphCopy()
- The target graph is cleared before adding nodes and arcs/edges.
- #364: Add missing UndirectedTags
- #368: Fix the usage of std::numeric_limits<>::min() in Network Simplex
- #372: Fix a critical bug in preflow
- #461: Bugfix in assert.h
- #470: Fix compilation issues related to various gcc versions
- #446: Fix #define indicating CPLEX availability
- #294: Add explicit namespace to
- ignore_unused_variable_warning() usages
- #420: Bugfix in IterableValueMap
- #439: Bugfix in biNodeConnected()
-
-
2010-03-19 Version 1.2 released
Index: cmake/FindILOG.cmake
===================================================================
--- cmake/FindILOG.cmake (revision 1331)
+++ cmake/FindILOG.cmake (revision 1232)
@@ -63,6 +63,4 @@
${ILOG_CPLEX_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic
${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic
- ${ILOG_CPLEX_ROOT_DIR}/lib/x86_linux/static_pic
- ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_linux/static_pic
${ILOG_CPLEX_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
NO_DEFAULT_PATH
@@ -75,6 +73,4 @@
${ILOG_CONCERT_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic
${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic
- ${ILOG_CONCERT_ROOT_DIR}/lib/x86_linux/static_pic
- ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_linux/static_pic
${ILOG_CONCERT_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
NO_DEFAULT_PATH
Index: doc/Doxyfile.in
===================================================================
--- doc/Doxyfile.in (revision 1354)
+++ doc/Doxyfile.in (revision 1251)
@@ -20,5 +20,5 @@
STRIP_FROM_PATH = "@abs_top_srcdir@"
STRIP_FROM_INC_PATH = "@abs_top_srcdir@"
-SHORT_NAMES = NO
+SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
@@ -40,4 +40,5 @@
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
+SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
@@ -72,4 +73,5 @@
MAX_INITIALIZER_LINES = 5
SHOW_USED_FILES = NO
+SHOW_DIRECTORIES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
@@ -149,4 +151,5 @@
HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = YES
+HTML_ALIGN_MEMBERS = YES
HTML_DYNAMIC_SECTIONS = YES
GENERATE_DOCSET = NO
@@ -175,4 +178,5 @@
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
+USE_INLINE_TREES = NO
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
@@ -221,4 +225,6 @@
GENERATE_XML = NO
XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
@@ -261,5 +267,5 @@
HAVE_DOT = YES
DOT_NUM_THREADS = 0
-DOT_FONTNAME =
+DOT_FONTNAME = FreeSans
DOT_FONTSIZE = 10
DOT_FONTPATH =
Index: doc/groups.dox
===================================================================
--- doc/groups.dox (revision 1366)
+++ doc/groups.dox (revision 1270)
@@ -423,6 +423,5 @@
However, other algorithms could be faster in special cases.
For example, if the total supply and/or capacities are rather small,
-\ref CapacityScaling is usually the fastest algorithm
-(without effective scaling).
+\ref CapacityScaling is usually the fastest algorithm (without effective scaling).
These classes are intended to be used with integer-valued input data
@@ -562,33 +561,4 @@
/**
-@defgroup graph_isomorphism Graph Isomorphism
-@ingroup algs
-\brief Algorithms for testing (sub)graph isomorphism
-
-This group contains algorithms for finding isomorph copies of a
-given graph in another one, or simply check whether two graphs are isomorphic.
-
-The formal definition of subgraph isomorphism is as follows.
-
-We are given two graphs, \f$G_1=(V_1,E_1)\f$ and \f$G_2=(V_2,E_2)\f$. A
-function \f$f:V_1\longrightarrow V_2\f$ is called \e mapping or \e
-embedding if \f$f(u)\neq f(v)\f$ whenever \f$u\neq v\f$.
-
-The standard Subgraph Isomorphism Problem (SIP) looks for a
-mapping with the property that whenever \f$(u,v)\in E_1\f$, then
-\f$(f(u),f(v))\in E_2\f$.
-
-In case of Induced Subgraph Isomorphism Problem (ISIP) one
-also requires that if \f$(u,v)\not\in E_1\f$, then \f$(f(u),f(v))\not\in
-E_2\f$
-
-In addition, the graph nodes may be \e labeled, i.e. we are given two
-node labelings \f$l_1:V_1\longrightarrow L\f$ and \f$l_2:V_2\longrightarrow
-L\f$ and we require that \f$l_1(u)=l_2(f(u))\f$ holds for all nodes \f$u \in
-G_1\f$.
-
-*/
-
-/**
@defgroup planar Planar Embedding and Drawing
@ingroup algs
Index: doc/named-param.dox
===================================================================
--- doc/named-param.dox (revision 1351)
+++ doc/named-param.dox (revision 463)
@@ -26,5 +26,5 @@
function parameters by name also when you call the function. It is
especially comfortable in case of a function having tons of parameters
-with natural default values. Sadly, C++ lacks this amenity.
+with natural default values. Sadly, C++ lack this amenity.
However, with a crafty trick and with some little
Index: doc/references.bib
===================================================================
--- doc/references.bib (revision 1367)
+++ doc/references.bib (revision 1219)
@@ -355,15 +355,2 @@
pages = {587--612}
}
-
-@article{cordella2004sub,
- author = {Cordella, Luigi P. and Foggia, Pasquale and Sansone,
- Carlo and Vento, Mario},
- title = {A (sub)graph isomorphism algorithm for matching
- large graphs},
- journal = {IEEE Transactions on Pattern Analysis and Machine
- Intelligence},
- volume = 26,
- number = 10,
- pages = {1367--1372},
- year = 2004
-}
Index: lemon/CMakeLists.txt
===================================================================
--- lemon/CMakeLists.txt (revision 1315)
+++ lemon/CMakeLists.txt (revision 1264)
@@ -56,11 +56,6 @@
ADD_LIBRARY(lemon ${LEMON_SOURCES})
-
-TARGET_LINK_LIBRARIES(lemon
- ${GLPK_LIBRARIES} ${COIN_LIBRARIES} ${ILOG_LIBRARIES} ${SOPLEX_LIBRARIES}
- )
-
IF(UNIX)
- SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon VERSION ${LEMON_VERSION} SOVERSION ${LEMON_VERSION})
+ SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon)
ENDIF()
Index: lemon/arg_parser.h
===================================================================
--- lemon/arg_parser.h (revision 1327)
+++ lemon/arg_parser.h (revision 959)
@@ -27,5 +27,4 @@
#include
#include
-#include
#include
Index: lemon/bellman_ford.h
===================================================================
--- lemon/bellman_ford.h (revision 1337)
+++ lemon/bellman_ford.h (revision 1270)
@@ -30,5 +30,4 @@
#include
#include
-#include
#include
@@ -691,19 +690,4 @@
int _index;
};
-
- /// \brief Gets the collection of the active nodes.
- ///
- /// This function can be used for iterating on the active nodes of the
- /// Bellman-Ford algorithm after the last phase.
- /// These nodes should be checked in the next phase to
- /// find augmenting arcs outgoing from them.
- /// It returns a wrapped ActiveIt, which looks
- /// like an STL container (by having begin() and end())
- /// which you can use in range-based for loops, STL algorithms, etc.
- LemonRangeWrapper1
- activeNodes() const {
- return LemonRangeWrapper1(*this);
- }
-
/// \name Query Functions
Index: lemon/bits/edge_set_extender.h
===================================================================
--- lemon/bits/edge_set_extender.h (revision 1337)
+++ lemon/bits/edge_set_extender.h (revision 1270)
@@ -114,7 +114,4 @@
};
- LemonRangeWrapper1 nodes() const {
- return LemonRangeWrapper1(*this);
- }
class ArcIt : public Arc {
@@ -140,7 +137,4 @@
};
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
class OutArcIt : public Arc {
@@ -167,7 +161,4 @@
};
- LemonRangeWrapper2 outArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
class InArcIt : public Arc {
@@ -193,8 +184,4 @@
};
-
- LemonRangeWrapper2 inArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
// \brief Base node of the iterator
@@ -386,7 +373,4 @@
};
- LemonRangeWrapper1 nodes() const {
- return LemonRangeWrapper1(*this);
- }
class ArcIt : public Arc {
@@ -412,7 +396,4 @@
};
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
class OutArcIt : public Arc {
@@ -439,7 +420,4 @@
};
- LemonRangeWrapper2 outArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
class InArcIt : public Arc {
@@ -466,7 +444,4 @@
};
- LemonRangeWrapper2 inArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
class EdgeIt : public Parent::Edge {
@@ -491,8 +466,4 @@
};
-
- LemonRangeWrapper1 edges() const {
- return LemonRangeWrapper1(*this);
- }
class IncEdgeIt : public Parent::Edge {
@@ -520,8 +491,4 @@
}
};
-
- LemonRangeWrapper2 incEdges(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
// \brief Base node of the iterator
Index: lemon/bits/graph_adaptor_extender.h
===================================================================
--- lemon/bits/graph_adaptor_extender.h (revision 1337)
+++ lemon/bits/graph_adaptor_extender.h (revision 1270)
@@ -86,7 +86,4 @@
};
- LemonRangeWrapper1 nodes() const {
- return LemonRangeWrapper1(*this);
- }
class ArcIt : public Arc {
@@ -111,8 +108,4 @@
};
-
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
@@ -140,8 +133,4 @@
};
- LemonRangeWrapper2 outArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
class InArcIt : public Arc {
@@ -167,8 +156,4 @@
};
-
- LemonRangeWrapper2 inArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
Node baseNode(const OutArcIt &e) const {
@@ -270,8 +255,4 @@
};
- LemonRangeWrapper1 nodes() const {
- return LemonRangeWrapper1(*this);
- }
-
class ArcIt : public Arc {
@@ -296,8 +277,4 @@
};
-
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
@@ -325,8 +302,4 @@
};
- LemonRangeWrapper2 outArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
class InArcIt : public Arc {
@@ -353,8 +326,4 @@
};
- LemonRangeWrapper2 inArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
class EdgeIt : public Parent::Edge {
const Adaptor* _adaptor;
@@ -378,9 +347,4 @@
};
-
- LemonRangeWrapper1 edges() const {
- return LemonRangeWrapper1(*this);
- }
-
class IncEdgeIt : public Edge {
@@ -409,9 +373,4 @@
};
- LemonRangeWrapper2 incEdges(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
-
Node baseNode(const OutArcIt &a) const {
return Parent::source(a);
Index: lemon/bits/graph_extender.h
===================================================================
--- lemon/bits/graph_extender.h (revision 1336)
+++ lemon/bits/graph_extender.h (revision 1270)
@@ -28,6 +28,4 @@
#include
-#include
-
//\ingroup graphbits
//\file
@@ -119,8 +117,4 @@
};
- LemonRangeWrapper1 nodes() const {
- return LemonRangeWrapper1(*this);
- }
-
class ArcIt : public Arc {
@@ -145,8 +139,4 @@
};
-
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
@@ -174,8 +164,4 @@
};
- LemonRangeWrapper2 outArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
class InArcIt : public Arc {
@@ -201,8 +187,4 @@
};
-
- LemonRangeWrapper2 inArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
// \brief Base node of the iterator
@@ -455,8 +437,4 @@
};
- LemonRangeWrapper1 nodes() const {
- return LemonRangeWrapper1(*this);
- }
-
class ArcIt : public Arc {
@@ -481,8 +459,4 @@
};
-
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
@@ -510,8 +484,4 @@
};
- LemonRangeWrapper2 outArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
class InArcIt : public Arc {
@@ -538,8 +508,4 @@
};
- LemonRangeWrapper2 inArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
class EdgeIt : public Parent::Edge {
@@ -564,9 +530,4 @@
};
-
- LemonRangeWrapper1 edges() const {
- return LemonRangeWrapper1(*this);
- }
-
class IncEdgeIt : public Parent::Edge {
@@ -594,9 +555,4 @@
}
};
-
- LemonRangeWrapper2 incEdges(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
// \brief Base node of the iterator
@@ -948,9 +904,4 @@
};
- LemonRangeWrapper1 nodes() const {
- return LemonRangeWrapper1(*this);
- }
-
-
class RedNodeIt : public RedNode {
const BpGraph* _graph;
@@ -975,9 +926,4 @@
};
- LemonRangeWrapper1 redNodes() const {
- return LemonRangeWrapper1(*this);
- }
-
-
class BlueNodeIt : public BlueNode {
const BpGraph* _graph;
@@ -1002,9 +948,4 @@
};
- LemonRangeWrapper1 blueNodes() const {
- return LemonRangeWrapper1(*this);
- }
-
-
class ArcIt : public Arc {
@@ -1029,8 +970,4 @@
};
-
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
@@ -1058,8 +995,4 @@
};
- LemonRangeWrapper2 outArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
class InArcIt : public Arc {
@@ -1086,8 +1019,4 @@
};
- LemonRangeWrapper2 inArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
class EdgeIt : public Parent::Edge {
@@ -1112,9 +1041,4 @@
};
-
- LemonRangeWrapper1 edges() const {
- return LemonRangeWrapper1(*this);
- }
-
class IncEdgeIt : public Parent::Edge {
@@ -1142,9 +1066,4 @@
}
};
-
- LemonRangeWrapper2 incEdges(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
// \brief Base node of the iterator
Index: lemon/bits/path_dump.h
===================================================================
--- lemon/bits/path_dump.h (revision 1338)
+++ lemon/bits/path_dump.h (revision 1270)
@@ -62,5 +62,5 @@
}
- operator typename Digraph::Arc() const {
+ operator const typename Digraph::Arc() const {
return path->predMap[current];
}
Index: mon/bits/stl_iterators.h
===================================================================
--- lemon/bits/stl_iterators.h (revision 1339)
+++ (revision )
@@ -1,99 +1,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- */
-
-#ifndef STL_ITERATORS_H_
-#define STL_ITERATORS_H_
-
-#include
-
-namespace lemon {
-
- /// \brief Template to make STL iterators from Lemon iterators.
- ///
- /// This template makes an STL iterator from a Lemon iterator
- /// by adding the missing features.
- /// It inherits from \c std::iterator to make \c iterator_concept work
- /// (so that STL algorithms work).
- /// \c T should be the lemon iterator to be decorated.
- template
- struct LemonItWrapper
- : public T, public std::iterator {
-
- LemonItWrapper(const T &x) : T(x) {}
-
- //Lemon iterators don't have operator*, (because they rather
- //inherit from their "value_type"),
- //so we add one that just returns the object.
- const T& operator*() const {
- return static_cast(*this);
- }
-
- //I can't think of any use case for this with Lemon iterators,
- //but maybe it should be included for completeness.
- const T* operator->() {
- return static_cast(this);
- }
-
- //Lemon iterators don't have postincrement.
- void operator++(int) {
- T::operator++();
- }
-
- using T::operator++;
-
- };
-
-
- /// \brief A generic wrapper for Lemon iterators for range-based for loops.
- ///
- /// This template can be used to create a class
- /// that has begin() and end() from a Lemon iterator
- /// (with a 1-parameter constructor)
- /// to make range-based for loops and STL algorithms work.
- ///
- /// \c LIT is the Lemon iterator that will be wrapped
- /// \c P is the type of the parameter of the constructor of \c LIT.
- template
- class LemonRangeWrapper1 {
- typedef LemonItWrapper It;
- It _begin;
-
- public:
- LemonRangeWrapper1(const P &p) : _begin(LIT(p)) {}
- It begin() const {
- return _begin;
- }
- It end() const {
- return It(lemon::INVALID);
- }
- };
-
-
- /// \brief A generic wrapper for Lemon iterators for range-based for loops.
- ///
- /// This template can be used to create a class
- /// that has begin() and end() from a Lemon iterator
- /// (with a 2-parameter constructor)
- /// to make range-based for loops and STL algorithms work.
- ///
- /// \c LIT is the Lemon iterator that will be wrapped
- /// \c P1 and \c P2 are the types of the parameters
- /// of the constructor of \c LIT.
- template
- class LemonRangeWrapper2 {
- typedef LemonItWrapper It;
- It _begin;
- public:
- LemonRangeWrapper2(const P1 &p1, const P2 &p2) : _begin(LIT(p1, p2)) {}
- It begin() const {
- return _begin;
- }
- It end() const {
- return It(lemon::INVALID);
- }
- };
-
-
-}
-
-#endif /* STL_ITERATORS_H_ */
Index: lemon/bits/windows.cc
===================================================================
--- lemon/bits/windows.cc (revision 1341)
+++ lemon/bits/windows.cc (revision 1270)
@@ -22,9 +22,5 @@
#include
-#if defined(LEMON_WIN32) && defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wold-style-cast"
-#endif
-
-#ifdef LEMON_WIN32
+#ifdef WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
@@ -45,5 +41,5 @@
#include
#include
-#ifndef LEMON_WIN32
+#ifndef WIN32
#include
#endif
@@ -60,5 +56,5 @@
double &cutime, double &cstime)
{
-#ifdef LEMON_WIN32
+#ifdef WIN32
static const double ch = 4294967296.0e-7;
static const double cl = 1.0e-7;
@@ -99,9 +95,9 @@
{
std::ostringstream os;
-#ifdef LEMON_WIN32
+#ifdef WIN32
SYSTEMTIME time;
GetSystemTime(&time);
char buf1[11], buf2[9], buf3[5];
- if (GetDateFormat(MY_LOCALE, 0, &time,
+ if (GetDateFormat(MY_LOCALE, 0, &time,
("ddd MMM dd"), buf1, 11) &&
GetTimeFormat(MY_LOCALE, 0, &time,
@@ -125,5 +121,5 @@
int getWinRndSeed()
{
-#ifdef LEMON_WIN32
+#ifdef WIN32
FILETIME time;
GetSystemTimeAsFileTime(&time);
@@ -137,5 +133,5 @@
WinLock::WinLock() {
-#ifdef LEMON_WIN32
+#ifdef WIN32
CRITICAL_SECTION *lock = new CRITICAL_SECTION;
InitializeCriticalSection(lock);
@@ -147,5 +143,5 @@
WinLock::~WinLock() {
-#ifdef LEMON_WIN32
+#ifdef WIN32
CRITICAL_SECTION *lock = static_cast(_repr);
DeleteCriticalSection(lock);
@@ -155,5 +151,5 @@
void WinLock::lock() {
-#ifdef LEMON_WIN32
+#ifdef WIN32
CRITICAL_SECTION *lock = static_cast(_repr);
EnterCriticalSection(lock);
@@ -162,5 +158,5 @@
void WinLock::unlock() {
-#ifdef LEMON_WIN32
+#ifdef WIN32
CRITICAL_SECTION *lock = static_cast(_repr);
LeaveCriticalSection(lock);
Index: lemon/bits/windows.h
===================================================================
--- lemon/bits/windows.h (revision 1340)
+++ lemon/bits/windows.h (revision 1270)
@@ -20,5 +20,4 @@
#define LEMON_BITS_WINDOWS_H
-#include
#include
@@ -36,5 +35,5 @@
~WinLock();
void lock();
- void unlock();\
+ void unlock();
private:
void *_repr;
Index: lemon/capacity_scaling.h
===================================================================
--- lemon/capacity_scaling.h (revision 1363)
+++ lemon/capacity_scaling.h (revision 1270)
@@ -28,5 +28,4 @@
#include
#include
-#include
#include
@@ -165,5 +164,5 @@
// Parameters of the problem
- bool _has_lower;
+ bool _have_lower;
Value _sum_supply;
@@ -358,7 +357,8 @@
template
CapacityScaling& lowerMap(const LowerMap& map) {
- _has_lower = true;
+ _have_lower = true;
for (ArcIt a(_graph); a != INVALID; ++a) {
_lower[_arc_idf[a]] = map[a];
+ _lower[_arc_idb[a]] = map[a];
}
return *this;
@@ -544,5 +544,5 @@
_cost[j] = _forward[j] ? 1 : -1;
}
- _has_lower = false;
+ _have_lower = false;
return *this;
}
@@ -755,5 +755,5 @@
const Value MAX = std::numeric_limits::max();
int last_out;
- if (_has_lower) {
+ if (_have_lower) {
for (int i = 0; i != _root; ++i) {
last_out = _first_out[i+1];
@@ -840,9 +840,9 @@
}
- // Check if the upper bound is greater than or equal to the lower bound
- // on each forward arc.
+ // Check if the upper bound is greater or equal to the lower bound
+ // on each arc.
bool checkBoundMaps() {
for (int j = 0; j != _res_arc_num; ++j) {
- if (_forward[j] && _upper[j] < _lower[j]) return false;
+ if (_upper[j] < _lower[j]) return false;
}
return true;
@@ -858,8 +858,8 @@
// Handle non-zero lower bounds
- if (_has_lower) {
+ if (_have_lower) {
int limit = _first_out[_root];
for (int j = 0; j != limit; ++j) {
- if (_forward[j]) _res_cap[_reverse[j]] += _lower[j];
+ if (!_forward[j]) _res_cap[j] += _lower[j];
}
}
Index: lemon/cbc.cc
===================================================================
--- lemon/cbc.cc (revision 1336)
+++ lemon/cbc.cc (revision 1270)
@@ -112,9 +112,9 @@
void CbcMip::_eraseColId(int i) {
- _cols.eraseIndex(i);
+ cols.eraseIndex(i);
}
void CbcMip::_eraseRowId(int i) {
- _rows.eraseIndex(i);
+ rows.eraseIndex(i);
}
Index: lemon/clp.cc
===================================================================
--- lemon/clp.cc (revision 1336)
+++ lemon/clp.cc (revision 1270)
@@ -30,6 +30,6 @@
ClpLp::ClpLp(const ClpLp& other) {
_prob = new ClpSimplex(*other._prob);
- _rows = other._rows;
- _cols = other._cols;
+ rows = other.rows;
+ cols = other.cols;
_init_temporals();
messageLevel(MESSAGE_NOTHING);
@@ -104,11 +104,11 @@
void ClpLp::_eraseColId(int i) {
- _cols.eraseIndex(i);
- _cols.shiftIndices(i);
+ cols.eraseIndex(i);
+ cols.shiftIndices(i);
}
void ClpLp::_eraseRowId(int i) {
- _rows.eraseIndex(i);
- _rows.shiftIndices(i);
+ rows.eraseIndex(i);
+ rows.shiftIndices(i);
}
Index: lemon/clp.h
===================================================================
--- lemon/clp.h (revision 1336)
+++ lemon/clp.h (revision 1270)
@@ -152,8 +152,8 @@
///Returns the constraint identifier understood by CLP.
- int clpRow(Row r) const { return _rows(id(r)); }
+ int clpRow(Row r) const { return rows(id(r)); }
///Returns the variable identifier understood by CLP.
- int clpCol(Col c) const { return _cols(id(c)); }
+ int clpCol(Col c) const { return cols(id(c)); }
};
Index: lemon/concepts/bpgraph.h
===================================================================
--- lemon/concepts/bpgraph.h (revision 1336)
+++ lemon/concepts/bpgraph.h (revision 1270)
@@ -28,5 +28,4 @@
#include
#include
-#include
namespace lemon {
@@ -223,20 +222,4 @@
};
- /// \brief Gets the collection of the red nodes of the graph.
- ///
- /// This function can be used for iterating on
- /// the red nodes of the graph. It returns a wrapped RedNodeIt,
- /// which looks like an STL container (by having begin() and end())
- /// which you can use in range-based for loops, stl algorithms, etc.
- /// For example if g is a BpGraph, you can write:
- ///\code
- /// for(auto v: g.redNodes())
- /// doSomething(v);
- ///\endcode
- LemonRangeWrapper1 redNodes() const {
- return LemonRangeWrapper1(*this);
- }
-
-
/// Iterator class for the blue nodes.
@@ -282,20 +265,4 @@
};
- /// \brief Gets the collection of the blue nodes of the graph.
- ///
- /// This function can be used for iterating on
- /// the blue nodes of the graph. It returns a wrapped BlueNodeIt,
- /// which looks like an STL container (by having begin() and end())
- /// which you can use in range-based for loops, stl algorithms, etc.
- /// For example if g is a BpGraph, you can write:
- ///\code
- /// for(auto v: g.blueNodes())
- /// doSomething(v);
- ///\endcode
- LemonRangeWrapper1 blueNodes() const {
- return LemonRangeWrapper1(*this);
- }
-
-
/// Iterator class for the nodes.
@@ -341,20 +308,4 @@
};
- /// \brief Gets the collection of the nodes of the graph.
- ///
- /// This function can be used for iterating on
- /// the nodes of the graph. It returns a wrapped NodeIt,
- /// which looks like an STL container (by having begin() and end())
- /// which you can use in range-based for loops, stl algorithms, etc.
- /// For example if g is a BpGraph, you can write:
- ///\code
- /// for(auto v: g.nodes())
- /// doSomething(v);
- ///\endcode
- LemonRangeWrapper1 nodes() const {
- return LemonRangeWrapper1(*this);
- }
-
-
/// The edge type of the graph
@@ -445,21 +396,4 @@
};
- /// \brief Gets the collection of the edges of the graph.
- ///
- /// This function can be used for iterating on the
- /// edges of the graph. It returns a wrapped
- /// EdgeIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, stl algorithms, etc.
- /// For example if g is a BpGraph, you can write:
- ///\code
- /// for(auto e: g.edges())
- /// doSomething(e);
- ///\endcode
- LemonRangeWrapper1 edges() const {
- return LemonRangeWrapper1(*this);
- }
-
-
/// Iterator class for the incident edges of a node.
@@ -509,23 +443,4 @@
IncEdgeIt& operator++() { return *this; }
};
-
- /// \brief Gets the collection of the incident edges
- /// of a certain node of the graph.
- ///
- /// This function can be used for iterating on the
- /// incident undirected edges of a certain node of the graph.
- /// It returns a wrapped
- /// IncEdgeIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, stl algorithms, etc.
- /// For example if g is a BpGraph and u is a Node, you can write:
- ///\code
- /// for(auto e: g.incEdges(u))
- /// doSomething(e);
- ///\endcode
- LemonRangeWrapper2 incEdges(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
/// The arc type of the graph
@@ -624,21 +539,4 @@
ArcIt& operator++() { return *this; }
};
-
- /// \brief Gets the collection of the directed arcs of the graph.
- ///
- /// This function can be used for iterating on the
- /// arcs of the graph. It returns a wrapped
- /// ArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, stl algorithms, etc.
- /// For example if g is a BpGraph you can write:
- ///\code
- /// for(auto a: g.arcs())
- /// doSomething(a);
- ///\endcode
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
-
/// Iterator class for the outgoing arcs of a node.
@@ -690,22 +588,4 @@
};
- /// \brief Gets the collection of the outgoing directed arcs of a
- /// certain node of the graph.
- ///
- /// This function can be used for iterating on the
- /// outgoing arcs of a certain node of the graph. It returns a wrapped
- /// OutArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, stl algorithms, etc.
- /// For example if g is a BpGraph and u is a Node, you can write:
- ///\code
- /// for(auto a: g.outArcs(u))
- /// doSomething(a);
- ///\endcode
- LemonRangeWrapper2 outArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
-
/// Iterator class for the incoming arcs of a node.
@@ -756,22 +636,4 @@
};
- /// \brief Gets the collection of the incoming directed arcs of a
- /// certain node of the graph.
- ///
- /// This function can be used for iterating on the
- /// incoming arcs of a certain node of the graph. It returns a wrapped
- /// InArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, stl algorithms, etc.
- /// For example if g is a BpGraph and u is a Node, you can write:
- ///\code
- /// for(auto a: g.inArcs(u))
- /// doSomething(a);
- ///\endcode
- LemonRangeWrapper2 inArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
-
/// \brief Standard graph map type for the nodes.
///
Index: lemon/concepts/digraph.h
===================================================================
--- lemon/concepts/digraph.h (revision 1336)
+++ lemon/concepts/digraph.h (revision 1270)
@@ -28,5 +28,4 @@
#include
#include
-#include
namespace lemon {
@@ -149,23 +148,4 @@
};
- /// \brief Gets the collection of the nodes of the digraph.
- ///
- /// This function can be used for iterating on
- /// the nodes of the digraph. It returns a wrapped NodeIt, which looks
- /// like an STL container (by having begin() and end())
- /// which you can use in range-based for loops, STL algorithms, etc.
- /// For example you can write:
- ///\code
- /// ListDigraph g;
- /// for(auto v: g.nodes())
- /// doSomething(v);
- ///
- /// //Using an STL algorithm:
- /// copy(g.nodes().begin(), g.nodes().end(), vect.begin());
- ///\endcode
- LemonRangeWrapper1 nodes() const {
- return LemonRangeWrapper1(*this);
- }
-
/// The arc type of the digraph
@@ -258,25 +238,4 @@
};
- /// \brief Gets the collection of the outgoing arcs of a certain node
- /// of the digraph.
- ///
- /// This function can be used for iterating on the
- /// outgoing arcs of a certain node of the digraph. It returns a wrapped
- /// OutArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, STL algorithms, etc.
- /// For example if g is a Digraph and u is a node, you can write:
- ///\code
- /// for(auto a: g.outArcs(u))
- /// doSomething(a);
- ///
- /// //Using an STL algorithm:
- /// copy(g.outArcs(u).begin(), g.outArcs(u).end(), vect.begin());
- ///\endcode
- LemonRangeWrapper2 outArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
-
/// Iterator class for the incoming arcs of a node.
@@ -324,25 +283,4 @@
};
- /// \brief Gets the collection of the incoming arcs of a certain node
- /// of the digraph.
- ///
- /// This function can be used for iterating on the
- /// incoming arcs of a certain node of the digraph. It returns a wrapped
- /// InArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, STL algorithms, etc.
- /// For example if g is a Digraph and u is a node, you can write:
- ///\code
- /// for(auto a: g.inArcs(u))
- /// doSomething(a);
- ///
- /// //Using an STL algorithm:
- /// copy(g.inArcs(u).begin(), g.inArcs(u).end(), vect.begin());
- ///\endcode
- LemonRangeWrapper2 inArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
-
/// Iterator class for the arcs.
@@ -375,7 +313,5 @@
/// Sets the iterator to the first arc of the given digraph.
///
- explicit ArcIt(const Digraph& g) {
- ::lemon::ignore_unused_variable_warning(g);
- }
+ explicit ArcIt(const Digraph& g) { ::lemon::ignore_unused_variable_warning(g); }
/// Sets the iterator to the given arc.
@@ -389,25 +325,4 @@
ArcIt& operator++() { return *this; }
};
-
- /// \brief Gets the collection of the arcs of the digraph.
- ///
- /// This function can be used for iterating on the
- /// arcs of the digraph. It returns a wrapped
- /// ArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, STL algorithms, etc.
- /// For example you can write:
- ///\code
- /// ListDigraph g;
- /// for(auto a: g.arcs())
- /// doSomething(a);
- ///
- /// //Using an STL algorithm:
- /// copy(g.arcs().begin(), g.arcs().end(), vect.begin());
- ///\endcode
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
-
/// \brief The source node of the arc.
Index: lemon/concepts/graph.h
===================================================================
--- lemon/concepts/graph.h (revision 1336)
+++ lemon/concepts/graph.h (revision 1270)
@@ -28,5 +28,4 @@
#include
#include
-#include
namespace lemon {
@@ -182,23 +181,4 @@
};
- /// \brief Gets the collection of the nodes of the graph.
- ///
- /// This function can be used for iterating on
- /// the nodes of the graph. It returns a wrapped NodeIt, which looks
- /// like an STL container (by having begin() and end())
- /// which you can use in range-based for loops, STL algorithms, etc.
- /// For example you can write:
- ///\code
- /// ListGraph g;
- /// for(auto v: g.nodes())
- /// doSomething(v);
- ///
- /// //Using an STL algorithm:
- /// copy(g.nodes().begin(), g.nodes().end(), vect.begin());
- ///\endcode
- LemonRangeWrapper1 nodes() const {
- return LemonRangeWrapper1(*this);
- }
-
/// The edge type of the graph
@@ -289,25 +269,4 @@
};
- /// \brief Gets the collection of the edges of the graph.
- ///
- /// This function can be used for iterating on the
- /// edges of the graph. It returns a wrapped
- /// EdgeIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, STL algorithms, etc.
- /// For example you can write:
- ///\code
- /// ListGraph g;
- /// for(auto e: g.edges())
- /// doSomething(e);
- ///
- /// //Using an STL algorithm:
- /// copy(g.edges().begin(), g.edges().end(), vect.begin());
- ///\endcode
- LemonRangeWrapper1 edges() const {
- return LemonRangeWrapper1(*this);
- }
-
-
/// Iterator class for the incident edges of a node.
@@ -357,26 +316,4 @@
IncEdgeIt& operator++() { return *this; }
};
-
- /// \brief Gets the collection of the incident undirected edges
- /// of a certain node of the graph.
- ///
- /// This function can be used for iterating on the
- /// incident undirected edges of a certain node of the graph.
- /// It returns a wrapped
- /// IncEdgeIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, STL algorithms, etc.
- /// For example if g is a Graph and u is a Node, you can write:
- ///\code
- /// for(auto e: g.incEdges(u))
- /// doSomething(e);
- ///
- /// //Using an STL algorithm:
- /// copy(g.incEdges(u).begin(), g.incEdges(u).end(), vect.begin());
- ///\endcode
- LemonRangeWrapper2 incEdges(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
/// The arc type of the graph
@@ -460,7 +397,5 @@
/// Sets the iterator to the first arc of the given graph.
///
- explicit ArcIt(const Graph &g) {
- ::lemon::ignore_unused_variable_warning(g);
- }
+ explicit ArcIt(const Graph &g) { ::lemon::ignore_unused_variable_warning(g); }
/// Sets the iterator to the given arc.
@@ -474,25 +409,4 @@
ArcIt& operator++() { return *this; }
};
-
- /// \brief Gets the collection of the directed arcs of the graph.
- ///
- /// This function can be used for iterating on the
- /// arcs of the graph. It returns a wrapped
- /// ArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, STL algorithms, etc.
- /// For example you can write:
- ///\code
- /// ListGraph g;
- /// for(auto a: g.arcs())
- /// doSomething(a);
- ///
- /// //Using an STL algorithm:
- /// copy(g.arcs().begin(), g.arcs().end(), vect.begin());
- ///\endcode
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
-
/// Iterator class for the outgoing arcs of a node.
@@ -544,25 +458,4 @@
};
- /// \brief Gets the collection of the outgoing directed arcs of a
- /// certain node of the graph.
- ///
- /// This function can be used for iterating on the
- /// outgoing arcs of a certain node of the graph. It returns a wrapped
- /// OutArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, STL algorithms, etc.
- /// For example if g is a Graph and u is a Node, you can write:
- ///\code
- /// for(auto a: g.outArcs(u))
- /// doSomething(a);
- ///
- /// //Using an STL algorithm:
- /// copy(g.outArcs(u).begin(), g.outArcs(u).end(), vect.begin());
- ///\endcode
- LemonRangeWrapper2 outArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
-
/// Iterator class for the incoming arcs of a node.
@@ -613,24 +506,4 @@
};
- /// \brief Gets the collection of the incoming directed arcs of
- /// a certain node of the graph.
- ///
- /// This function can be used for iterating on the
- /// incoming directed arcs of a certain node of the graph. It returns
- /// a wrapped InArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, STL algorithms, etc.
- /// For example if g is a Graph and u is a Node, you can write:
- ///\code
- /// for(auto a: g.inArcs(u))
- /// doSomething(a);
- ///
- /// //Using an STL algorithm:
- /// copy(g.inArcs(u).begin(), g.inArcs(u).end(), vect.begin());
- ///\endcode
- LemonRangeWrapper2 inArcs(const Node& u) const {
- return LemonRangeWrapper2(*this, u);
- }
-
/// \brief Standard graph map type for the nodes.
///
Index: lemon/concepts/path.h
===================================================================
--- lemon/concepts/path.h (revision 1336)
+++ lemon/concepts/path.h (revision 1270)
@@ -27,5 +27,4 @@
#include
#include
-#include
namespace lemon {
@@ -117,21 +116,4 @@
};
- /// \brief Gets the collection of the arcs of the path.
- ///
- /// This function can be used for iterating on the
- /// arcs of the path. It returns a wrapped
- /// ArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, STL algorithms, etc.
- /// For example you can write:
- ///\code
- /// for(auto a: p.arcs())
- /// doSomething(a);
- ///\endcode
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
-
-
template
struct Constraints {
@@ -282,21 +264,4 @@
};
-
- /// \brief Gets the collection of the arcs of the path.
- ///
- /// This function can be used for iterating on the
- /// arcs of the path. It returns a wrapped
- /// ArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, STL algorithms, etc.
- /// For example you can write:
- ///\code
- /// for(auto a: p.arcs())
- /// doSomething(a);
- ///\endcode
- LemonRangeWrapper1 arcs() const {
- return LemonRangeWrapper1(*this);
- }
-
/// \brief LEMON style iterator for enumerating the arcs of a path
@@ -329,22 +294,4 @@
};
- /// \brief Gets the collection of the arcs of the path
- /// in reverse direction.
- ///
- /// This function can be used for iterating on the
- /// arcs of the path in reverse direction. It returns a wrapped
- /// RevArcIt, which looks like an STL container
- /// (by having begin() and end()) which you can use in range-based
- /// for loops, STL algorithms, etc.
- /// For example you can write:
- ///\code
- /// for(auto a: p.revArcs())
- /// doSomething(a);
- ///\endcode
- LemonRangeWrapper1 revArcs() const {
- return LemonRangeWrapper1(*this);
- }
-
-
template
struct Constraints {
Index: lemon/config.h.in
===================================================================
--- lemon/config.h.in (revision 1343)
+++ lemon/config.h.in (revision 1264)
@@ -1,12 +1,4 @@
-#ifndef LEMON_CONFIG_H
-#define LEMON_CONFIG_H
-
#define LEMON_VERSION "@PROJECT_VERSION@"
#cmakedefine LEMON_HAVE_LONG_LONG 1
-
-#cmakedefine LEMON_CXX11 1
-
-#cmakedefine LEMON_WIN32 1
-
#cmakedefine LEMON_HAVE_LP 1
#cmakedefine LEMON_HAVE_MIP 1
@@ -16,16 +8,6 @@
#cmakedefine LEMON_HAVE_CLP 1
#cmakedefine LEMON_HAVE_CBC 1
-
-#define LEMON_CPLEX_ 1
-#define LEMON_CLP_ 2
-#define LEMON_GLPK_ 3
-#define LEMON_SOPLEX_ 4
-#define LEMON_CBC_ 5
-
-#cmakedefine LEMON_DEFAULT_LP LEMON_@LEMON_DEFAULT_LP@_
-#cmakedefine LEMON_DEFAULT_MIP LEMON_@LEMON_DEFAULT_MIP@_
-
+#cmakedefine LEMON_DEFAULT_LP @LEMON_DEFAULT_LP@
+#cmakedefine LEMON_DEFAULT_MIP @LEMON_DEFAULT_MIP@
#cmakedefine LEMON_USE_PTHREAD 1
#cmakedefine LEMON_USE_WIN32_THREADS 1
-
-#endif
Index: lemon/core.h
===================================================================
--- lemon/core.h (revision 1341)
+++ lemon/core.h (revision 1270)
@@ -20,4 +20,33 @@
#define LEMON_CORE_H
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+// Disable the following warnings when compiling with MSVC:
+// C4250: 'class1' : inherits 'class2::member' via dominance
+// C4355: 'this' : used in base member initializer list
+// C4503: 'function' : decorated name length exceeded, name was truncated
+// C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
+// C4996: 'function': was declared deprecated
+#ifdef _MSC_VER
+#pragma warning( disable : 4250 4355 4503 4800 4996 )
+#endif
+
+#ifdef __GNUC__
+#define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+#endif
+
+#if GCC_VERSION >= 40800
+// Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc 4.8
+#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
+#endif
+
///\file
///\brief LEMON core utilities.
@@ -26,30 +55,4 @@
///It is automatically included by all graph types, therefore it usually
///do not have to be included directly.
-
-// Disable the following warnings when compiling with MSVC:
-// C4250: 'class1' : inherits 'class2::member' via dominance
-// C4267: conversion from 'size_t' to 'type', possible loss of data
-// C4355: 'this' : used in base member initializer list
-// C4503: 'function' : decorated name length exceeded, name was truncated
-// C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
-// C4996: 'function': was declared deprecated
-#ifdef _MSC_VER
-#pragma warning( disable : 4250 4267 4355 4503 4800 4996 )
-#endif
-
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
-// Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc 4.8
-#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
-#endif
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-
namespace lemon {
Index: lemon/cost_scaling.h
===================================================================
--- lemon/cost_scaling.h (revision 1298)
+++ lemon/cost_scaling.h (revision 1270)
@@ -92,6 +92,5 @@
/// \ref CostScaling implements a cost scaling algorithm that performs
/// push/augment and relabel operations for finding a \ref min_cost_flow
- /// "minimum cost flow" \cite amo93networkflows,
- /// \cite goldberg90approximation,
+ /// "minimum cost flow" \cite amo93networkflows, \cite goldberg90approximation,
/// \cite goldberg97efficient, \cite bunnagel98efficient.
/// It is a highly efficient primal-dual solution method, which
@@ -215,6 +214,5 @@
typedef std::vector LargeCostVector;
typedef std::vector BoolVector;
- // Note: vector is used instead of vector
- // for efficiency reasons
+ // Note: vector is used instead of vector for efficiency reasons
private:
@@ -257,5 +255,5 @@
// Parameters of the problem
- bool _has_lower;
+ bool _have_lower;
Value _sum_supply;
int _sup_node_num;
@@ -373,7 +371,8 @@
template
CostScaling& lowerMap(const LowerMap& map) {
- _has_lower = true;
+ _have_lower = true;
for (ArcIt a(_graph); a != INVALID; ++a) {
_lower[_arc_idf[a]] = map[a];
+ _lower[_arc_idb[a]] = map[a];
}
return *this;
@@ -568,5 +567,5 @@
_scost[_reverse[j]] = 0;
}
- _has_lower = false;
+ _have_lower = false;
return *this;
}
@@ -780,5 +779,5 @@
const Value MAX = std::numeric_limits::max();
int last_out;
- if (_has_lower) {
+ if (_have_lower) {
for (int i = 0; i != _root; ++i) {
last_out = _first_out[i+1];
@@ -837,5 +836,5 @@
sup[n] = _supply[_node_id[n]];
}
- if (_has_lower) {
+ if (_have_lower) {
for (ArcIt a(_graph); a != INVALID; ++a) {
int j = _arc_idf[a];
@@ -907,9 +906,9 @@
}
- // Check if the upper bound is greater than or equal to the lower bound
- // on each forward arc.
+ // Check if the upper bound is greater or equal to the lower bound
+ // on each arc.
bool checkBoundMaps() {
for (int j = 0; j != _res_arc_num; ++j) {
- if (_forward[j] && _upper[j] < _lower[j]) return false;
+ if (_upper[j] < _lower[j]) return false;
}
return true;
@@ -991,8 +990,8 @@
// Handle non-zero lower bounds
- if (_has_lower) {
+ if (_have_lower) {
int limit = _first_out[_root];
for (int j = 0; j != limit; ++j) {
- if (_forward[j]) _res_cap[_reverse[j]] += _lower[j];
+ if (!_forward[j]) _res_cap[j] += _lower[j];
}
}
Index: lemon/counter.h
===================================================================
--- lemon/counter.h (revision 1327)
+++ lemon/counter.h (revision 833)
@@ -22,6 +22,4 @@
#include
#include
-
-#include
///\ingroup timecount
Index: lemon/cplex.cc
===================================================================
--- lemon/cplex.cc (revision 1349)
+++ lemon/cplex.cc (revision 1270)
@@ -38,52 +38,35 @@
}
- void CplexEnv::incCnt()
- {
- _cnt_lock->lock();
+ CplexEnv::CplexEnv() {
+ int status;
+ _cnt = new int;
+ (*_cnt) = 1;
+ _env = CPXopenCPLEX(&status);
+ if (_env == 0) {
+ delete _cnt;
+ _cnt = 0;
+ throw LicenseError(status);
+ }
+ }
+
+ CplexEnv::CplexEnv(const CplexEnv& other) {
+ _env = other._env;
+ _cnt = other._cnt;
++(*_cnt);
- _cnt_lock->unlock();
- }
-
- void CplexEnv::decCnt()
- {
- _cnt_lock->lock();
+ }
+
+ CplexEnv& CplexEnv::operator=(const CplexEnv& other) {
+ _env = other._env;
+ _cnt = other._cnt;
+ ++(*_cnt);
+ return *this;
+ }
+
+ CplexEnv::~CplexEnv() {
--(*_cnt);
if (*_cnt == 0) {
delete _cnt;
- _cnt_lock->unlock();
- delete _cnt_lock;
CPXcloseCPLEX(&_env);
}
- else _cnt_lock->unlock();
- }
-
- CplexEnv::CplexEnv() {
- int status;
- _env = CPXopenCPLEX(&status);
- if (_env == 0)
- throw LicenseError(status);
- _cnt = new int;
- (*_cnt) = 1;
- _cnt_lock = new bits::Lock;
- }
-
- CplexEnv::CplexEnv(const CplexEnv& other) {
- _env = other._env;
- _cnt = other._cnt;
- _cnt_lock = other._cnt_lock;
- incCnt();
- }
-
- CplexEnv& CplexEnv::operator=(const CplexEnv& other) {
- decCnt();
- _env = other._env;
- _cnt = other._cnt;
- _cnt_lock = other._cnt_lock;
- incCnt();
- return *this;
- }
-
- CplexEnv::~CplexEnv() {
- decCnt();
}
@@ -105,6 +88,6 @@
int status;
_prob = CPXcloneprob(cplexEnv(), cplex._prob, &status);
- _rows = cplex._rows;
- _cols = cplex._cols;
+ rows = cplex.rows;
+ cols = cplex.cols;
messageLevel(MESSAGE_NOTHING);
}
@@ -133,8 +116,21 @@
ExprIterator e, Value ub) {
int i = CPXgetnumrows(cplexEnv(), _prob);
-
- int rmatbeg = 0;
-
+ if (lb == -INF) {
+ const char s = 'L';
+ CPXnewrows(cplexEnv(), _prob, 1, &ub, &s, 0, 0);
+ } else if (ub == INF) {
+ const char s = 'G';
+ CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, 0, 0);
+ } else if (lb == ub){
+ const char s = 'E';
+ CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, 0, 0);
+ } else {
+ const char s = 'R';
+ double len = ub - lb;
+ CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, &len, 0);
+ }
+
std::vector indices;
+ std::vector rowlist;
std::vector values;
@@ -142,26 +138,10 @@
indices.push_back(it->first);
values.push_back(it->second);
- }
-
- if (lb == -INF) {
- const char s = 'L';
- CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &ub, &s,
- &rmatbeg, &indices.front(), &values.front(), 0, 0);
- } else if (ub == INF) {
- const char s = 'G';
- CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &lb, &s,
- &rmatbeg, &indices.front(), &values.front(), 0, 0);
- } else if (lb == ub){
- const char s = 'E';
- CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &lb, &s,
- &rmatbeg, &indices.front(), &values.front(), 0, 0);
- } else {
- const char s = 'R';
- double len = ub - lb;
- CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &ub, &s,
- &rmatbeg, &indices.front(), &values.front(), 0, 0);
- CPXchgrngval(cplexEnv(), _prob, 1, &i, &len);
- }
-
+ rowlist.push_back(i);
+ }
+
+ CPXchgcoeflist(cplexEnv(), _prob, values.size(),
+ &rowlist.front(), &indices.front(), &values.front());
+
return i;
}
@@ -176,10 +156,10 @@
void CplexBase::_eraseColId(int i) {
- _cols.eraseIndex(i);
- _cols.shiftIndices(i);
+ cols.eraseIndex(i);
+ cols.shiftIndices(i);
}
void CplexBase::_eraseRowId(int i) {
- _rows.eraseIndex(i);
- _rows.shiftIndices(i);
+ rows.eraseIndex(i);
+ rows.shiftIndices(i);
}
Index: lemon/cplex.h
===================================================================
--- lemon/cplex.h (revision 1347)
+++ lemon/cplex.h (revision 1270)
@@ -24,5 +24,4 @@
#include
-#include
struct cpxenv;
@@ -42,9 +41,5 @@
cpxenv* _env;
mutable int* _cnt;
- mutable bits::Lock* _cnt_lock;
-
- void incCnt();
- void decCnt();
-
+
public:
Index: lemon/cycle_canceling.h
===================================================================
--- lemon/cycle_canceling.h (revision 1298)
+++ lemon/cycle_canceling.h (revision 1270)
@@ -196,5 +196,5 @@
// Parameters of the problem
- bool _has_lower;
+ bool _have_lower;
Value _sum_supply;
@@ -279,7 +279,8 @@
template
CycleCanceling& lowerMap(const LowerMap& map) {
- _has_lower = true;
+ _have_lower = true;
for (ArcIt a(_graph); a != INVALID; ++a) {
_lower[_arc_idf[a]] = map[a];
+ _lower[_arc_idb[a]] = map[a];
}
return *this;
@@ -471,5 +472,5 @@
_cost[_reverse[j]] = 0;
}
- _has_lower = false;
+ _have_lower = false;
return *this;
}
@@ -684,5 +685,5 @@
const Value MAX = std::numeric_limits::max();
int last_out;
- if (_has_lower) {
+ if (_have_lower) {
for (int i = 0; i != _root; ++i) {
last_out = _first_out[i+1];
@@ -727,5 +728,5 @@
sup[n] = _supply[_node_id[n]];
}
- if (_has_lower) {
+ if (_have_lower) {
for (ArcIt a(_graph); a != INVALID; ++a) {
int j = _arc_idf[a];
@@ -784,9 +785,9 @@
}
- // Check if the upper bound is greater than or equal to the lower bound
- // on each forward arc.
+ // Check if the upper bound is greater or equal to the lower bound
+ // on each arc.
bool checkBoundMaps() {
for (int j = 0; j != _res_arc_num; ++j) {
- if (_forward[j] && _upper[j] < _lower[j]) return false;
+ if (_upper[j] < _lower[j]) return false;
}
return true;
@@ -835,8 +836,8 @@
// Handle non-zero lower bounds
- if (_has_lower) {
+ if (_have_lower) {
int limit = _first_out[_root];
for (int j = 0; j != limit; ++j) {
- if (_forward[j]) _res_cap[_reverse[j]] += _lower[j];
+ if (!_forward[j]) _res_cap[j] += _lower[j];
}
}
Index: lemon/dim2.h
===================================================================
--- lemon/dim2.h (revision 1311)
+++ lemon/dim2.h (revision 761)
@@ -21,5 +21,4 @@
#include
-#include
///\ingroup geomdat
Index: lemon/elevator.h
===================================================================
--- lemon/elevator.h (revision 1328)
+++ lemon/elevator.h (revision 628)
@@ -168,5 +168,5 @@
int onLevel(int l) const
{
- return static_cast(_first[l+1]-_first[l]);
+ return _first[l+1]-_first[l];
}
///Return true if level \c l is empty.
@@ -178,10 +178,10 @@
int aboveLevel(int l) const
{
- return static_cast(_first[_max_level+1]-_first[l+1]);
+ return _first[_max_level+1]-_first[l+1];
}
///Return the number of active items on level \c l.
int activesOnLevel(int l) const
{
- return static_cast(_last_active[l]-_first[l]+1);
+ return _last_active[l]-_first[l]+1;
}
///Return true if there is no active item on level \c l.
Index: lemon/glpk.cc
===================================================================
--- lemon/glpk.cc (revision 1336)
+++ lemon/glpk.cc (revision 1270)
@@ -39,6 +39,6 @@
glp_copy_prob(lp, other.lp, GLP_ON);
glp_create_index(lp);
- _rows = other._rows;
- _cols = other._cols;
+ rows = other.rows;
+ cols = other.cols;
messageLevel(MESSAGE_NOTHING);
}
@@ -109,11 +109,11 @@
void GlpkBase::_eraseColId(int i) {
- _cols.eraseIndex(i);
- _cols.shiftIndices(i);
+ cols.eraseIndex(i);
+ cols.shiftIndices(i);
}
void GlpkBase::_eraseRowId(int i) {
- _rows.eraseIndex(i);
- _rows.shiftIndices(i);
+ rows.eraseIndex(i);
+ rows.shiftIndices(i);
}
Index: lemon/glpk.h
===================================================================
--- lemon/glpk.h (revision 1336)
+++ lemon/glpk.h (revision 1270)
@@ -142,8 +142,8 @@
///Returns the constraint identifier understood by GLPK.
- int lpxRow(Row r) const { return _rows(id(r)); }
+ int lpxRow(Row r) const { return rows(id(r)); }
///Returns the variable identifier understood by GLPK.
- int lpxCol(Col c) const { return _cols(id(c)); }
+ int lpxCol(Col c) const { return cols(id(c)); }
#ifdef DOXYGEN
Index: lemon/graph_to_eps.h
===================================================================
--- lemon/graph_to_eps.h (revision 1340)
+++ lemon/graph_to_eps.h (revision 1270)
@@ -26,5 +26,5 @@
#include
-#ifndef LEMON_WIN32
+#ifndef WIN32
#include
#include
@@ -223,4 +223,5 @@
using T::_copyright;
+ using T::NodeTextColorType;
using T::CUST_COL;
using T::DIST_COL;
@@ -675,5 +676,5 @@
{
os << "%%CreationDate: ";
-#ifndef LEMON_WIN32
+#ifndef WIN32
timeval tv;
gettimeofday(&tv, 0);
Index: lemon/howard_mmc.h
===================================================================
--- lemon/howard_mmc.h (revision 1271)
+++ lemon/howard_mmc.h (revision 1270)
@@ -362,6 +362,5 @@
/// \return The termination cause of the search process.
/// For more information, see \ref TerminationCause.
- TerminationCause findCycleMean(int limit =
- std::numeric_limits::max()) {
+ TerminationCause findCycleMean(int limit = std::numeric_limits::max()) {
// Initialize and find strongly connected components
init();
Index: lemon/lgf_reader.h
===================================================================
--- lemon/lgf_reader.h (revision 1361)
+++ lemon/lgf_reader.h (revision 1270)
@@ -1245,5 +1245,5 @@
///\code
///ListDigraph digraph;
- ///ListDigraph::ArcMap cap(digraph);
+ ///ListDigraph::ArcMap cm(digraph);
///ListDigraph::Node src, trg;
///digraphReader(digraph, std::cin).
Index: lemon/list_graph.h
===================================================================
--- lemon/list_graph.h (revision 1359)
+++ lemon/list_graph.h (revision 1270)
@@ -49,5 +49,5 @@
};
- std::vector _nodes;
+ std::vector nodes;
int first_node;
@@ -55,5 +55,5 @@
int first_free_node;
- std::vector _arcs;
+ std::vector arcs;
int first_free_arc;
@@ -98,13 +98,13 @@
ListDigraphBase()
- : _nodes(), first_node(-1),
- first_free_node(-1), _arcs(), first_free_arc(-1) {}
-
-
- int maxNodeId() const { return _nodes.size()-1; }
- int maxArcId() const { return _arcs.size()-1; }
-
- Node source(Arc e) const { return Node(_arcs[e.id].source); }
- Node target(Arc e) const { return Node(_arcs[e.id].target); }
+ : nodes(), first_node(-1),
+ first_free_node(-1), arcs(), first_free_arc(-1) {}
+
+
+ int maxNodeId() const { return nodes.size()-1; }
+ int maxArcId() const { return arcs.size()-1; }
+
+ Node source(Arc e) const { return Node(arcs[e.id].source); }
+ Node target(Arc e) const { return Node(arcs[e.id].target); }
@@ -114,5 +114,5 @@
void next(Node& node) const {
- node.id = _nodes[node.id].next;
+ node.id = nodes[node.id].next;
}
@@ -121,33 +121,33 @@
int n;
for(n = first_node;
- n != -1 && _nodes[n].first_out == -1;
- n = _nodes[n].next) {}
- arc.id = (n == -1) ? -1 : _nodes[n].first_out;
+ n != -1 && nodes[n].first_out == -1;
+ n = nodes[n].next) {}
+ arc.id = (n == -1) ? -1 : nodes[n].first_out;
}
void next(Arc& arc) const {
- if (_arcs[arc.id].next_out != -1) {
- arc.id = _arcs[arc.id].next_out;
+ if (arcs[arc.id].next_out != -1) {
+ arc.id = arcs[arc.id].next_out;
} else {
int n;
- for(n = _nodes[_arcs[arc.id].source].next;
- n != -1 && _nodes[n].first_out == -1;
- n = _nodes[n].next) {}
- arc.id = (n == -1) ? -1 : _nodes[n].first_out;
+ for(n = nodes[arcs[arc.id].source].next;
+ n != -1 && nodes[n].first_out == -1;
+ n = nodes[n].next) {}
+ arc.id = (n == -1) ? -1 : nodes[n].first_out;
}
}
void firstOut(Arc &e, const Node& v) const {
- e.id = _nodes[v.id].first_out;
+ e.id = nodes[v.id].first_out;
}
void nextOut(Arc &e) const {
- e.id=_arcs[e.id].next_out;
+ e.id=arcs[e.id].next_out;
}
void firstIn(Arc &e, const Node& v) const {
- e.id = _nodes[v.id].first_in;
+ e.id = nodes[v.id].first_in;
}
void nextIn(Arc &e) const {
- e.id=_arcs[e.id].next_in;
+ e.id=arcs[e.id].next_in;
}
@@ -160,11 +160,11 @@
bool valid(Node n) const {
- return n.id >= 0 && n.id < static_cast(_nodes.size()) &&
- _nodes[n.id].prev != -2;
+ return n.id >= 0 && n.id < static_cast(nodes.size()) &&
+ nodes[n.id].prev != -2;
}
bool valid(Arc a) const {
- return a.id >= 0 && a.id < static_cast(_arcs.size()) &&
- _arcs[a.id].prev_in != -2;
+ return a.id >= 0 && a.id < static_cast(arcs.size()) &&
+ arcs[a.id].prev_in != -2;
}
@@ -173,17 +173,17 @@
if(first_free_node==-1) {
- n = _nodes.size();
- _nodes.push_back(NodeT());
+ n = nodes.size();
+ nodes.push_back(NodeT());
} else {
n = first_free_node;
- first_free_node = _nodes[n].next;
- }
-
- _nodes[n].next = first_node;
- if(first_node != -1) _nodes[first_node].prev = n;
+ first_free_node = nodes[n].next;
+ }
+
+ nodes[n].next = first_node;
+ if(first_node != -1) nodes[first_node].prev = n;
first_node = n;
- _nodes[n].prev = -1;
-
- _nodes[n].first_in = _nodes[n].first_out = -1;
+ nodes[n].prev = -1;
+
+ nodes[n].first_in = nodes[n].first_out = -1;
return Node(n);
@@ -194,27 +194,27 @@
if (first_free_arc == -1) {
- n = _arcs.size();
- _arcs.push_back(ArcT());
+ n = arcs.size();
+ arcs.push_back(ArcT());
} else {
n = first_free_arc;
- first_free_arc = _arcs[n].next_in;
- }
-
- _arcs[n].source = u.id;
- _arcs[n].target = v.id;
-
- _arcs[n].next_out = _nodes[u.id].first_out;
- if(_nodes[u.id].first_out != -1) {
- _arcs[_nodes[u.id].first_out].prev_out = n;
- }
-
- _arcs[n].next_in = _nodes[v.id].first_in;
- if(_nodes[v.id].first_in != -1) {
- _arcs[_nodes[v.id].first_in].prev_in = n;
- }
-
- _arcs[n].prev_in = _arcs[n].prev_out = -1;
-
- _nodes[u.id].first_out = _nodes[v.id].first_in = n;
+ first_free_arc = arcs[n].next_in;
+ }
+
+ arcs[n].source = u.id;
+ arcs[n].target = v.id;
+
+ arcs[n].next_out = nodes[u.id].first_out;
+ if(nodes[u.id].first_out != -1) {
+ arcs[nodes[u.id].first_out].prev_out = n;
+ }
+
+ arcs[n].next_in = nodes[v.id].first_in;
+ if(nodes[v.id].first_in != -1) {
+ arcs[nodes[v.id].first_in].prev_in = n;
+ }
+
+ arcs[n].prev_in = arcs[n].prev_out = -1;
+
+ nodes[u.id].first_out = nodes[v.id].first_in = n;
return Arc(n);
@@ -224,17 +224,17 @@
int n = node.id;
- if(_nodes[n].next != -1) {
- _nodes[_nodes[n].next].prev = _nodes[n].prev;
- }
-
- if(_nodes[n].prev != -1) {
- _nodes[_nodes[n].prev].next = _nodes[n].next;
- } else {
- first_node = _nodes[n].next;
- }
-
- _nodes[n].next = first_free_node;
+ if(nodes[n].next != -1) {
+ nodes[nodes[n].next].prev = nodes[n].prev;
+ }
+
+ if(nodes[n].prev != -1) {
+ nodes[nodes[n].prev].next = nodes[n].next;
+ } else {
+ first_node = nodes[n].next;
+ }
+
+ nodes[n].next = first_free_node;
first_free_node = n;
- _nodes[n].prev = -2;
+ nodes[n].prev = -2;
}
@@ -243,33 +243,33 @@
int n = arc.id;
- if(_arcs[n].next_in!=-1) {
- _arcs[_arcs[n].next_in].prev_in = _arcs[n].prev_in;
- }
-
- if(_arcs[n].prev_in!=-1) {
- _arcs[_arcs[n].prev_in].next_in = _arcs[n].next_in;
- } else {
- _nodes[_arcs[n].target].first_in = _arcs[n].next_in;
- }
-
-
- if(_arcs[n].next_out!=-1) {
- _arcs[_arcs[n].next_out].prev_out = _arcs[n].prev_out;
- }
-
- if(_arcs[n].prev_out!=-1) {
- _arcs[_arcs[n].prev_out].next_out = _arcs[n].next_out;
- } else {
- _nodes[_arcs[n].source].first_out = _arcs[n].next_out;
- }
-
- _arcs[n].next_in = first_free_arc;
+ if(arcs[n].next_in!=-1) {
+ arcs[arcs[n].next_in].prev_in = arcs[n].prev_in;
+ }
+
+ if(arcs[n].prev_in!=-1) {
+ arcs[arcs[n].prev_in].next_in = arcs[n].next_in;
+ } else {
+ nodes[arcs[n].target].first_in = arcs[n].next_in;
+ }
+
+
+ if(arcs[n].next_out!=-1) {
+ arcs[arcs[n].next_out].prev_out = arcs[n].prev_out;
+ }
+
+ if(arcs[n].prev_out!=-1) {
+ arcs[arcs[n].prev_out].next_out = arcs[n].next_out;
+ } else {
+ nodes[arcs[n].source].first_out = arcs[n].next_out;
+ }
+
+ arcs[n].next_in = first_free_arc;
first_free_arc = n;
- _arcs[n].prev_in = -2;
+ arcs[n].prev_in = -2;
}
void clear() {
- _arcs.clear();
- _nodes.clear();
+ arcs.clear();
+ nodes.clear();
first_node = first_free_node = first_free_arc = -1;
}
@@ -278,31 +278,31 @@
void changeTarget(Arc e, Node n)
{
- if(_arcs[e.id].next_in != -1)
- _arcs[_arcs[e.id].next_in].prev_in = _arcs[e.id].prev_in;
- if(_arcs[e.id].prev_in != -1)
- _arcs[_arcs[e.id].prev_in].next_in = _arcs[e.id].next_in;
- else _nodes[_arcs[e.id].target].first_in = _arcs[e.id].next_in;
- if (_nodes[n.id].first_in != -1) {
- _arcs[_nodes[n.id].first_in].prev_in = e.id;
- }
- _arcs[e.id].target = n.id;
- _arcs[e.id].prev_in = -1;
- _arcs[e.id].next_in = _nodes[n.id].first_in;
- _nodes[n.id].first_in = e.id;
+ if(arcs[e.id].next_in != -1)
+ arcs[arcs[e.id].next_in].prev_in = arcs[e.id].prev_in;
+ if(arcs[e.id].prev_in != -1)
+ arcs[arcs[e.id].prev_in].next_in = arcs[e.id].next_in;
+ else nodes[arcs[e.id].target].first_in = arcs[e.id].next_in;
+ if (nodes[n.id].first_in != -1) {
+ arcs[nodes[n.id].first_in].prev_in = e.id;
+ }
+ arcs[e.id].target = n.id;
+ arcs[e.id].prev_in = -1;
+ arcs[e.id].next_in = nodes[n.id].first_in;
+ nodes[n.id].first_in = e.id;
}
void changeSource(Arc e, Node n)
{
- if(_arcs[e.id].next_out != -1)
- _arcs[_arcs[e.id].next_out].prev_out = _arcs[e.id].prev_out;
- if(_arcs[e.id].prev_out != -1)
- _arcs[_arcs[e.id].prev_out].next_out = _arcs[e.id].next_out;
- else _nodes[_arcs[e.id].source].first_out = _arcs[e.id].next_out;
- if (_nodes[n.id].first_out != -1) {
- _arcs[_nodes[n.id].first_out].prev_out = e.id;
- }
- _arcs[e.id].source = n.id;
- _arcs[e.id].prev_out = -1;
- _arcs[e.id].next_out = _nodes[n.id].first_out;
- _nodes[n.id].first_out = e.id;
+ if(arcs[e.id].next_out != -1)
+ arcs[arcs[e.id].next_out].prev_out = arcs[e.id].prev_out;
+ if(arcs[e.id].prev_out != -1)
+ arcs[arcs[e.id].prev_out].next_out = arcs[e.id].next_out;
+ else nodes[arcs[e.id].source].first_out = arcs[e.id].next_out;
+ if (nodes[n.id].first_out != -1) {
+ arcs[nodes[n.id].first_out].prev_out = e.id;
+ }
+ arcs[e.id].source = n.id;
+ arcs[e.id].prev_out = -1;
+ arcs[e.id].next_out = nodes[n.id].first_out;
+ nodes[n.id].first_out = e.id;
}
@@ -487,8 +487,8 @@
Node split(Node n, bool connect = true) {
Node b = addNode();
- _nodes[b.id].first_out=_nodes[n.id].first_out;
- _nodes[n.id].first_out=-1;
- for(int i=_nodes[b.id].first_out; i!=-1; i=_arcs[i].next_out) {
- _arcs[i].source=b.id;
+ nodes[b.id].first_out=nodes[n.id].first_out;
+ nodes[n.id].first_out=-1;
+ for(int i=nodes[b.id].first_out; i!=-1; i=arcs[i].next_out) {
+ arcs[i].source=b.id;
}
if (connect) addArc(n,b);
@@ -533,5 +533,5 @@
/// to build the digraph.
/// \sa reserveArc()
- void reserveNode(int n) { _nodes.reserve(n); };
+ void reserveNode(int n) { nodes.reserve(n); };
/// Reserve memory for arcs.
@@ -543,5 +543,5 @@
/// to build the digraph.
/// \sa reserveNode()
- void reserveArc(int m) { _arcs.reserve(m); };
+ void reserveArc(int m) { arcs.reserve(m); };
/// \brief Class to make a snapshot of the digraph and restore
@@ -583,5 +583,5 @@
}
virtual void add(const std::vector& nodes) {
- for (int i = nodes.size() - 1; i >= 0; --i) {
+ for (int i = nodes.size() - 1; i >= 0; ++i) {
snapshot.addNode(nodes[i]);
}
@@ -633,5 +633,5 @@
}
virtual void add(const std::vector& arcs) {
- for (int i = arcs.size() - 1; i >= 0; --i) {
+ for (int i = arcs.size() - 1; i >= 0; ++i) {
snapshot.addArc(arcs[i]);
}
@@ -804,5 +804,5 @@
};
- std::vector _nodes;
+ std::vector nodes;
int first_node;
@@ -810,5 +810,5 @@
int first_free_node;
- std::vector _arcs;
+ std::vector arcs;
int first_free_arc;
@@ -868,17 +868,17 @@
ListGraphBase()
- : _nodes(), first_node(-1),
- first_free_node(-1), _arcs(), first_free_arc(-1) {}
-
-
- int maxNodeId() const { return _nodes.size()-1; }
- int maxEdgeId() const { return _arcs.size() / 2 - 1; }
- int maxArcId() const { return _arcs.size()-1; }
-
- Node source(Arc e) const { return Node(_arcs[e.id ^ 1].target); }
- Node target(Arc e) const { return Node(_arcs[e.id].target); }
-
- Node u(Edge e) const { return Node(_arcs[2 * e.id].target); }
- Node v(Edge e) const { return Node(_arcs[2 * e.id + 1].target); }
+ : nodes(), first_node(-1),
+ first_free_node(-1), arcs(), first_free_arc(-1) {}
+
+
+ int maxNodeId() const { return nodes.size()-1; }
+ int maxEdgeId() const { return arcs.size() / 2 - 1; }
+ int maxArcId() const { return arcs.size()-1; }
+
+ Node source(Arc e) const { return Node(arcs[e.id ^ 1].target); }
+ Node target(Arc e) const { return Node(arcs[e.id].target); }
+
+ Node u(Edge e) const { return Node(arcs[2 * e.id].target); }
+ Node v(Edge e) const { return Node(arcs[2 * e.id + 1].target); }
static bool direction(Arc e) {
@@ -895,24 +895,24 @@
void next(Node& node) const {
- node.id = _nodes[node.id].next;
+ node.id = nodes[node.id].next;
}
void first(Arc& e) const {
int n = first_node;
- while (n != -1 && _nodes[n].first_out == -1) {
- n = _nodes[n].next;
- }
- e.id = (n == -1) ? -1 : _nodes[n].first_out;
+ while (n != -1 && nodes[n].first_out == -1) {
+ n = nodes[n].next;
+ }
+ e.id = (n == -1) ? -1 : nodes[n].first_out;
}
void next(Arc& e) const {
- if (_arcs[e.id].next_out != -1) {
- e.id = _arcs[e.id].next_out;
- } else {
- int n = _nodes[_arcs[e.id ^ 1].target].next;
- while(n != -1 && _nodes[n].first_out == -1) {
- n = _nodes[n].next;
- }
- e.id = (n == -1) ? -1 : _nodes[n].first_out;
+ if (arcs[e.id].next_out != -1) {
+ e.id = arcs[e.id].next_out;
+ } else {
+ int n = nodes[arcs[e.id ^ 1].target].next;
+ while(n != -1 && nodes[n].first_out == -1) {
+ n = nodes[n].next;
+ }
+ e.id = (n == -1) ? -1 : nodes[n].first_out;
}
}
@@ -921,7 +921,7 @@
int n = first_node;
while (n != -1) {
- e.id = _nodes[n].first_out;
+ e.id = nodes[n].first_out;
while ((e.id & 1) != 1) {
- e.id = _arcs[e.id].next_out;
+ e.id = arcs[e.id].next_out;
}
if (e.id != -1) {
@@ -929,5 +929,5 @@
return;
}
- n = _nodes[n].next;
+ n = nodes[n].next;
}
e.id = -1;
@@ -935,8 +935,8 @@
void next(Edge& e) const {
- int n = _arcs[e.id * 2].target;
- e.id = _arcs[(e.id * 2) | 1].next_out;
+ int n = arcs[e.id * 2].target;
+ e.id = arcs[(e.id * 2) | 1].next_out;
while ((e.id & 1) != 1) {
- e.id = _arcs[e.id].next_out;
+ e.id = arcs[e.id].next_out;
}
if (e.id != -1) {
@@ -944,9 +944,9 @@
return;
}
- n = _nodes[n].next;
+ n = nodes[n].next;
while (n != -1) {
- e.id = _nodes[n].first_out;
+ e.id = nodes[n].first_out;
while ((e.id & 1) != 1) {
- e.id = _arcs[e.id].next_out;
+ e.id = arcs[e.id].next_out;
}
if (e.id != -1) {
@@ -954,5 +954,5 @@
return;
}
- n = _nodes[n].next;
+ n = nodes[n].next;
}
e.id = -1;
@@ -960,21 +960,21 @@
void firstOut(Arc &e, const Node& v) const {
- e.id = _nodes[v.id].first_out;
+ e.id = nodes[v.id].first_out;
}
void nextOut(Arc &e) const {
- e.id = _arcs[e.id].next_out;
+ e.id = arcs[e.id].next_out;
}
void firstIn(Arc &e, const Node& v) const {
- e.id = ((_nodes[v.id].first_out) ^ 1);
+ e.id = ((nodes[v.id].first_out) ^ 1);
if (e.id == -2) e.id = -1;
}
void nextIn(Arc &e) const {
- e.id = ((_arcs[e.id ^ 1].next_out) ^ 1);
+ e.id = ((arcs[e.id ^ 1].next_out) ^ 1);
if (e.id == -2) e.id = -1;
}
void firstInc(Edge &e, bool& d, const Node& v) const {
- int a = _nodes[v.id].first_out;
+ int a = nodes[v.id].first_out;
if (a != -1 ) {
e.id = a / 2;
@@ -986,5 +986,5 @@
}
void nextInc(Edge &e, bool& d) const {
- int a = (_arcs[(e.id * 2) | (d ? 1 : 0)].next_out);
+ int a = (arcs[(e.id * 2) | (d ? 1 : 0)].next_out);
if (a != -1 ) {
e.id = a / 2;
@@ -1005,16 +1005,16 @@
bool valid(Node n) const {
- return n.id >= 0 && n.id < static_cast(_nodes.size()) &&
- _nodes[n.id].prev != -2;
+ return n.id >= 0 && n.id < static_cast(nodes.size()) &&
+ nodes[n.id].prev != -2;
}
bool valid(Arc a) const {
- return a.id >= 0 && a.id < static_cast(_arcs.size()) &&
- _arcs[a.id].prev_out != -2;
+ return a.id >= 0 && a.id < static_cast(arcs.size()) &&
+ arcs[a.id].prev_out != -2;
}
bool valid(Edge e) const {
- return e.id >= 0 && 2 * e.id < static_cast(_arcs.size()) &&
- _arcs[2 * e.id].prev_out != -2;
+ return e.id >= 0 && 2 * e.id < static_cast(arcs.size()) &&
+ arcs[2 * e.id].prev_out != -2;
}
@@ -1023,17 +1023,17 @@
if(first_free_node==-1) {
- n = _nodes.size();
- _nodes.push_back(NodeT());
+ n = nodes.size();
+ nodes.push_back(NodeT());
} else {
n = first_free_node;
- first_free_node = _nodes[n].next;
- }
-
- _nodes[n].next = first_node;
- if (first_node != -1) _nodes[first_node].prev = n;
+ first_free_node = nodes[n].next;
+ }
+
+ nodes[n].next = first_node;
+ if (first_node != -1) nodes[first_node].prev = n;
first_node = n;
- _nodes[n].prev = -1;
-
- _nodes[n].first_out = -1;
+ nodes[n].prev = -1;
+
+ nodes[n].first_out = -1;
return Node(n);
@@ -1044,28 +1044,28 @@
if (first_free_arc == -1) {
- n = _arcs.size();
- _arcs.push_back(ArcT());
- _arcs.push_back(ArcT());
+ n = arcs.size();
+ arcs.push_back(ArcT());
+ arcs.push_back(ArcT());
} else {
n = first_free_arc;
- first_free_arc = _arcs[n].next_out;
- }
-
- _arcs[n].target = u.id;
- _arcs[n | 1].target = v.id;
-
- _arcs[n].next_out = _nodes[v.id].first_out;
- if (_nodes[v.id].first_out != -1) {
- _arcs[_nodes[v.id].first_out].prev_out = n;
- }
- _arcs[n].prev_out = -1;
- _nodes[v.id].first_out = n;
-
- _arcs[n | 1].next_out = _nodes[u.id].first_out;
- if (_nodes[u.id].first_out != -1) {
- _arcs[_nodes[u.id].first_out].prev_out = (n | 1);
- }
- _arcs[n | 1].prev_out = -1;
- _nodes[u.id].first_out = (n | 1);
+ first_free_arc = arcs[n].next_out;
+ }
+
+ arcs[n].target = u.id;
+ arcs[n | 1].target = v.id;
+
+ arcs[n].next_out = nodes[v.id].first_out;
+ if (nodes[v.id].first_out != -1) {
+ arcs[nodes[v.id].first_out].prev_out = n;
+ }
+ arcs[n].prev_out = -1;
+ nodes[v.id].first_out = n;
+
+ arcs[n | 1].next_out = nodes[u.id].first_out;
+ if (nodes[u.id].first_out != -1) {
+ arcs[nodes[u.id].first_out].prev_out = (n | 1);
+ }
+ arcs[n | 1].prev_out = -1;
+ nodes[u.id].first_out = (n | 1);
return Edge(n / 2);
@@ -1075,17 +1075,17 @@
int n = node.id;
- if(_nodes[n].next != -1) {
- _nodes[_nodes[n].next].prev = _nodes[n].prev;
- }
-
- if(_nodes[n].prev != -1) {
- _nodes[_nodes[n].prev].next = _nodes[n].next;
- } else {
- first_node = _nodes[n].next;
- }
-
- _nodes[n].next = first_free_node;
+ if(nodes[n].next != -1) {
+ nodes[nodes[n].next].prev = nodes[n].prev;
+ }
+
+ if(nodes[n].prev != -1) {
+ nodes[nodes[n].prev].next = nodes[n].next;
+ } else {
+ first_node = nodes[n].next;
+ }
+
+ nodes[n].next = first_free_node;
first_free_node = n;
- _nodes[n].prev = -2;
+ nodes[n].prev = -2;
}
@@ -1093,34 +1093,34 @@
int n = edge.id * 2;
- if (_arcs[n].next_out != -1) {
- _arcs[_arcs[n].next_out].prev_out = _arcs[n].prev_out;
- }
-
- if (_arcs[n].prev_out != -1) {
- _arcs[_arcs[n].prev_out].next_out = _arcs[n].next_out;
- } else {
- _nodes[_arcs[n | 1].target].first_out = _arcs[n].next_out;
- }
-
- if (_arcs[n | 1].next_out != -1) {
- _arcs[_arcs[n | 1].next_out].prev_out = _arcs[n | 1].prev_out;
- }
-
- if (_arcs[n | 1].prev_out != -1) {
- _arcs[_arcs[n | 1].prev_out].next_out = _arcs[n | 1].next_out;
- } else {
- _nodes[_arcs[n].target].first_out = _arcs[n | 1].next_out;
- }
-
- _arcs[n].next_out = first_free_arc;
+ if (arcs[n].next_out != -1) {
+ arcs[arcs[n].next_out].prev_out = arcs[n].prev_out;
+ }
+
+ if (arcs[n].prev_out != -1) {
+ arcs[arcs[n].prev_out].next_out = arcs[n].next_out;
+ } else {
+ nodes[arcs[n | 1].target].first_out = arcs[n].next_out;
+ }
+
+ if (arcs[n | 1].next_out != -1) {
+ arcs[arcs[n | 1].next_out].prev_out = arcs[n | 1].prev_out;
+ }
+
+ if (arcs[n | 1].prev_out != -1) {
+ arcs[arcs[n | 1].prev_out].next_out = arcs[n | 1].next_out;
+ } else {
+ nodes[arcs[n].target].first_out = arcs[n | 1].next_out;
+ }
+
+ arcs[n].next_out = first_free_arc;
first_free_arc = n;
- _arcs[n].prev_out = -2;
- _arcs[n | 1].prev_out = -2;
+ arcs[n].prev_out = -2;
+ arcs[n | 1].prev_out = -2;
}
void clear() {
- _arcs.clear();
- _nodes.clear();
+ arcs.clear();
+ nodes.clear();
first_node = first_free_node = first_free_arc = -1;
}
@@ -1129,44 +1129,44 @@
void changeV(Edge e, Node n) {
- if(_arcs[2 * e.id].next_out != -1) {
- _arcs[_arcs[2 * e.id].next_out].prev_out = _arcs[2 * e.id].prev_out;
- }
- if(_arcs[2 * e.id].prev_out != -1) {
- _arcs[_arcs[2 * e.id].prev_out].next_out =
- _arcs[2 * e.id].next_out;
- } else {
- _nodes[_arcs[(2 * e.id) | 1].target].first_out =
- _arcs[2 * e.id].next_out;
- }
-
- if (_nodes[n.id].first_out != -1) {
- _arcs[_nodes[n.id].first_out].prev_out = 2 * e.id;
- }
- _arcs[(2 * e.id) | 1].target = n.id;
- _arcs[2 * e.id].prev_out = -1;
- _arcs[2 * e.id].next_out = _nodes[n.id].first_out;
- _nodes[n.id].first_out = 2 * e.id;
+ if(arcs[2 * e.id].next_out != -1) {
+ arcs[arcs[2 * e.id].next_out].prev_out = arcs[2 * e.id].prev_out;
+ }
+ if(arcs[2 * e.id].prev_out != -1) {
+ arcs[arcs[2 * e.id].prev_out].next_out =
+ arcs[2 * e.id].next_out;
+ } else {
+ nodes[arcs[(2 * e.id) | 1].target].first_out =
+ arcs[2 * e.id].next_out;
+ }
+
+ if (nodes[n.id].first_out != -1) {
+ arcs[nodes[n.id].first_out].prev_out = 2 * e.id;
+ }
+ arcs[(2 * e.id) | 1].target = n.id;
+ arcs[2 * e.id].prev_out = -1;
+ arcs[2 * e.id].next_out = nodes[n.id].first_out;
+ nodes[n.id].first_out = 2 * e.id;
}
void changeU(Edge e, Node n) {
- if(_arcs[(2 * e.id) | 1].next_out != -1) {
- _arcs[_arcs[(2 * e.id) | 1].next_out].prev_out =
- _arcs[(2 * e.id) | 1].prev_out;
- }
- if(_arcs[(2 * e.id) | 1].prev_out != -1) {
- _arcs[_arcs[(2 * e.id) | 1].prev_out].next_out =
- _arcs[(2 * e.id) | 1].next_out;
- } else {
- _nodes[_arcs[2 * e.id].target].first_out =
- _arcs[(2 * e.id) | 1].next_out;
- }
-
- if (_nodes[n.id].first_out != -1) {
- _arcs[_nodes[n.id].first_out].prev_out = ((2 * e.id) | 1);
- }
- _arcs[2 * e.id].target = n.id;
- _arcs[(2 * e.id) | 1].prev_out = -1;
- _arcs[(2 * e.id) | 1].next_out = _nodes[n.id].first_out;
- _nodes[n.id].first_out = ((2 * e.id) | 1);
+ if(arcs[(2 * e.id) | 1].next_out != -1) {
+ arcs[arcs[(2 * e.id) | 1].next_out].prev_out =
+ arcs[(2 * e.id) | 1].prev_out;
+ }
+ if(arcs[(2 * e.id) | 1].prev_out != -1) {
+ arcs[arcs[(2 * e.id) | 1].prev_out].next_out =
+ arcs[(2 * e.id) | 1].next_out;
+ } else {
+ nodes[arcs[2 * e.id].target].first_out =
+ arcs[(2 * e.id) | 1].next_out;
+ }
+
+ if (nodes[n.id].first_out != -1) {
+ arcs[nodes[n.id].first_out].prev_out = ((2 * e.id) | 1);
+ }
+ arcs[2 * e.id].target = n.id;
+ arcs[(2 * e.id) | 1].prev_out = -1;
+ arcs[(2 * e.id) | 1].next_out = nodes[n.id].first_out;
+ nodes[n.id].first_out = ((2 * e.id) | 1);
}
@@ -1210,5 +1210,5 @@
ListGraph() {}
- typedef Parent::IncEdgeIt IncEdgeIt;
+ typedef Parent::OutArcIt IncEdgeIt;
/// \brief Add a new node to the graph.
@@ -1345,5 +1345,5 @@
/// to build the graph.
/// \sa reserveEdge()
- void reserveNode(int n) { _nodes.reserve(n); };
+ void reserveNode(int n) { nodes.reserve(n); };
/// Reserve memory for edges.
@@ -1355,5 +1355,5 @@
/// to build the graph.
/// \sa reserveNode()
- void reserveEdge(int m) { _arcs.reserve(2 * m); };
+ void reserveEdge(int m) { arcs.reserve(2 * m); };
/// \brief Class to make a snapshot of the graph and restore
@@ -1395,5 +1395,5 @@
}
virtual void add(const std::vector& nodes) {
- for (int i = nodes.size() - 1; i >= 0; --i) {
+ for (int i = nodes.size() - 1; i >= 0; ++i) {
snapshot.addNode(nodes[i]);
}
@@ -1445,5 +1445,5 @@
}
virtual void add(const std::vector& edges) {
- for (int i = edges.size() - 1; i >= 0; --i) {
+ for (int i = edges.size() - 1; i >= 0; ++i) {
snapshot.addEdge(edges[i]);
}
@@ -1618,5 +1618,5 @@
};
- std::vector _nodes;
+ std::vector nodes;
int first_node, first_red, first_blue;
@@ -1625,5 +1625,5 @@
int first_free_red, first_free_blue;
- std::vector _arcs;
+ std::vector arcs;
int first_free_arc;
@@ -1707,31 +1707,31 @@
ListBpGraphBase()
- : _nodes(), first_node(-1),
+ : nodes(), first_node(-1),
first_red(-1), first_blue(-1),
max_red(-1), max_blue(-1),
first_free_red(-1), first_free_blue(-1),
- _arcs(), first_free_arc(-1) {}
-
-
- bool red(Node n) const { return _nodes[n.id].red; }
- bool blue(Node n) const { return !_nodes[n.id].red; }
+ arcs(), first_free_arc(-1) {}
+
+
+ bool red(Node n) const { return nodes[n.id].red; }
+ bool blue(Node n) const { return !nodes[n.id].red; }
static RedNode asRedNodeUnsafe(Node n) { return RedNode(n.id); }
static BlueNode asBlueNodeUnsafe(Node n) { return BlueNode(n.id); }
- int maxNodeId() const { return _nodes.size()-1; }
+ int maxNodeId() const { return nodes.size()-1; }
int maxRedId() const { return max_red; }
int maxBlueId() const { return max_blue; }
- int maxEdgeId() const { return _arcs.size() / 2 - 1; }
- int maxArcId() const { return _arcs.size()-1; }
-
- Node source(Arc e) const { return Node(_arcs[e.id ^ 1].target); }
- Node target(Arc e) const { return Node(_arcs[e.id].target); }
+ int maxEdgeId() const { return arcs.size() / 2 - 1; }
+ int maxArcId() const { return arcs.size()-1; }
+
+ Node source(Arc e) const { return Node(arcs[e.id ^ 1].target); }
+ Node target(Arc e) const { return Node(arcs[e.id].target); }
RedNode redNode(Edge e) const {
- return RedNode(_arcs[2 * e.id].target);
+ return RedNode(arcs[2 * e.id].target);
}
BlueNode blueNode(Edge e) const {
- return BlueNode(_arcs[2 * e.id + 1].target);
+ return BlueNode(arcs[2 * e.id + 1].target);
}
@@ -1749,5 +1749,5 @@
void next(Node& node) const {
- node.id = _nodes[node.id].next;
+ node.id = nodes[node.id].next;
}
@@ -1757,5 +1757,5 @@
void next(RedNode& node) const {
- node.id = _nodes[node.id].partition_next;
+ node.id = nodes[node.id].partition_next;
}
@@ -1765,24 +1765,24 @@
void next(BlueNode& node) const {
- node.id = _nodes[node.id].partition_next;
+ node.id = nodes[node.id].partition_next;
}
void first(Arc& e) const {
int n = first_node;
- while (n != -1 && _nodes[n].first_out == -1) {
- n = _nodes[n].next;
- }
- e.id = (n == -1) ? -1 : _nodes[n].first_out;
+ while (n != -1 && nodes[n].first_out == -1) {
+ n = nodes[n].next;
+ }
+ e.id = (n == -1) ? -1 : nodes[n].first_out;
}
void next(Arc& e) const {
- if (_arcs[e.id].next_out != -1) {
- e.id = _arcs[e.id].next_out;
- } else {
- int n = _nodes[_arcs[e.id ^ 1].target].next;
- while(n != -1 && _nodes[n].first_out == -1) {
- n = _nodes[n].next;
- }
- e.id = (n == -1) ? -1 : _nodes[n].first_out;
+ if (arcs[e.id].next_out != -1) {
+ e.id = arcs[e.id].next_out;
+ } else {
+ int n = nodes[arcs[e.id ^ 1].target].next;
+ while(n != -1 && nodes[n].first_out == -1) {
+ n = nodes[n].next;
+ }
+ e.id = (n == -1) ? -1 : nodes[n].first_out;
}
}
@@ -1791,7 +1791,7 @@
int n = first_node;
while (n != -1) {
- e.id = _nodes[n].first_out;
+ e.id = nodes[n].first_out;
while ((e.id & 1) != 1) {
- e.id = _arcs[e.id].next_out;
+ e.id = arcs[e.id].next_out;
}
if (e.id != -1) {
@@ -1799,5 +1799,5 @@
return;
}
- n = _nodes[n].next;
+ n = nodes[n].next;
}
e.id = -1;
@@ -1805,8 +1805,8 @@
void next(Edge& e) const {
- int n = _arcs[e.id * 2].target;
- e.id = _arcs[(e.id * 2) | 1].next_out;
+ int n = arcs[e.id * 2].target;
+ e.id = arcs[(e.id * 2) | 1].next_out;
while ((e.id & 1) != 1) {
- e.id = _arcs[e.id].next_out;
+ e.id = arcs[e.id].next_out;
}
if (e.id != -1) {
@@ -1814,9 +1814,9 @@
return;
}
- n = _nodes[n].next;
+ n = nodes[n].next;
while (n != -1) {
- e.id = _nodes[n].first_out;
+ e.id = nodes[n].first_out;
while ((e.id & 1) != 1) {
- e.id = _arcs[e.id].next_out;
+ e.id = arcs[e.id].next_out;
}
if (e.id != -1) {
@@ -1824,5 +1824,5 @@
return;
}
- n = _nodes[n].next;
+ n = nodes[n].next;
}
e.id = -1;
@@ -1830,21 +1830,21 @@
void firstOut(Arc &e, const Node& v) const {
- e.id = _nodes[v.id].first_out;
+ e.id = nodes[v.id].first_out;
}
void nextOut(Arc &e) const {
- e.id = _arcs[e.id].next_out;
+ e.id = arcs[e.id].next_out;
}
void firstIn(Arc &e, const Node& v) const {
- e.id = ((_nodes[v.id].first_out) ^ 1);
+ e.id = ((nodes[v.id].first_out) ^ 1);
if (e.id == -2) e.id = -1;
}
void nextIn(Arc &e) const {
- e.id = ((_arcs[e.id ^ 1].next_out) ^ 1);
+ e.id = ((arcs[e.id ^ 1].next_out) ^ 1);
if (e.id == -2) e.id = -1;
}
void firstInc(Edge &e, bool& d, const Node& v) const {
- int a = _nodes[v.id].first_out;
+ int a = nodes[v.id].first_out;
if (a != -1 ) {
e.id = a / 2;
@@ -1856,5 +1856,5 @@
}
void nextInc(Edge &e, bool& d) const {
- int a = (_arcs[(e.id * 2) | (d ? 1 : 0)].next_out);
+ int a = (arcs[(e.id * 2) | (d ? 1 : 0)].next_out);
if (a != -1 ) {
e.id = a / 2;
@@ -1867,6 +1867,6 @@
static int id(Node v) { return v.id; }
- int id(RedNode v) const { return _nodes[v.id].partition_index; }
- int id(BlueNode v) const { return _nodes[v.id].partition_index; }
+ int id(RedNode v) const { return nodes[v.id].partition_index; }
+ int id(BlueNode v) const { return nodes[v.id].partition_index; }
static int id(Arc e) { return e.id; }
static int id(Edge e) { return e.id; }
@@ -1877,16 +1877,16 @@
bool valid(Node n) const {
- return n.id >= 0 && n.id < static_cast(_nodes.size()) &&
- _nodes[n.id].prev != -2;
+ return n.id >= 0 && n.id < static_cast(nodes.size()) &&
+ nodes[n.id].prev != -2;
}
bool valid(Arc a) const {
- return a.id >= 0 && a.id < static_cast(_arcs.size()) &&
- _arcs[a.id].prev_out != -2;
+ return a.id >= 0 && a.id < static_cast(arcs.size()) &&
+ arcs[a.id].prev_out != -2;
}
bool valid(Edge e) const {
- return e.id >= 0 && 2 * e.id < static_cast(_arcs.size()) &&
- _arcs[2 * e.id].prev_out != -2;
+ return e.id >= 0 && 2 * e.id < static_cast(arcs.size()) &&
+ arcs[2 * e.id].prev_out != -2;
}
@@ -1895,24 +1895,24 @@
if(first_free_red==-1) {
- n = _nodes.size();
- _nodes.push_back(NodeT());
- _nodes[n].partition_index = ++max_red;
- _nodes[n].red = true;
+ n = nodes.size();
+ nodes.push_back(NodeT());
+ nodes[n].partition_index = ++max_red;
+ nodes[n].red = true;
} else {
n = first_free_red;
- first_free_red = _nodes[n].next;
- }
-
- _nodes[n].next = first_node;
- if (first_node != -1) _nodes[first_node].prev = n;
+ first_free_red = nodes[n].next;
+ }
+
+ nodes[n].next = first_node;
+ if (first_node != -1) nodes[first_node].prev = n;
first_node = n;
- _nodes[n].prev = -1;
-
- _nodes[n].partition_next = first_red;
- if (first_red != -1) _nodes[first_red].partition_prev = n;
+ nodes[n].prev = -1;
+
+ nodes[n].partition_next = first_red;
+ if (first_red != -1) nodes[first_red].partition_prev = n;
first_red = n;
- _nodes[n].partition_prev = -1;
-
- _nodes[n].first_out = -1;
+ nodes[n].partition_prev = -1;
+
+ nodes[n].first_out = -1;
return RedNode(n);
@@ -1923,24 +1923,24 @@
if(first_free_blue==-1) {
- n = _nodes.size();
- _nodes.push_back(NodeT());
- _nodes[n].partition_index = ++max_blue;
- _nodes[n].red = false;
+ n = nodes.size();
+ nodes.push_back(NodeT());
+ nodes[n].partition_index = ++max_blue;
+ nodes[n].red = false;
} else {
n = first_free_blue;
- first_free_blue = _nodes[n].next;
- }
-
- _nodes[n].next = first_node;
- if (first_node != -1) _nodes[first_node].prev = n;
+ first_free_blue = nodes[n].next;
+ }
+
+ nodes[n].next = first_node;
+ if (first_node != -1) nodes[first_node].prev = n;
first_node = n;
- _nodes[n].prev = -1;
-
- _nodes[n].partition_next = first_blue;
- if (first_blue != -1) _nodes[first_blue].partition_prev = n;
+ nodes[n].prev = -1;
+
+ nodes[n].partition_next = first_blue;
+ if (first_blue != -1) nodes[first_blue].partition_prev = n;
first_blue = n;
- _nodes[n].partition_prev = -1;
-
- _nodes[n].first_out = -1;
+ nodes[n].partition_prev = -1;
+
+ nodes[n].first_out = -1;
return BlueNode(n);
@@ -1951,28 +1951,28 @@
if (first_free_arc == -1) {
- n = _arcs.size();
- _arcs.push_back(ArcT());
- _arcs.push_back(ArcT());
+ n = arcs.size();
+ arcs.push_back(ArcT());
+ arcs.push_back(ArcT());
} else {
n = first_free_arc;
- first_free_arc = _arcs[n].next_out;
- }
-
- _arcs[n].target = u.id;
- _arcs[n | 1].target = v.id;
-
- _arcs[n].next_out = _nodes[v.id].first_out;
- if (_nodes[v.id].first_out != -1) {
- _arcs[_nodes[v.id].first_out].prev_out = n;
- }
- _arcs[n].prev_out = -1;
- _nodes[v.id].first_out = n;
-
- _arcs[n | 1].next_out = _nodes[u.id].first_out;
- if (_nodes[u.id].first_out != -1) {
- _arcs[_nodes[u.id].first_out].prev_out = (n | 1);
- }
- _arcs[n | 1].prev_out = -1;
- _nodes[u.id].first_out = (n | 1);
+ first_free_arc = arcs[n].next_out;
+ }
+
+ arcs[n].target = u.id;
+ arcs[n | 1].target = v.id;
+
+ arcs[n].next_out = nodes[v.id].first_out;
+ if (nodes[v.id].first_out != -1) {
+ arcs[nodes[v.id].first_out].prev_out = n;
+ }
+ arcs[n].prev_out = -1;
+ nodes[v.id].first_out = n;
+
+ arcs[n | 1].next_out = nodes[u.id].first_out;
+ if (nodes[u.id].first_out != -1) {
+ arcs[nodes[u.id].first_out].prev_out = (n | 1);
+ }
+ arcs[n | 1].prev_out = -1;
+ nodes[u.id].first_out = (n | 1);
return Edge(n / 2);
@@ -1982,36 +1982,36 @@
int n = node.id;
- if(_nodes[n].next != -1) {
- _nodes[_nodes[n].next].prev = _nodes[n].prev;
- }
-
- if(_nodes[n].prev != -1) {
- _nodes[_nodes[n].prev].next = _nodes[n].next;
- } else {
- first_node = _nodes[n].next;
- }
-
- if (_nodes[n].partition_next != -1) {
- _nodes[_nodes[n].partition_next].partition_prev = _nodes[n].partition_prev;
- }
-
- if (_nodes[n].partition_prev != -1) {
- _nodes[_nodes[n].partition_prev].partition_next = _nodes[n].partition_next;
- } else {
- if (_nodes[n].red) {
- first_red = _nodes[n].partition_next;
+ if(nodes[n].next != -1) {
+ nodes[nodes[n].next].prev = nodes[n].prev;
+ }
+
+ if(nodes[n].prev != -1) {
+ nodes[nodes[n].prev].next = nodes[n].next;
+ } else {
+ first_node = nodes[n].next;
+ }
+
+ if (nodes[n].partition_next != -1) {
+ nodes[nodes[n].partition_next].partition_prev = nodes[n].partition_prev;
+ }
+
+ if (nodes[n].partition_prev != -1) {
+ nodes[nodes[n].partition_prev].partition_next = nodes[n].partition_next;
+ } else {
+ if (nodes[n].red) {
+ first_red = nodes[n].partition_next;
} else {
- first_blue = _nodes[n].partition_next;
- }
- }
-
- if (_nodes[n].red) {
- _nodes[n].next = first_free_red;
+ first_blue = nodes[n].partition_next;
+ }
+ }
+
+ if (nodes[n].red) {
+ nodes[n].next = first_free_red;
first_free_red = n;
} else {
- _nodes[n].next = first_free_blue;
+ nodes[n].next = first_free_blue;
first_free_blue = n;
}
- _nodes[n].prev = -2;
+ nodes[n].prev = -2;
}
@@ -2019,34 +2019,34 @@
int n = edge.id * 2;
- if (_arcs[n].next_out != -1) {
- _arcs[_arcs[n].next_out].prev_out = _arcs[n].prev_out;
- }
-
- if (_arcs[n].prev_out != -1) {
- _arcs[_arcs[n].prev_out].next_out = _arcs[n].next_out;
- } else {
- _nodes[_arcs[n | 1].target].first_out = _arcs[n].next_out;
- }
-
- if (_arcs[n | 1].next_out != -1) {
- _arcs[_arcs[n | 1].next_out].prev_out = _arcs[n | 1].prev_out;
- }
-
- if (_arcs[n | 1].prev_out != -1) {
- _arcs[_arcs[n | 1].prev_out].next_out = _arcs[n | 1].next_out;
- } else {
- _nodes[_arcs[n].target].first_out = _arcs[n | 1].next_out;
- }
-
- _arcs[n].next_out = first_free_arc;
+ if (arcs[n].next_out != -1) {
+ arcs[arcs[n].next_out].prev_out = arcs[n].prev_out;
+ }
+
+ if (arcs[n].prev_out != -1) {
+ arcs[arcs[n].prev_out].next_out = arcs[n].next_out;
+ } else {
+ nodes[arcs[n | 1].target].first_out = arcs[n].next_out;
+ }
+
+ if (arcs[n | 1].next_out != -1) {
+ arcs[arcs[n | 1].next_out].prev_out = arcs[n | 1].prev_out;
+ }
+
+ if (arcs[n | 1].prev_out != -1) {
+ arcs[arcs[n | 1].prev_out].next_out = arcs[n | 1].next_out;
+ } else {
+ nodes[arcs[n].target].first_out = arcs[n | 1].next_out;
+ }
+
+ arcs[n].next_out = first_free_arc;
first_free_arc = n;
- _arcs[n].prev_out = -2;
- _arcs[n | 1].prev_out = -2;
+ arcs[n].prev_out = -2;
+ arcs[n | 1].prev_out = -2;
}
void clear() {
- _arcs.clear();
- _nodes.clear();
+ arcs.clear();
+ nodes.clear();
first_node = first_free_arc = first_red = first_blue =
max_red = max_blue = first_free_red = first_free_blue = -1;
@@ -2056,44 +2056,44 @@
void changeRed(Edge e, RedNode n) {
- if(_arcs[(2 * e.id) | 1].next_out != -1) {
- _arcs[_arcs[(2 * e.id) | 1].next_out].prev_out =
- _arcs[(2 * e.id) | 1].prev_out;
- }
- if(_arcs[(2 * e.id) | 1].prev_out != -1) {
- _arcs[_arcs[(2 * e.id) | 1].prev_out].next_out =
- _arcs[(2 * e.id) | 1].next_out;
- } else {
- _nodes[_arcs[2 * e.id].target].first_out =
- _arcs[(2 * e.id) | 1].next_out;
- }
-
- if (_nodes[n.id].first_out != -1) {
- _arcs[_nodes[n.id].first_out].prev_out = ((2 * e.id) | 1);
- }
- _arcs[2 * e.id].target = n.id;
- _arcs[(2 * e.id) | 1].prev_out = -1;
- _arcs[(2 * e.id) | 1].next_out = _nodes[n.id].first_out;
- _nodes[n.id].first_out = ((2 * e.id) | 1);
+ if(arcs[(2 * e.id) | 1].next_out != -1) {
+ arcs[arcs[(2 * e.id) | 1].next_out].prev_out =
+ arcs[(2 * e.id) | 1].prev_out;
+ }
+ if(arcs[(2 * e.id) | 1].prev_out != -1) {
+ arcs[arcs[(2 * e.id) | 1].prev_out].next_out =
+ arcs[(2 * e.id) | 1].next_out;
+ } else {
+ nodes[arcs[2 * e.id].target].first_out =
+ arcs[(2 * e.id) | 1].next_out;
+ }
+
+ if (nodes[n.id].first_out != -1) {
+ arcs[nodes[n.id].first_out].prev_out = ((2 * e.id) | 1);
+ }
+ arcs[2 * e.id].target = n.id;
+ arcs[(2 * e.id) | 1].prev_out = -1;
+ arcs[(2 * e.id) | 1].next_out = nodes[n.id].first_out;
+ nodes[n.id].first_out = ((2 * e.id) | 1);
}
void changeBlue(Edge e, BlueNode n) {
- if(_arcs[2 * e.id].next_out != -1) {
- _arcs[_arcs[2 * e.id].next_out].prev_out = _arcs[2 * e.id].prev_out;
- }
- if(_arcs[2 * e.id].prev_out != -1) {
- _arcs[_arcs[2 * e.id].prev_out].next_out =
- _arcs[2 * e.id].next_out;
- } else {
- _nodes[_arcs[(2 * e.id) | 1].target].first_out =
- _arcs[2 * e.id].next_out;
- }
-
- if (_nodes[n.id].first_out != -1) {
- _arcs[_nodes[n.id].first_out].prev_out = 2 * e.id;
- }
- _arcs[(2 * e.id) | 1].target = n.id;
- _arcs[2 * e.id].prev_out = -1;
- _arcs[2 * e.id].next_out = _nodes[n.id].first_out;
- _nodes[n.id].first_out = 2 * e.id;
+ if(arcs[2 * e.id].next_out != -1) {
+ arcs[arcs[2 * e.id].next_out].prev_out = arcs[2 * e.id].prev_out;
+ }
+ if(arcs[2 * e.id].prev_out != -1) {
+ arcs[arcs[2 * e.id].prev_out].next_out =
+ arcs[2 * e.id].next_out;
+ } else {
+ nodes[arcs[(2 * e.id) | 1].target].first_out =
+ arcs[2 * e.id].next_out;
+ }
+
+ if (nodes[n.id].first_out != -1) {
+ arcs[nodes[n.id].first_out].prev_out = 2 * e.id;
+ }
+ arcs[(2 * e.id) | 1].target = n.id;
+ arcs[2 * e.id].prev_out = -1;
+ arcs[2 * e.id].next_out = nodes[n.id].first_out;
+ nodes[n.id].first_out = 2 * e.id;
}
@@ -2137,5 +2137,5 @@
ListBpGraph() {}
- typedef Parent::IncEdgeIt IncEdgeIt;
+ typedef Parent::OutArcIt IncEdgeIt;
/// \brief Add a new red node to the graph.
@@ -2250,5 +2250,5 @@
/// to build the graph.
/// \sa reserveEdge()
- void reserveNode(int n) { _nodes.reserve(n); };
+ void reserveNode(int n) { nodes.reserve(n); };
/// Reserve memory for edges.
@@ -2260,5 +2260,5 @@
/// to build the graph.
/// \sa reserveNode()
- void reserveEdge(int m) { _arcs.reserve(2 * m); };
+ void reserveEdge(int m) { arcs.reserve(2 * m); };
/// \brief Class to make a snapshot of the graph and restore
@@ -2300,5 +2300,5 @@
}
virtual void add(const std::vector& nodes) {
- for (int i = nodes.size() - 1; i >= 0; --i) {
+ for (int i = nodes.size() - 1; i >= 0; ++i) {
snapshot.addNode(nodes[i]);
}
@@ -2350,5 +2350,5 @@
}
virtual void add(const std::vector& edges) {
- for (int i = edges.size() - 1; i >= 0; --i) {
+ for (int i = edges.size() - 1; i >= 0; ++i) {
snapshot.addEdge(edges[i]);
}
Index: lemon/lp.h
===================================================================
--- lemon/lp.h (revision 1340)
+++ lemon/lp.h (revision 1270)
@@ -23,18 +23,12 @@
-#if LEMON_DEFAULT_LP == LEMON_GLPK_ || LEMON_DEFAULT_MIP == LEMON_GLPK_
+#ifdef LEMON_HAVE_GLPK
#include
-#endif
-#if LEMON_DEFAULT_LP == LEMON_CPLEX_ || LEMON_DEFAULT_MIP == LEMON_CPLEX_
+#elif LEMON_HAVE_CPLEX
#include
-#endif
-#if LEMON_DEFAULT_LP == LEMON_SOPLEX_
+#elif LEMON_HAVE_SOPLEX
#include
-#endif
-#if LEMON_DEFAULT_LP == LEMON_CLP_
+#elif LEMON_HAVE_CLP
#include
-#endif
-#if LEMON_DEFAULT_MIP == LEMON_CBC_
-#include
#endif
@@ -50,6 +44,6 @@
///\ingroup lp_group
///
- ///Currently, the possible values are \c LEMON_GLPK_, \c LEMON_CPLEX_,
- ///\c LEMON_SOPLEX_ or \c LEMON_CLP_
+ ///Currently, the possible values are \c GLPK, \c CPLEX,
+ ///\c SOPLEX or \c CLP
#define LEMON_DEFAULT_LP SOLVER
///The default LP solver
@@ -66,6 +60,5 @@
///\ingroup lp_group
///
- ///Currently, the possible values are \c LEMON_GLPK_, \c LEMON_CPLEX_
- ///or \c LEMON_CBC_
+ ///Currently, the possible values are \c GLPK, \c CPLEX or \c CBC
#define LEMON_DEFAULT_MIP SOLVER
///The default MIP solver.
@@ -77,18 +70,18 @@
typedef GlpkMip Mip;
#else
-#if LEMON_DEFAULT_LP == LEMON_GLPK_
+#if LEMON_DEFAULT_LP == GLPK
typedef GlpkLp Lp;
-#elif LEMON_DEFAULT_LP == LEMON_CPLEX_
+#elif LEMON_DEFAULT_LP == CPLEX
typedef CplexLp Lp;
-#elif LEMON_DEFAULT_LP == LEMON_SOPLEX_
+#elif LEMON_DEFAULT_LP == SOPLEX
typedef SoplexLp Lp;
-#elif LEMON_DEFAULT_LP == LEMON_CLP_
+#elif LEMON_DEFAULT_LP == CLP
typedef ClpLp Lp;
#endif
-#if LEMON_DEFAULT_MIP == LEMON_GLPK_
- typedef GlpkMip Mip;
-#elif LEMON_DEFAULT_MIP == LEMON_CPLEX_
+#if LEMON_DEFAULT_MIP == GLPK
+ typedef GlpkLp Mip;
+#elif LEMON_DEFAULT_MIP == CPLEX
typedef CplexMip Mip;
-#elif LEMON_DEFAULT_MIP == LEMON_CBC_
+#elif LEMON_DEFAULT_MIP == CBC
typedef CbcMip Mip;
#endif
Index: lemon/lp_base.h
===================================================================
--- lemon/lp_base.h (revision 1353)
+++ lemon/lp_base.h (revision 1270)
@@ -32,6 +32,4 @@
#include
-#include
-
///\file
///\brief The interface of the LP solver interface.
@@ -48,6 +46,6 @@
protected:
- _solver_bits::VarIndex _rows;
- _solver_bits::VarIndex _cols;
+ _solver_bits::VarIndex rows;
+ _solver_bits::VarIndex cols;
public:
@@ -169,5 +167,5 @@
ColIt(const LpBase &solver) : _solver(&solver)
{
- _solver->_cols.firstItem(_id);
+ _solver->cols.firstItem(_id);
}
/// Invalid constructor \& conversion
@@ -182,24 +180,8 @@
ColIt &operator++()
{
- _solver->_cols.nextItem(_id);
+ _solver->cols.nextItem(_id);
return *this;
}
};
-
- /// \brief Gets the collection of the columns of the LP problem.
- ///
- /// This function can be used for iterating on
- /// the columns of the LP problem. It returns a wrapped ColIt, which looks
- /// like an STL container (by having begin() and end())
- /// which you can use in range-based for loops, STL algorithms, etc.
- /// For example you can write:
- ///\code
- /// for(auto c: lp.cols())
- /// doSomething(c);
- ///\endcode
- LemonRangeWrapper1 cols() {
- return LemonRangeWrapper1(*this);
- }
-
/// \brief Returns the ID of the column.
@@ -280,5 +262,5 @@
RowIt(const LpBase &solver) : _solver(&solver)
{
- _solver->_rows.firstItem(_id);
+ _solver->rows.firstItem(_id);
}
/// Invalid constructor \& conversion
@@ -293,24 +275,8 @@
RowIt &operator++()
{
- _solver->_rows.nextItem(_id);
+ _solver->rows.nextItem(_id);
return *this;
}
};
-
- /// \brief Gets the collection of the rows of the LP problem.
- ///
- /// This function can be used for iterating on
- /// the rows of the LP problem. It returns a wrapped RowIt, which looks
- /// like an STL container (by having begin() and end())
- /// which you can use in range-based for loops, STL algorithms, etc.
- /// For example you can write:
- ///\code
- /// for(auto c: lp.rows())
- /// doSomething(c);
- ///\endcode
- LemonRangeWrapper1 rows() {
- return LemonRangeWrapper1