[Lemon-commits] Alpar Juttner: Merge
Lemon HG
hg at lemon.cs.elte.hu
Tue Dec 20 19:49:42 CET 2011
details: http://lemon.cs.elte.hu/hg/lemon/rev/2b6bffe0e7e8
changeset: 1107:2b6bffe0e7e8
user: Alpar Juttner <alpar [at] cs.elte.hu>
date: Tue Dec 20 18:15:14 2011 +0100
description:
Merge
diffstat:
.hgignore | 1 +
CMakeLists.txt | 2 +
INSTALL | 22 +
Makefile.am | 1 +
README | 8 +
configure.ac | 17 +
demo/arg_parser_demo.cc | 13 +-
doc/CMakeLists.txt | 5 +-
doc/Doxyfile.in | 3 +-
doc/Makefile.am | 16 +-
doc/groups.dox | 250 ++-
doc/images/matching.eps | 130 +
doc/images/planar.eps | 181 ++
doc/mainpage.dox.in | 30 +-
doc/min_cost_flow.dox | 12 +-
doc/references.bib | 301 +++
lemon/Makefile.am | 16 +-
lemon/adaptors.h | 108 +-
lemon/arg_parser.cc | 21 +-
lemon/arg_parser.h | 49 +-
lemon/bellman_ford.h | 1165 +++++++++++++++
lemon/bfs.h | 167 +-
lemon/bin_heap.h | 220 +-
lemon/binomial_heap.h | 445 +++++
lemon/bits/array_map.h | 4 +-
lemon/bits/default_map.h | 4 +-
lemon/bits/edge_set_extender.h | 222 +-
lemon/bits/graph_extender.h | 10 +-
lemon/bits/solver_bits.h | 2 +-
lemon/bits/windows.cc | 4 +-
lemon/bucket_heap.h | 307 ++-
lemon/capacity_scaling.h | 990 ++++++++++++
lemon/cbc.cc | 12 +
lemon/cbc.h | 5 +-
lemon/circulation.h | 42 +-
lemon/clp.cc | 15 +-
lemon/clp.h | 5 +-
lemon/concepts/digraph.h | 347 ++--
lemon/concepts/graph.h | 670 ++++----
lemon/concepts/graph_components.h | 50 +-
lemon/concepts/heap.h | 176 +-
lemon/concepts/path.h | 85 +-
lemon/connectivity.h | 20 +-
lemon/core.h | 7 +-
lemon/cost_scaling.h | 1316 +++++++++++++++++
lemon/counter.h | 2 +-
lemon/cplex.cc | 37 +-
lemon/cplex.h | 1 +
lemon/cycle_canceling.h | 1170 +++++++++++++++
lemon/dfs.h | 161 +-
lemon/dheap.h | 352 ++++
lemon/dijkstra.h | 138 +-
lemon/dim2.h | 11 +-
lemon/dimacs.h | 14 +-
lemon/edge_set.h | 36 +-
lemon/euler.h | 12 +-
lemon/fib_heap.h | 243 +-
lemon/fractional_matching.h | 2139 +++++++++++++++++++++++++++
lemon/full_graph.h | 128 +-
lemon/glpk.cc | 38 +-
lemon/glpk.h | 15 +-
lemon/gomory_hu.h | 192 +-
lemon/graph_to_eps.h | 10 +-
lemon/grid_graph.h | 74 +-
lemon/hao_orlin.h | 37 +-
lemon/hartmann_orlin_mmc.h | 650 ++++++++
lemon/howard_mmc.h | 605 +++++++
lemon/hypercube_graph.h | 39 +-
lemon/karp_mmc.h | 590 +++++++
lemon/lgf_reader.h | 18 +-
lemon/lgf_writer.h | 16 +-
lemon/list_graph.h | 491 +++--
lemon/lp.h | 4 +-
lemon/lp_base.cc | 2 +-
lemon/lp_base.h | 116 +-
lemon/lp_skeleton.cc | 7 +-
lemon/lp_skeleton.h | 8 +-
lemon/maps.h | 1387 +++++++++++++++++-
lemon/matching.h | 935 +++++++----
lemon/math.h | 4 +-
lemon/min_cost_arborescence.h | 21 +-
lemon/network_simplex.h | 504 ++++--
lemon/pairing_heap.h | 474 ++++++
lemon/path.h | 8 +-
lemon/planarity.h | 2755 ++++++++++++++++++++++++++++++++++++
lemon/preflow.h | 42 +-
lemon/quad_heap.h | 343 ++++
lemon/radix_heap.h | 363 ++--
lemon/smart_graph.h | 346 ++--
lemon/soplex.cc | 17 +-
lemon/soplex.h | 3 +-
lemon/static_graph.h | 476 ++++++
lemon/suurballe.h | 474 ++++-
lemon/time_measure.h | 2 +-
lemon/unionfind.h | 4 +-
scripts/Makefile.am | 7 +
scripts/bib2dox.py | 816 ++++++++++
scripts/bootstrap.sh | 157 ++
scripts/chg-len.py | 14 +
scripts/mk-release.sh | 14 +
scripts/unify-sources.sh | 14 +
scripts/valgrind-wrapper.sh | 22 +
test/CMakeLists.txt | 4 +
test/Makefile.am | 12 +
test/adaptors_test.cc | 85 +-
test/bellman_ford_test.cc | 286 +++
test/bfs_test.cc | 12 +-
test/circulation_test.cc | 11 +-
test/connectivity_test.cc | 38 +-
test/dfs_test.cc | 8 +-
test/digraph_test.cc | 133 +-
test/dijkstra_test.cc | 10 +-
test/edge_set_test.cc | 2 +-
test/euler_test.cc | 14 +-
test/fractional_matching_test.cc | 525 ++++++
test/gomory_hu_test.cc | 26 +-
test/graph_test.cc | 30 +-
test/hao_orlin_test.cc | 18 +-
test/heap_test.cc | 106 +-
test/maps_test.cc | 631 ++++++++-
test/matching_test.cc | 62 +-
test/min_cost_arborescence_test.cc | 8 +-
test/min_cost_flow_test.cc | 412 +++--
test/min_mean_cycle_test.cc | 216 ++
test/planarity_test.cc | 262 +++
test/preflow_test.cc | 9 +-
test/suurballe_test.cc | 52 +-
test/test_tools.h | 16 +-
tools/dimacs-solver.cc | 31 +-
tools/lemon-0.x-to-1.x.sh | 9 +-
130 files changed, 23512 insertions(+), 3550 deletions(-)
diffs (truncated from 35988 to 300 lines):
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -22,6 +22,7 @@
lemon/libemon.la
lemon/stamp-h2
doc/Doxyfile
+doc/references.dox
cmake/version.cmake
.dirstamp
.libs/*
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -114,6 +114,8 @@
CHECK_TYPE_SIZE("long long" LONG_LONG)
SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
+INCLUDE(FindPythonInterp)
+
ENABLE_TESTING()
IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
diff --git a/INSTALL b/INSTALL
--- a/INSTALL
+++ b/INSTALL
@@ -173,3 +173,25 @@
--without-coin
Disable COIN-OR support.
+
+
+Makefile Variables
+==================
+
+Some Makefile variables are reserved by the GNU Coding Standards for
+the use of the "user" - the person building the package. For instance,
+CXX and CXXFLAGS are such variables, and have the same meaning as
+explained in the previous section. These variables can be set on the
+command line when invoking `make' like this:
+`make [VARIABLE=VALUE]...'
+
+WARNINGCXXFLAGS is a non-standard Makefile variable introduced by us
+to hold several compiler flags related to warnings. Its default value
+can be overridden when invoking `make'. For example to disable all
+warning flags use `make WARNINGCXXFLAGS='.
+
+In order to turn off a single flag from the default set of warning
+flags, you can use the CXXFLAGS variable, since this is passed after
+WARNINGCXXFLAGS. For example to turn off `-Wold-style-cast' (which is
+used by default when g++ is detected) you can use
+`make CXXFLAGS="-g -O2 -Wno-old-style-cast"'.
diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -44,6 +44,7 @@
include test/Makefile.am
include doc/Makefile.am
include tools/Makefile.am
+include scripts/Makefile.am
DIST_SUBDIRS = demo
diff --git a/README b/README
--- a/README
+++ b/README
@@ -17,6 +17,10 @@
Copying, distribution and modification conditions and terms.
+NEWS
+
+ News and version history.
+
INSTALL
General building and installation instructions.
@@ -33,6 +37,10 @@
Some example programs to make you easier to get familiar with LEMON.
+scripts/
+
+ Scripts that make it easier to develop LEMON.
+
test/
Programs to check the integrity and correctness of LEMON.
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,7 @@
AC_PROG_LIBTOOL
AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
+AC_CHECK_PROG([python_found],[python],[yes],[no])
AC_CHECK_PROG([gs_found],[gs],[yes],[no])
dnl Detect Intel compiler.
@@ -82,6 +83,21 @@
fi
AM_CONDITIONAL([WANT_TOOLS], [test x"$enable_tools" != x"no"])
+dnl Support for running test cases using valgrind.
+use_valgrind=no
+AC_ARG_ENABLE([valgrind],
+AS_HELP_STRING([--enable-valgrind], [use valgrind when running tests]),
+ [use_valgrind=yes])
+
+if [[ "$use_valgrind" = "yes" ]]; then
+ AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
+
+ if [[ "$HAVE_VALGRIND" = "no" ]]; then
+ AC_MSG_ERROR([Valgrind not found in PATH.])
+ fi
+fi
+AM_CONDITIONAL(USE_VALGRIND, [test "$use_valgrind" = "yes"])
+
dnl Checks for header files.
AC_CHECK_HEADERS(limits.h sys/time.h sys/times.h unistd.h)
@@ -128,6 +144,7 @@
echo CBC support................... : $lx_cbc_found
echo
echo Build additional tools........ : $enable_tools
+echo Use valgrind for tests........ : $use_valgrind
echo
echo The packace will be installed in
echo -n ' '
diff --git a/demo/arg_parser_demo.cc b/demo/arg_parser_demo.cc
--- a/demo/arg_parser_demo.cc
+++ b/demo/arg_parser_demo.cc
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -65,9 +65,18 @@
ap.other("infile", "The input file.")
.other("...");
+ // Throw an exception when problems occurs. The default behavior is to
+ // exit(1) on these cases, but this makes Valgrind falsely warn
+ // about memory leaks.
+ ap.throwOnProblems();
+
// Perform the parsing process
// (in case of any error it terminates the program)
- ap.parse();
+ // The try {} construct is necessary only if the ap.trowOnProblems()
+ // setting is in use.
+ try {
+ ap.parse();
+ } catch (ArgParserException &) { return 1; }
// Check each option if it has been given and print its value
std::cout << "Parameters of '" << ap.commandName() << "':\n";
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -17,7 +17,7 @@
@ONLY
)
-IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
+IF(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE)
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/)
SET(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha)
ADD_CUSTOM_TARGET(html
@@ -28,14 +28,17 @@
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/connected_components.eps
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/edge_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/edge_biconnected_components.eps
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps
+ COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/matching.png ${CMAKE_CURRENT_SOURCE_DIR}/images/matching.eps
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/node_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/node_biconnected_components.eps
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
+ COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/planar.png ${CMAKE_CURRENT_SOURCE_DIR}/images/planar.eps
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/strongly_connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/strongly_connected_components.eps
COMMAND ${CMAKE_COMMAND} -E remove_directory html
+ COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/bib2dox.py ${CMAKE_CURRENT_SOURCE_DIR}/references.bib >references.dox
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -97,7 +97,8 @@
"@abs_top_srcdir@/demo" \
"@abs_top_srcdir@/tools" \
"@abs_top_srcdir@/test/test_tools.h" \
- "@abs_top_builddir@/doc/mainpage.dox"
+ "@abs_top_builddir@/doc/mainpage.dox" \
+ "@abs_top_builddir@/doc/references.dox"
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.h \
*.cc \
diff --git a/doc/Makefile.am b/doc/Makefile.am
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -27,7 +27,9 @@
bipartite_partitions.eps \
connected_components.eps \
edge_biconnected_components.eps \
+ matching.eps \
node_biconnected_components.eps \
+ planar.eps \
strongly_connected_components.eps
DOC_EPS_IMAGES = \
@@ -66,7 +68,19 @@
exit 1; \
fi
-html-local: $(DOC_PNG_IMAGES)
+references.dox: doc/references.bib
+ if test ${python_found} = yes; then \
+ cd doc; \
+ python @abs_top_srcdir@/scripts/bib2dox.py @abs_top_builddir@/$< >$@; \
+ cd ..; \
+ else \
+ echo; \
+ echo "Python not found."; \
+ echo; \
+ exit 1; \
+ fi
+
+html-local: $(DOC_PNG_IMAGES) references.dox
if test ${doxygen_found} = yes; then \
cd doc; \
doxygen Doxyfile; \
diff --git a/doc/groups.dox b/doc/groups.dox
--- a/doc/groups.dox
+++ b/doc/groups.dox
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2009
+ * Copyright (C) 2003-2010
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -226,14 +226,6 @@
*/
/**
- at defgroup matrices Matrices
- at ingroup datas
-\brief Two dimensional data storages implemented in LEMON.
-
-This group contains two dimensional data storages implemented in LEMON.
-*/
-
-/**
@defgroup paths Path Structures
@ingroup datas
\brief %Path structures implemented in LEMON.
@@ -246,7 +238,36 @@
efficient to have e.g. the Dijkstra algorithm to store its result in
any kind of path structure.
-\sa lemon::concepts::Path
+\sa \ref concepts::Path "Path concept"
+*/
+
+/**
+ at defgroup heaps Heap Structures
+ at ingroup datas
+\brief %Heap structures implemented in LEMON.
+
+This group contains the heap structures implemented in LEMON.
+
+LEMON provides several heap classes. They are efficient implementations
+of the abstract data type \e priority \e queue. They store items with
+specified values called \e priorities in such a way that finding and
+removing the item with minimum priority are efficient.
+The basic operations are adding and erasing items, changing the priority
+of an item, etc.
+
+Heaps are crucial in several algorithms, such as Dijkstra and Prim.
+The heap implementations have the same interface, thus any of them can be
+used easily in such algorithms.
+
+\sa \ref concepts::Heap "Heap concept"
+*/
+
+/**
+ at defgroup matrices Matrices
+ at ingroup datas
+\brief Two dimensional data storages implemented in LEMON.
+
+This group contains two dimensional data storages implemented in LEMON.
More information about the Lemon-commits
mailing list