Mercurial Hosting > traffic-intelligence
diff c/Motion.cpp @ 230:bc4ea09b1743
compatibility modifications for visual studio compilation
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 29 Jun 2012 16:15:13 -0400 |
parents | f7ddfc4aeb1e |
children | 249d65ff6c35 |
line wrap: on
line diff
--- a/c/Motion.cpp Wed May 16 02:23:49 2012 -0400 +++ b/c/Motion.cpp Fri Jun 29 16:15:13 2012 -0400 @@ -101,8 +101,8 @@ if (frameNum > lastInstant) lastInstant = frameNum; computeMotionData(frameNum); - assert(positions.size() == displacementDistances.size()+1); - assert(positions.size() == velocities.size()+1); + assert(positions->size() == displacementDistances.size()+1); + assert(positions->size() == velocities->size()+1); } void FeatureTrajectory::shorten(void) { @@ -164,7 +164,7 @@ if (ft->minMaxSimilarity(*ft2, firstInstant, lastInstant, connectionDistance, segmentationDistance)) { UndirectedGraph::edge_descriptor e; bool unused; - tie(e, unused) = add_edge(newVertex, *vi, graph); + std::tr1::tie(e, unused) = add_edge(newVertex, *vi, graph); // no need to add measures to graph[e] (edge properties) } } @@ -179,11 +179,11 @@ int num = connected_components(graph, components, vertex_index_map(get(&VertexInformation::index, graph))); cout << "last instant threshold " << lastInstant << " Total number of components: " << num << endl; - vector<unsigned int> lastInstants(num, 0); // last instant of component with id - vector<vector<vertex_descriptor> > tmpobjects(num), objects; // vector of components (component = vector of vertex descriptors) + std::vector<unsigned int> lastInstants(num, 0); // last instant of component with id + std::vector<std::vector<vertex_descriptor> > tmpobjects(num), objects; // vector of components (component = vector of vertex descriptors) graph_traits<UndirectedGraph>::vertex_iterator vi, vend; - for(tie(vi,vend) = vertices(graph); vi != vend; ++vi) { + for(std::tr1::tie(vi,vend) = vertices(graph); vi != vend; ++vi) { //for (int i = 0; i < nVertices; ++i) { unsigned int id = components[*vi]; //cout << "Vertex " << *vi << " is in component " << id << endl;// "(last " << graph[i].feature->getLastInstant() << " " << lastInstants[components[i]] << " " << (lastInstants[components[i]] < graph[i].feature->getLastInstant()) << ")" << endl; @@ -200,8 +200,8 @@ } } -vector<vector<unsigned int> > FeatureGraph::getFeatureGroups(void) { - vector<vector<unsigned int> > featureGroups; +std::vector<std::vector<unsigned int> > FeatureGraph::getFeatureGroups(void) { + std::vector<std::vector<unsigned int> > featureGroups; for (unsigned int i=0; i<objectHypotheses.size(); ++i) { // check that there is on average at least minNFeaturesPerGroup features at each frame in the group @@ -211,7 +211,7 @@ cout << i << endl; if (totalFeatureTime/static_cast<float>(objectHypotheses[i].size()) > minNFeaturesPerGroup) { cout << "save group " << objectHypotheses[i].size() << " " << totalFeatureTime/static_cast<float>(objectHypotheses[i].size()) << endl; - featureGroups.push_back(vector<unsigned int>()); + featureGroups.push_back(std::vector<unsigned int>()); for (unsigned int j=0; j<objectHypotheses[i].size(); ++j) { featureGroups.back().push_back(graph[objectHypotheses[i][j]].feature->getId());cout << featureGroups.size() << " " << objectHypotheses[i][j] << endl; clear_vertex(objectHypotheses[i][j], graph);cout << "cleared "<< objectHypotheses[i][j] << endl; @@ -236,6 +236,6 @@ void FeatureGraph::computeVertexIndex(void) { graph_traits<FeatureGraph::UndirectedGraph>::vertex_iterator vi, vend; graph_traits<FeatureGraph::UndirectedGraph>::vertices_size_type cnt = 0; - for(tie(vi,vend) = vertices(graph); vi != vend; ++vi) + for(std::tr1::tie(vi,vend) = vertices(graph); vi != vend; ++vi) graph[*vi].index = cnt++; }