getPath() added to Bfs/Dfs/Dijkstra.
2 * src/test/xy_test.cc - Part of LEMON, a generic C++ optimization library
4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
5 * (Egervary Combinatorial Optimization Research Group, EGRES).
7 * Permission to use, modify and distribute this software is granted
8 * provided that this copyright notice appears in all copies. For
9 * precise terms see the accompanying LICENSE file.
11 * This software is provided "AS IS" with no warranty of any kind,
12 * express or implied, and with no claim as to its suitability for any
19 #include "test_tools.h"
22 using namespace lemon;
26 cout << "Testing classes `xy' and `boundingbox'." << endl;
35 check(seged.x==4 && seged.y==6, "Wrong vector addition");
38 check(seged.x==-2 && seged.y==-2, "a-b");
40 check(a.normSquare()==5,"Wrong norm calculation");
41 check(a*b==11, "a*b");
45 check(seged.x==2 && seged.y==4, "a*l");
48 check(seged.x==1 && seged.y==2, "b/l");
50 typedef BoundingBox<int> BB;
52 check(doboz1.empty(), "It should be empty.");
55 check(!doboz1.empty(), "It should not be empty.");
58 check(doboz1.bottomLeft().x==1 &&
59 doboz1.bottomLeft().y==2 &&
60 doboz1.topRight().x==3 &&
61 doboz1.topRight().y==4,
62 "added points to box");
65 check(doboz1.inside(seged),"It should be inside.");
68 check(doboz1.inside(seged),"It should be inside.");
71 check(!doboz1.inside(seged),"It should not be inside.");
74 check(!doboz2.empty(),
75 "It should not be empty. Constructed from 1 point.");
78 check(doboz2.inside(seged),
79 "It should be inside. Incremented a box with an other.");