[Lemon-commits] Alpar Juttner: Merge

Lemon HG hg at lemon.cs.elte.hu
Tue Jul 15 19:51:44 CEST 2008


details:   http://lemon.cs.elte.hu/hg/lemon/rev/64613d8fae28
changeset: 221:64613d8fae28
user:      Alpar Juttner <alpar [at] cs.elte.hu>
date:      Tue Jul 15 18:49:30 2008 +0100
description:
	Merge

diffstat:

36 files changed, 2938 insertions(+), 3006 deletions(-)
demo/graph_to_eps_demo.cc         |    1 
lemon/Makefile.am                 |    5 
lemon/base.cc                     |    2 
lemon/bfs.h                       |    3 
lemon/bits/alteration_notifier.h  |    2 
lemon/bits/base_extender.h        |    2 
lemon/bits/enable_if.h            |  131 +
lemon/bits/graph_extender.h       |    3 
lemon/bits/invalid.h              |   55 
lemon/bits/traits.h               |    7 
lemon/bits/utility.h              |  140 -
lemon/bits/vector_map.h           |    4 
lemon/concepts/digraph.h          |    3 
lemon/concepts/graph.h            |    2 
lemon/concepts/graph_components.h |    2 
lemon/concepts/heap.h             |    2 
lemon/concepts/maps.h             |    2 
lemon/concepts/path.h             |    3 
lemon/core.h                      | 1851 ++++++++++++++++++++++++
lemon/dfs.h                       |    3 
lemon/dijkstra.h                  |    2 
lemon/dim2.h                      |    2 
lemon/graph_to_eps.h              |    2 
lemon/graph_utils.h               | 2760 -------------------------------------
lemon/kruskal.h                   |    7 
lemon/lgf_reader.h                |    2 
lemon/lgf_writer.h                |    3 
lemon/list_graph.h                |    2 
lemon/maps.h                      |  923 ++++++++++++
lemon/path.h                      |    2 
lemon/smart_graph.h               |    8 
lemon/unionfind.h                 |    2 
test/dijkstra_test.cc             |    1 
test/graph_copy_test.cc           |    1 
test/graph_test.h                 |    2 
test/graph_utils_test.cc          |    2 

diffs (truncated from 6316 to 300 lines):

diff -r b9c6a47c977b -r 64613d8fae28 demo/graph_to_eps_demo.cc
--- a/demo/graph_to_eps_demo.cc	Tue Jul 15 18:43:41 2008 +0100
+++ b/demo/graph_to_eps_demo.cc	Tue Jul 15 18:49:30 2008 +0100
@@ -31,7 +31,6 @@
 /// \include graph_to_eps_demo.cc
 
 #include<lemon/list_graph.h>
-#include<lemon/graph_utils.h>
 #include<lemon/graph_to_eps.h>
 #include<lemon/math.h>
 
diff -r b9c6a47c977b -r 64613d8fae28 lemon/Makefile.am
--- a/lemon/Makefile.am	Tue Jul 15 18:43:41 2008 +0100
+++ b/lemon/Makefile.am	Tue Jul 15 18:49:30 2008 +0100
@@ -24,12 +24,12 @@
         lemon/color.h \
 	lemon/concept_check.h \
         lemon/counter.h \
+	lemon/core.h \
         lemon/dfs.h \
         lemon/dijkstra.h \
         lemon/dim2.h \
 	lemon/error.h \
         lemon/graph_to_eps.h \
-	lemon/graph_utils.h \
 	lemon/kruskal.h \
 	lemon/lgf_reader.h \
 	lemon/lgf_writer.h \
@@ -49,12 +49,11 @@
 	lemon/bits/base_extender.h \
         lemon/bits/bezier.h \
 	lemon/bits/default_map.h \
+        lemon/bits/enable_if.h \
 	lemon/bits/graph_extender.h \
-        lemon/bits/invalid.h \
 	lemon/bits/map_extender.h \
 	lemon/bits/path_dump.h \
 	lemon/bits/traits.h \
-        lemon/bits/utility.h \
 	lemon/bits/vector_map.h
 
 concept_HEADERS += \
diff -r b9c6a47c977b -r 64613d8fae28 lemon/base.cc
--- a/lemon/base.cc	Tue Jul 15 18:43:41 2008 +0100
+++ b/lemon/base.cc	Tue Jul 15 18:49:30 2008 +0100
@@ -20,7 +20,7 @@
 ///\brief Some basic non-inline functions and static global data.
 
 #include<lemon/tolerance.h>
-#include<lemon/bits/invalid.h>
+#include<lemon/core.h>
 namespace lemon {
 
   float Tolerance<float>::def_epsilon = 1e-4;
diff -r b9c6a47c977b -r 64613d8fae28 lemon/bfs.h
--- a/lemon/bfs.h	Tue Jul 15 18:43:41 2008 +0100
+++ b/lemon/bfs.h	Tue Jul 15 18:49:30 2008 +0100
@@ -24,9 +24,8 @@
 ///\brief Bfs algorithm.
 
 #include <lemon/list_graph.h>
-#include <lemon/graph_utils.h>
 #include <lemon/bits/path_dump.h>
-#include <lemon/bits/invalid.h>
+#include <lemon/core.h>
 #include <lemon/error.h>
 #include <lemon/maps.h>
 
diff -r b9c6a47c977b -r 64613d8fae28 lemon/bits/alteration_notifier.h
--- a/lemon/bits/alteration_notifier.h	Tue Jul 15 18:43:41 2008 +0100
+++ b/lemon/bits/alteration_notifier.h	Tue Jul 15 18:49:30 2008 +0100
@@ -22,7 +22,7 @@
 #include <vector>
 #include <list>
 
-#include <lemon/bits/utility.h>
+#include <lemon/core.h>
 
 ///\ingroup graphbits
 ///\file
diff -r b9c6a47c977b -r 64613d8fae28 lemon/bits/base_extender.h
--- a/lemon/bits/base_extender.h	Tue Jul 15 18:43:41 2008 +0100
+++ b/lemon/bits/base_extender.h	Tue Jul 15 18:49:30 2008 +0100
@@ -19,7 +19,7 @@
 #ifndef LEMON_BITS_BASE_EXTENDER_H
 #define LEMON_BITS_BASE_EXTENDER_H
 
-#include <lemon/bits/invalid.h>
+#include <lemon/core.h>
 #include <lemon/error.h>
 
 #include <lemon/bits/map_extender.h>
diff -r b9c6a47c977b -r 64613d8fae28 lemon/bits/enable_if.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lemon/bits/enable_if.h	Tue Jul 15 18:49:30 2008 +0100
@@ -0,0 +1,131 @@
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library.
+ *
+ * Copyright (C) 2003-2008
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+// This file contains a modified version of the enable_if library from BOOST.
+// See the appropriate copyright notice below.
+
+// Boost enable_if library
+
+// Copyright 2003 (c) The Trustees of Indiana University.
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//    Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
+//             Jeremiah Willcock (jewillco at osl.iu.edu)
+//             Andrew Lumsdaine (lums at osl.iu.edu)
+
+
+#ifndef LEMON_BITS_ENABLE_IF_H
+#define LEMON_BITS_ENABLE_IF_H
+
+///\file
+///\brief Miscellaneous basic utilities
+
+namespace lemon
+{
+
+  /// Basic type for defining "tags". A "YES" condition for \c enable_if.
+
+  /// Basic type for defining "tags". A "YES" condition for \c enable_if.
+  ///
+  ///\sa False
+  struct True {
+    ///\e
+    static const bool value = true;
+  };
+
+  /// Basic type for defining "tags". A "NO" condition for \c enable_if.
+
+  /// Basic type for defining "tags". A "NO" condition for \c enable_if.
+  ///
+  ///\sa True
+  struct False {
+    ///\e
+    static const bool value = false;
+  };
+
+
+
+  template <typename T>
+  struct Wrap {
+    const T &value;
+    Wrap(const T &t) : value(t) {}
+  };
+
+  /**************** dummy class to avoid ambiguity ****************/
+
+  template<int T> struct dummy { dummy(int) {} };
+
+  /**************** enable_if from BOOST ****************/
+
+  template <typename Type, typename T = void>
+  struct exists {
+    typedef T type;
+  };
+
+
+  template <bool B, class T = void>
+  struct enable_if_c {
+    typedef T type;
+  };
+
+  template <class T>
+  struct enable_if_c<false, T> {};
+
+  template <class Cond, class T = void>
+  struct enable_if : public enable_if_c<Cond::value, T> {};
+
+  template <bool B, class T>
+  struct lazy_enable_if_c {
+    typedef typename T::type type;
+  };
+
+  template <class T>
+  struct lazy_enable_if_c<false, T> {};
+
+  template <class Cond, class T>
+  struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
+
+
+  template <bool B, class T = void>
+  struct disable_if_c {
+    typedef T type;
+  };
+
+  template <class T>
+  struct disable_if_c<true, T> {};
+
+  template <class Cond, class T = void>
+  struct disable_if : public disable_if_c<Cond::value, T> {};
+
+  template <bool B, class T>
+  struct lazy_disable_if_c {
+    typedef typename T::type type;
+  };
+
+  template <class T>
+  struct lazy_disable_if_c<true, T> {};
+
+  template <class Cond, class T>
+  struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
+
+} // namespace lemon
+
+#endif
diff -r b9c6a47c977b -r 64613d8fae28 lemon/bits/graph_extender.h
--- a/lemon/bits/graph_extender.h	Tue Jul 15 18:43:41 2008 +0100
+++ b/lemon/bits/graph_extender.h	Tue Jul 15 18:49:30 2008 +0100
@@ -19,8 +19,7 @@
 #ifndef LEMON_BITS_GRAPH_EXTENDER_H
 #define LEMON_BITS_GRAPH_EXTENDER_H
 
-#include <lemon/bits/invalid.h>
-#include <lemon/bits/utility.h>
+#include <lemon/core.h>
 
 #include <lemon/bits/map_extender.h>
 #include <lemon/bits/default_map.h>
diff -r b9c6a47c977b -r 64613d8fae28 lemon/bits/invalid.h
--- a/lemon/bits/invalid.h	Tue Jul 15 18:43:41 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/* -*- mode: C++; indent-tabs-mode: nil; -*-
- *
- * This file is a part of LEMON, a generic C++ optimization library.
- *
- * Copyright (C) 2003-2008
- * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
- * (Egervary Research Group on Combinatorial Optimization, EGRES).
- *
- * Permission to use, modify and distribute this software is granted
- * provided that this copyright notice appears in all copies. For
- * precise terms see the accompanying LICENSE file.
- *
- * This software is provided "AS IS" with no warranty of any kind,
- * express or implied, and with no claim as to its suitability for any
- * purpose.
- *
- */
-
-#ifndef LEMON_BITS_INVALID_H
-#define LEMON_BITS_INVALID_H
-
-///\file
-///\brief Definition of INVALID.
-
-namespace lemon {
-
-  /// \brief Dummy type to make it easier to create invalid iterators.
-  ///
-  /// Dummy type to make it easier to create invalid iterators.
-  /// See \ref INVALID for the usage.
-  struct Invalid {
-  public:
-    bool operator==(Invalid) { return true;  }
-    bool operator!=(Invalid) { return false; }
-    bool operator< (Invalid) { return false; }
-  };
-
-  /// \brief Invalid iterators.
-  ///
-  /// \ref Invalid is a global type that converts to each iterator
-  /// in such a way that the value of the target iterator will be invalid.
-
-  //Some people didn't like this:
-  //const Invalid &INVALID = *(Invalid *)0;
-
-#ifdef LEMON_ONLY_TEMPLATES
-  const Invalid INVALID = Invalid();
-#else
-  extern const Invalid INVALID;
-#endif
-
-} //namespace lemon
-
-#endif
-
diff -r b9c6a47c977b -r 64613d8fae28 lemon/bits/traits.h



More information about the Lemon-commits mailing list