1.1 --- a/.hgignore Tue Apr 22 15:07:04 2008 +0200
1.2 +++ b/.hgignore Tue Apr 22 17:52:01 2008 +0100
1.3 @@ -34,3 +34,8 @@
1.4 ^objs.*/.*
1.5 ^test/[a-z_]*$
1.6 ^demo/.*_demo$
1.7 +^build/.*
1.8 +CMakeFiles
1.9 +DartTestfile.txt
1.10 +cmake_install.cmake
1.11 +CMakeCache.txt
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/CMakeLists.txt Tue Apr 22 17:52:01 2008 +0100
2.3 @@ -0,0 +1,5 @@
2.4 +project (LEMON)
2.5 +enable_testing ()
2.6 +add_subdirectory (lemon)
2.7 +add_subdirectory (demo)
2.8 +add_subdirectory (test)
3.1 --- a/benchmark/Makefile Tue Apr 22 15:07:04 2008 +0200
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,2 +0,0 @@
3.4 -all:
3.5 - $(MAKE) -C ..
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/demo/CMakeLists.txt Tue Apr 22 17:52:01 2008 +0100
4.3 @@ -0,0 +1,13 @@
4.4 +include_directories (${LEMON_SOURCE_DIR})
4.5 +
4.6 +link_directories (${LEMON_BINARY_DIR}/lemon)
4.7 +
4.8 +set (DEMOS
4.9 + arg_parser_demo
4.10 + graph_to_eps_demo
4.11 + lgf_demo)
4.12 +
4.13 +foreach (DEMO_NAME ${DEMOS})
4.14 + add_executable (${DEMO_NAME} ${DEMO_NAME}.cc)
4.15 + target_link_libraries (${DEMO_NAME} lemon)
4.16 + endforeach (DEMO_NAME)
5.1 --- a/demo/Makefile Tue Apr 22 15:07:04 2008 +0200
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,2 +0,0 @@
5.4 -all:
5.5 - $(MAKE) -C ..
6.1 --- a/demo/lgf_demo.cc Tue Apr 22 15:07:04 2008 +0200
6.2 +++ b/demo/lgf_demo.cc Tue Apr 22 17:52:01 2008 +0100
6.3 @@ -37,7 +37,7 @@
6.4
6.5 int main(int argc, const char *argv[]) {
6.6 const int n = argc > 1 ? std::atoi(argv[1]) : 20;
6.7 - const int e = argc > 2 ? std::atoi(argv[2]) : static_cast<int>(n * log(n));
6.8 + const int e = argc > 2 ? std::atoi(argv[2]) : static_cast<int>(n * std::log(double(n)));
6.9 const int m = argc > 3 ? std::atoi(argv[3]) : 100;
6.10
6.11 SmartDigraph digraph;
7.1 --- a/doc/Makefile Tue Apr 22 15:07:04 2008 +0200
7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
7.3 @@ -1,2 +0,0 @@
7.4 -all:
7.5 - $(MAKE) -C ..
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/lemon/CMakeLists.txt Tue Apr 22 17:52:01 2008 +0100
8.3 @@ -0,0 +1,2 @@
8.4 +include_directories (${LEMON_SOURCE_DIR})
8.5 +add_library (lemon arg_parser.cc base.cc color.cc random.cc)
9.1 --- a/lemon/Makefile Tue Apr 22 15:07:04 2008 +0200
9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
9.3 @@ -1,2 +0,0 @@
9.4 -all:
9.5 - $(MAKE) -C ..
10.1 --- a/lemon/assert.h Tue Apr 22 15:07:04 2008 +0200
10.2 +++ b/lemon/assert.h Tue Apr 22 17:52:01 2008 +0100
10.3 @@ -103,7 +103,13 @@
10.4 #endif
10.5
10.6 #ifndef LEMON_FUNCTION_NAME
10.7 -# define LEMON_FUNCTION_NAME (__PRETTY_FUNCTION__)
10.8 +# if defined __GNUC__
10.9 +# define LEMON_FUNCTION_NAME (__PRETTY_FUNCTION__)
10.10 +# elif defined _MSC_VER
10.11 +# define LEMON_FUNCTION_NAME (__FUNCSIG__)
10.12 +# else
10.13 +# define LEMON_FUNCTION_NAME (__func__)
10.14 +# endif
10.15 #endif
10.16
10.17 #ifdef DOXYGEN
11.1 --- a/lemon/graph_to_eps.h Tue Apr 22 15:07:04 2008 +0200
11.2 +++ b/lemon/graph_to_eps.h Tue Apr 22 17:52:01 2008 +0100
11.3 @@ -29,6 +29,8 @@
11.4 #include<sys/time.h>
11.5 #include<ctime>
11.6 #else
11.7 +#define WIN32_LEAN_AND_MEAN
11.8 +#define NOMINMAX
11.9 #include<windows.h>
11.10 #endif
11.11
12.1 --- a/lemon/path.h Tue Apr 22 15:07:04 2008 +0200
12.2 +++ b/lemon/path.h Tue Apr 22 17:52:01 2008 +0100
12.3 @@ -903,20 +903,34 @@
12.4 namespace _path_bits {
12.5
12.6 template <typename Path, typename Enable = void>
12.7 - struct RevTagIndicator {
12.8 + struct RevPathTagIndicator {
12.9 static const bool value = false;
12.10 };
12.11
12.12 - template <typename Digraph>
12.13 - struct RevTagIndicator<
12.14 - Digraph,
12.15 - typename enable_if<typename Digraph::RevTag, void>::type
12.16 + template <typename Path>
12.17 + struct RevPathTagIndicator<
12.18 + Path,
12.19 + typename enable_if<typename Path::RevPathTag, void>::type
12.20 + > {
12.21 + static const bool value = true;
12.22 + };
12.23 +
12.24 + template <typename Path, typename Enable = void>
12.25 + struct BuildTagIndicator {
12.26 + static const bool value = false;
12.27 + };
12.28 +
12.29 + template <typename Path>
12.30 + struct BuildTagIndicator<
12.31 + Path,
12.32 + typename enable_if<typename Path::BuildTag, void>::type
12.33 > {
12.34 static const bool value = true;
12.35 };
12.36
12.37 template <typename Target, typename Source,
12.38 - typename BuildEnable = void, typename RevEnable = void>
12.39 + bool buildEnable = BuildTagIndicator<Target>::value,
12.40 + bool revEnable = RevPathTagIndicator<Source>::value>
12.41 struct PathCopySelector {
12.42 static void copy(Target& target, const Source& source) {
12.43 target.clear();
12.44 @@ -926,10 +940,8 @@
12.45 }
12.46 };
12.47
12.48 - template <typename Target, typename Source, typename BuildEnable>
12.49 - struct PathCopySelector<
12.50 - Target, Source, BuildEnable,
12.51 - typename enable_if<typename Source::RevPathTag, void>::type> {
12.52 + template <typename Target, typename Source>
12.53 + struct PathCopySelector<Target, Source, false, true> {
12.54 static void copy(Target& target, const Source& source) {
12.55 target.clear();
12.56 for (typename Source::RevArcIt it(source); it != INVALID; ++it) {
12.57 @@ -938,10 +950,8 @@
12.58 }
12.59 };
12.60
12.61 - template <typename Target, typename Source, typename RevEnable>
12.62 - struct PathCopySelector<
12.63 - Target, Source,
12.64 - typename enable_if<typename Target::BuildTag, void>::type, RevEnable> {
12.65 + template <typename Target, typename Source>
12.66 + struct PathCopySelector<Target, Source, true, false> {
12.67 static void copy(Target& target, const Source& source) {
12.68 target.clear();
12.69 target.build(source);
12.70 @@ -949,10 +959,7 @@
12.71 };
12.72
12.73 template <typename Target, typename Source>
12.74 - struct PathCopySelector<
12.75 - Target, Source,
12.76 - typename enable_if<typename Target::BuildTag, void>::type,
12.77 - typename enable_if<typename Source::RevPathTag, void>::type> {
12.78 + struct PathCopySelector<Target, Source, true, true> {
12.79 static void copy(Target& target, const Source& source) {
12.80 target.clear();
12.81 target.buildRev(source);
13.1 --- a/lemon/time_measure.h Tue Apr 22 15:07:04 2008 +0200
13.2 +++ b/lemon/time_measure.h Tue Apr 22 17:52:01 2008 +0100
13.3 @@ -24,6 +24,8 @@
13.4 ///\brief Tools for measuring cpu usage
13.5
13.6 #ifdef WIN32
13.7 +#define WIN32_LEAN_AND_MEAN
13.8 +#define NOMINMAX
13.9 #include <windows.h>
13.10 #include <cmath>
13.11 #else
13.12 @@ -31,6 +33,7 @@
13.13 #include <sys/time.h>
13.14 #endif
13.15
13.16 +#include <string>
13.17 #include <fstream>
13.18 #include <iostream>
13.19
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14.2 +++ b/test/CMakeLists.txt Tue Apr 22 17:52:01 2008 +0100
14.3 @@ -0,0 +1,24 @@
14.4 +include_directories (${LEMON_SOURCE_DIR})
14.5 +
14.6 +link_directories (${LEMON_BINARY_DIR}/lemon)
14.7 +
14.8 +set (TESTS
14.9 + bfs_test
14.10 + counter_test
14.11 + dfs_test
14.12 + digraph_test
14.13 + dim_test
14.14 + error_test
14.15 + graph_test
14.16 + kruskal_test
14.17 + maps_test
14.18 + random_test
14.19 + path_test
14.20 + time_measure_test
14.21 + unionfind_test)
14.22 +
14.23 +foreach (TEST_NAME ${TESTS})
14.24 + add_executable (${TEST_NAME} ${TEST_NAME}.cc)
14.25 + target_link_libraries (${TEST_NAME} lemon)
14.26 + add_test(${TEST_NAME} ${TEST_NAME})
14.27 +endforeach (TEST_NAME)
15.1 --- a/test/Makefile Tue Apr 22 15:07:04 2008 +0200
15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
15.3 @@ -1,2 +0,0 @@
15.4 -all:
15.5 - $(MAKE) -C ..
16.1 --- a/tools/Makefile Tue Apr 22 15:07:04 2008 +0200
16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
16.3 @@ -1,2 +0,0 @@
16.4 -all:
16.5 - $(MAKE) -C ..