[Lemon-commits] [lemon_svn] deba: r1630 - hugo/trunk/src/work/deba

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:46:41 CET 2006


Author: deba
Date: Fri Mar 11 17:29:03 2005
New Revision: 1630

Added:
   hugo/trunk/src/work/deba/dijkstra_test_generator.cpp
Modified:
   hugo/trunk/src/work/deba/graph_io_test.cc
   hugo/trunk/src/work/deba/test.cpp
   hugo/trunk/src/work/deba/test.lgf

Log:
work modifications



Added: hugo/trunk/src/work/deba/dijkstra_test_generator.cpp
==============================================================================
--- (empty file)
+++ hugo/trunk/src/work/deba/dijkstra_test_generator.cpp	Fri Mar 11 17:29:03 2005
@@ -0,0 +1,41 @@
+#include <iostream>
+#include <vector>
+
+#include <cmath>
+#include <cstdlib>
+
+#include <lemon/smart_graph.h>
+#include <lemon/graph_writer.h>
+
+using namespace lemon;
+using namespace std;
+
+int main(int argc, const char *argv[]) {
+  typedef SmartGraph Graph;
+  typedef Graph::Node Node;
+  typedef Graph::Edge Edge;
+
+  typedef Graph::EdgeMap<int> CapacityMap;
+
+  const int n = argc > 1 ? atoi(argv[1]) : 1000;
+  const int e = argc > 2 ? atoi(argv[2]) : (int)(n * log(n));
+  const int m = argc > 3 ? atoi(argv[3]) : 100;
+
+  Graph graph;
+  CapacityMap capacity(graph);
+  vector<Node> nodes;
+
+  for (int i = 0; i < n; ++i) {
+    nodes.push_back(graph.addNode());
+  }
+  for (int i = 0; i < e; ++i) {
+    int s = (int)(n * (double)rand() / (RAND_MAX + 1.0));
+    int t = (int)(n * (double)rand() / (RAND_MAX + 1.0));
+    int c = (int)(m * (double)rand() / (RAND_MAX + 1.0));
+    Edge edge = graph.addEdge(nodes[s], nodes[t]);
+    capacity[edge] = c;
+  }
+  int start = (int)(n * (double)rand() / (RAND_MAX + 1.0));
+  writeGraph(cout, graph, capacity, nodes[start]);
+  return 0;
+}

Modified: hugo/trunk/src/work/deba/graph_io_test.cc
==============================================================================
--- hugo/trunk/src/work/deba/graph_io_test.cc	(original)
+++ hugo/trunk/src/work/deba/graph_io_test.cc	Fri Mar 11 17:29:03 2005
@@ -1,10 +1,9 @@
 #include <lemon/smart_graph.h>
 
-#include "map_utils.h"
+#include <lemon/map_utils.h>
 
-
-#include "graph_reader.h"
-#include "graph_writer.h"
+#include <lemon/graph_reader.h>
+#include <lemon/graph_writer.h>
 
 #include <iostream>
 #include <fstream>
@@ -41,8 +40,8 @@
   reader.addEdge("newedge", newedge);
 
   try {
-    reader.read();
-  } catch (IOException& e) {
+    reader.run();
+  } catch (IOError& e) {
     cerr << e.what() << endl;
   } catch (Exception e) {
     cerr << e.what() << endl;
@@ -78,7 +77,7 @@
   
   writer.addNode("source", node_ids.inverse()[3]);
   //  writer.addEdge("elek", edge_ids.inverse()[6]);
-  writer.write();
+  writer.run();
   
   return 0;
 }

Modified: hugo/trunk/src/work/deba/test.cpp
==============================================================================
--- hugo/trunk/src/work/deba/test.cpp	(original)
+++ hugo/trunk/src/work/deba/test.cpp	Fri Mar 11 17:29:03 2005
@@ -2,7 +2,10 @@
 
 using namespace std;
 
+#include <lemon/utility.h>
 
+using namespace std;
+/*
 struct _EmptyList {
   void write() const {}
 };
@@ -49,3 +52,36 @@
 int main() {
   Writer().add(3).add("alpha").add(4.53).write();
 }
+*/
+
+class A {
+public:
+  typedef int X;
+};
+
+class C {
+};
+
+template <typename A> 
+class TRUE {
+public:
+  static const bool state = true;
+};
+
+template <typename _A> 
+class B {
+public:
+  typedef enable_if<A::X, int> state;
+};
+
+template <typename _A>
+class B<_A, void> {
+public:
+  static const bool state = true;
+};
+
+int main() {
+  printf("%s\n", B<A>::state(), true ? "true" : "false");
+  printf("%s\n", B<C>::state(), true ? "true" : "false");
+  return 0;
+}

Modified: hugo/trunk/src/work/deba/test.lgf
==============================================================================
--- hugo/trunk/src/work/deba/test.lgf	(original)
+++ hugo/trunk/src/work/deba/test.lgf	Fri Mar 11 17:29:03 2005
@@ -4,7 +4,7 @@
 2 2 blue "A -> B \t: 10" b
 # hatalom dicsoseg "A -> B \t: 10" c
 3 1 red "A -> B \t: 10" d #adjkhj
-4 2 red "A -> B \t: 10" e
+a4 2 red "A -> B \t: 10" e
 5 1 green "A -> B \t: 10" f
 10 1 green "A -> B \t: 10" g
     # hello - bello csucsok "A -> B \t: 10"



More information about the Lemon-commits mailing list