[Lemon-commits] Alpar Juttner: Merge
Lemon HG
hg at lemon.cs.elte.hu
Tue Apr 22 18:59:40 CEST 2008
details: http://lemon.cs.elte.hu/hg/lemon/rev/95d905b6e33d
changeset: 145:95d905b6e33d
user: Alpar Juttner <alpar [at] cs.elte.hu>
date: Tue Apr 22 17:52:01 2008 +0100
description:
Merge
diffstat:
16 files changed, 87 insertions(+), 32 deletions(-)
.hgignore | 5 +++++
CMakeLists.txt | 5 +++++
benchmark/Makefile | 2 --
demo/CMakeLists.txt | 13 +++++++++++++
demo/Makefile | 2 --
demo/lgf_demo.cc | 2 +-
doc/Makefile | 2 --
lemon/CMakeLists.txt | 2 ++
lemon/Makefile | 2 --
lemon/assert.h | 8 +++++++-
lemon/graph_to_eps.h | 2 ++
lemon/path.h | 43 +++++++++++++++++++++++++------------------
lemon/time_measure.h | 3 +++
test/CMakeLists.txt | 24 ++++++++++++++++++++++++
test/Makefile | 2 --
tools/Makefile | 2 --
diffs (252 lines):
diff -r 356930927a71 -r 95d905b6e33d .hgignore
--- a/.hgignore Tue Apr 22 15:07:04 2008 +0200
+++ b/.hgignore Tue Apr 22 17:52:01 2008 +0100
@@ -34,3 +34,8 @@
^objs.*/.*
^test/[a-z_]*$
^demo/.*_demo$
+^build/.*
+CMakeFiles
+DartTestfile.txt
+cmake_install.cmake
+CMakeCache.txt
diff -r 356930927a71 -r 95d905b6e33d CMakeLists.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/CMakeLists.txt Tue Apr 22 17:52:01 2008 +0100
@@ -0,0 +1,5 @@
+project (LEMON)
+enable_testing ()
+add_subdirectory (lemon)
+add_subdirectory (demo)
+add_subdirectory (test)
diff -r 356930927a71 -r 95d905b6e33d benchmark/Makefile
--- a/benchmark/Makefile Tue Apr 22 15:07:04 2008 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-all:
- $(MAKE) -C ..
diff -r 356930927a71 -r 95d905b6e33d demo/CMakeLists.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/demo/CMakeLists.txt Tue Apr 22 17:52:01 2008 +0100
@@ -0,0 +1,13 @@
+include_directories (${LEMON_SOURCE_DIR})
+
+link_directories (${LEMON_BINARY_DIR}/lemon)
+
+set (DEMOS
+ arg_parser_demo
+ graph_to_eps_demo
+ lgf_demo)
+
+foreach (DEMO_NAME ${DEMOS})
+ add_executable (${DEMO_NAME} ${DEMO_NAME}.cc)
+ target_link_libraries (${DEMO_NAME} lemon)
+ endforeach (DEMO_NAME)
diff -r 356930927a71 -r 95d905b6e33d demo/Makefile
--- a/demo/Makefile Tue Apr 22 15:07:04 2008 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-all:
- $(MAKE) -C ..
diff -r 356930927a71 -r 95d905b6e33d demo/lgf_demo.cc
--- a/demo/lgf_demo.cc Tue Apr 22 15:07:04 2008 +0200
+++ b/demo/lgf_demo.cc Tue Apr 22 17:52:01 2008 +0100
@@ -37,7 +37,7 @@
int main(int argc, const char *argv[]) {
const int n = argc > 1 ? std::atoi(argv[1]) : 20;
- const int e = argc > 2 ? std::atoi(argv[2]) : static_cast<int>(n * log(n));
+ const int e = argc > 2 ? std::atoi(argv[2]) : static_cast<int>(n * std::log(double(n)));
const int m = argc > 3 ? std::atoi(argv[3]) : 100;
SmartDigraph digraph;
diff -r 356930927a71 -r 95d905b6e33d doc/Makefile
--- a/doc/Makefile Tue Apr 22 15:07:04 2008 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-all:
- $(MAKE) -C ..
diff -r 356930927a71 -r 95d905b6e33d lemon/CMakeLists.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lemon/CMakeLists.txt Tue Apr 22 17:52:01 2008 +0100
@@ -0,0 +1,2 @@
+include_directories (${LEMON_SOURCE_DIR})
+add_library (lemon arg_parser.cc base.cc color.cc random.cc)
diff -r 356930927a71 -r 95d905b6e33d lemon/Makefile
--- a/lemon/Makefile Tue Apr 22 15:07:04 2008 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-all:
- $(MAKE) -C ..
diff -r 356930927a71 -r 95d905b6e33d lemon/assert.h
--- a/lemon/assert.h Tue Apr 22 15:07:04 2008 +0200
+++ b/lemon/assert.h Tue Apr 22 17:52:01 2008 +0100
@@ -103,7 +103,13 @@
#endif
#ifndef LEMON_FUNCTION_NAME
-# define LEMON_FUNCTION_NAME (__PRETTY_FUNCTION__)
+# if defined __GNUC__
+# define LEMON_FUNCTION_NAME (__PRETTY_FUNCTION__)
+# elif defined _MSC_VER
+# define LEMON_FUNCTION_NAME (__FUNCSIG__)
+# else
+# define LEMON_FUNCTION_NAME (__func__)
+# endif
#endif
#ifdef DOXYGEN
diff -r 356930927a71 -r 95d905b6e33d lemon/graph_to_eps.h
--- a/lemon/graph_to_eps.h Tue Apr 22 15:07:04 2008 +0200
+++ b/lemon/graph_to_eps.h Tue Apr 22 17:52:01 2008 +0100
@@ -29,6 +29,8 @@
#include<sys/time.h>
#include<ctime>
#else
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
#include<windows.h>
#endif
diff -r 356930927a71 -r 95d905b6e33d lemon/path.h
--- a/lemon/path.h Tue Apr 22 15:07:04 2008 +0200
+++ b/lemon/path.h Tue Apr 22 17:52:01 2008 +0100
@@ -903,20 +903,34 @@
namespace _path_bits {
template <typename Path, typename Enable = void>
- struct RevTagIndicator {
+ struct RevPathTagIndicator {
static const bool value = false;
};
- template <typename Digraph>
- struct RevTagIndicator<
- Digraph,
- typename enable_if<typename Digraph::RevTag, void>::type
+ template <typename Path>
+ struct RevPathTagIndicator<
+ Path,
+ typename enable_if<typename Path::RevPathTag, void>::type
+ > {
+ static const bool value = true;
+ };
+
+ template <typename Path, typename Enable = void>
+ struct BuildTagIndicator {
+ static const bool value = false;
+ };
+
+ template <typename Path>
+ struct BuildTagIndicator<
+ Path,
+ typename enable_if<typename Path::BuildTag, void>::type
> {
static const bool value = true;
};
template <typename Target, typename Source,
- typename BuildEnable = void, typename RevEnable = void>
+ bool buildEnable = BuildTagIndicator<Target>::value,
+ bool revEnable = RevPathTagIndicator<Source>::value>
struct PathCopySelector {
static void copy(Target& target, const Source& source) {
target.clear();
@@ -926,10 +940,8 @@
}
};
- template <typename Target, typename Source, typename BuildEnable>
- struct PathCopySelector<
- Target, Source, BuildEnable,
- typename enable_if<typename Source::RevPathTag, void>::type> {
+ template <typename Target, typename Source>
+ struct PathCopySelector<Target, Source, false, true> {
static void copy(Target& target, const Source& source) {
target.clear();
for (typename Source::RevArcIt it(source); it != INVALID; ++it) {
@@ -938,10 +950,8 @@
}
};
- template <typename Target, typename Source, typename RevEnable>
- struct PathCopySelector<
- Target, Source,
- typename enable_if<typename Target::BuildTag, void>::type, RevEnable> {
+ template <typename Target, typename Source>
+ struct PathCopySelector<Target, Source, true, false> {
static void copy(Target& target, const Source& source) {
target.clear();
target.build(source);
@@ -949,10 +959,7 @@
};
template <typename Target, typename Source>
- struct PathCopySelector<
- Target, Source,
- typename enable_if<typename Target::BuildTag, void>::type,
- typename enable_if<typename Source::RevPathTag, void>::type> {
+ struct PathCopySelector<Target, Source, true, true> {
static void copy(Target& target, const Source& source) {
target.clear();
target.buildRev(source);
diff -r 356930927a71 -r 95d905b6e33d lemon/time_measure.h
--- a/lemon/time_measure.h Tue Apr 22 15:07:04 2008 +0200
+++ b/lemon/time_measure.h Tue Apr 22 17:52:01 2008 +0100
@@ -24,6 +24,8 @@
///\brief Tools for measuring cpu usage
#ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
#include <windows.h>
#include <cmath>
#else
@@ -31,6 +33,7 @@
#include <sys/time.h>
#endif
+#include <string>
#include <fstream>
#include <iostream>
diff -r 356930927a71 -r 95d905b6e33d test/CMakeLists.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/CMakeLists.txt Tue Apr 22 17:52:01 2008 +0100
@@ -0,0 +1,24 @@
+include_directories (${LEMON_SOURCE_DIR})
+
+link_directories (${LEMON_BINARY_DIR}/lemon)
+
+set (TESTS
+ bfs_test
+ counter_test
+ dfs_test
+ digraph_test
+ dim_test
+ error_test
+ graph_test
+ kruskal_test
+ maps_test
+ random_test
+ path_test
+ time_measure_test
+ unionfind_test)
+
+foreach (TEST_NAME ${TESTS})
+ add_executable (${TEST_NAME} ${TEST_NAME}.cc)
+ target_link_libraries (${TEST_NAME} lemon)
+ add_test(${TEST_NAME} ${TEST_NAME})
+endforeach (TEST_NAME)
diff -r 356930927a71 -r 95d905b6e33d test/Makefile
--- a/test/Makefile Tue Apr 22 15:07:04 2008 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-all:
- $(MAKE) -C ..
diff -r 356930927a71 -r 95d905b6e33d tools/Makefile
--- a/tools/Makefile Tue Apr 22 15:07:04 2008 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-all:
- $(MAKE) -C ..
More information about the Lemon-commits
mailing list