[Lemon-commits] [lemon_svn] alpar: r745 - in hugo/trunk/src: hugo test
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:41:16 CET 2006
Author: alpar
Date: Fri May 7 10:02:17 2004
New Revision: 745
Modified:
hugo/trunk/src/hugo/dijkstra.h
hugo/trunk/src/test/dijkstra_test.cc
Log:
Compile checks added.
Modified: hugo/trunk/src/hugo/dijkstra.h
==============================================================================
--- hugo/trunk/src/hugo/dijkstra.h (original)
+++ hugo/trunk/src/hugo/dijkstra.h Fri May 7 10:02:17 2004
@@ -38,6 +38,7 @@
///is using \ref BinHeap "binary heap".
///
///\author Jacint Szabo
+ ///\todo We need a LengthMap typedef
#ifdef DOXYGEN
template <typename Graph,
typename LengthMap,
Modified: hugo/trunk/src/test/dijkstra_test.cc
==============================================================================
--- hugo/trunk/src/test/dijkstra_test.cc (original)
+++ hugo/trunk/src/test/dijkstra_test.cc Fri May 7 10:02:17 2004
@@ -6,6 +6,44 @@
const int PET_SIZE =5;
+
+void check_Dijkstra_SmartGraph_BinHeap_Compile()
+{
+ typedef int VType;
+ typedef SmartGraph Graph;
+
+ typedef Graph::Edge Edge;
+ typedef Graph::Node Node;
+ typedef Graph::EdgeIt EdgeIt;
+ typedef Graph::NodeIt NodeIt;
+ typedef Graph::EdgeMap<VType> LengthMap;
+
+ typedef Dijkstra<Graph, LengthMap> DType;
+
+ Graph G;
+ Node n;
+ Edge e;
+ VType l;
+ bool b;
+ DType::DistMap d(G);
+ DType::PredMap p(G);
+ DType::PredNodeMap pn(G);
+ LengthMap cap(G);
+
+ DType dijkstra_test(G,cap);
+
+ dijkstra_test.run(n);
+
+ l = dijkstra_test.dist(n);
+ e = dijkstra_test.pred(n);
+ n = dijkstra_test.predNode(n);
+ d = dijkstra_test.distMap();
+ p = dijkstra_test.predMap();
+ pn = dijkstra_test.predNodeMap();
+ b = dijkstra_test.reached(n);
+
+}
+
int main()
{
@@ -20,7 +58,6 @@
Graph G;
Node s, t;
LengthMap cap(G);
-
PetStruct<Graph> ps = addPetersen(G,PET_SIZE);
for(int i=0;i<PET_SIZE;i++) {
@@ -38,4 +75,3 @@
check(dijkstra_test.dist(t)==13,"Dijkstra found a wrong path.");
}
-
More information about the Lemon-commits
mailing list