Mercurial > hg > nsaunier > traffic-intelligence
comparison c/test_graph.cpp @ 391:03dbecd3a887
modified feature grouping to return vectors of pointers to feature trajectories
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Thu, 25 Jul 2013 18:58:55 -0400 |
| parents | cc8e54997d4c |
| children | 05ccd8ef150c |
comparison
equal
deleted
inserted
replaced
| 389:6d26dcc7bba0 | 391:03dbecd3a887 |
|---|---|
| 27 featureGraph.addFeature(ft2); | 27 featureGraph.addFeature(ft2); |
| 28 REQUIRE(featureGraph.getNVertices() == 2); | 28 REQUIRE(featureGraph.getNVertices() == 2); |
| 29 REQUIRE(featureGraph.getNEdges() == 1); | 29 REQUIRE(featureGraph.getNEdges() == 1); |
| 30 | 30 |
| 31 featureGraph.connectedComponents(lastInstant); | 31 featureGraph.connectedComponents(lastInstant); |
| 32 vector<vector<unsigned int> > components = featureGraph.getFeatureGroups(); | 32 vector<vector<FeatureTrajectoryPtr> > components; |
| 33 featureGraph.getFeatureGroups(components); | |
| 33 REQUIRE(components.size() == 0); | 34 REQUIRE(components.size() == 0); |
| 34 REQUIRE(featureGraph.getNVertices() == 2); | 35 REQUIRE(featureGraph.getNVertices() == 2); |
| 35 REQUIRE(featureGraph.getNEdges() == 1); | 36 REQUIRE(featureGraph.getNEdges() == 1); |
| 36 | 37 |
| 37 featureGraph.connectedComponents(lastInstant+1); | 38 featureGraph.connectedComponents(lastInstant+1); |
| 38 components = featureGraph.getFeatureGroups(); | 39 featureGraph.getFeatureGroups(components); |
| 39 REQUIRE(components.size() == 1); | 40 REQUIRE(components.size() == 1); |
| 40 REQUIRE(components[0].size() == 2); | 41 REQUIRE(components[0].size() == 2); |
| 41 REQUIRE(featureGraph.getNVertices() == 0); | 42 REQUIRE(featureGraph.getNVertices() == 0); |
| 42 REQUIRE(featureGraph.getNEdges() == 0); | 43 REQUIRE(featureGraph.getNEdges() == 0); |
| 43 | 44 |
| 58 | 59 |
| 59 REQUIRE(featureGraph.getNVertices() == 4); | 60 REQUIRE(featureGraph.getNVertices() == 4); |
| 60 REQUIRE(featureGraph.getNEdges() == 2); | 61 REQUIRE(featureGraph.getNEdges() == 2); |
| 61 | 62 |
| 62 featureGraph.connectedComponents(lastInstant+1); | 63 featureGraph.connectedComponents(lastInstant+1); |
| 63 components = featureGraph.getFeatureGroups(); | 64 featureGraph.getFeatureGroups(components); |
| 64 REQUIRE(components.size() == 2); | 65 REQUIRE(components.size() == 2); |
| 65 REQUIRE(components[0].size() == 3); | 66 REQUIRE(components[0].size() == 3); |
| 66 REQUIRE(components[1].size() == 1); | 67 REQUIRE(components[1].size() == 1); |
| 67 REQUIRE(featureGraph.getNVertices() == 0); | 68 REQUIRE(featureGraph.getNVertices() == 0); |
| 68 REQUIRE(featureGraph.getNEdges() == 0); | 69 REQUIRE(featureGraph.getNEdges() == 0); |
