comparison c/Motion.cpp @ 232:04355e51d895

removed tr1::
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 03 Jul 2012 00:17:30 -0400
parents 249d65ff6c35
children 21f14fadd098
comparison
equal deleted inserted replaced
231:249d65ff6c35 232:04355e51d895
162 int firstInstant = static_cast<int>(MAX(ft->getFirstInstant(), ft2->getFirstInstant())); 162 int firstInstant = static_cast<int>(MAX(ft->getFirstInstant(), ft2->getFirstInstant()));
163 if (lastInstant-firstInstant > static_cast<int>(minFeatureTime)) { // equivalent to lastInstant-firstInstant+1 >= minFeatureTime 163 if (lastInstant-firstInstant > static_cast<int>(minFeatureTime)) { // equivalent to lastInstant-firstInstant+1 >= minFeatureTime
164 if (ft->minMaxSimilarity(*ft2, firstInstant, lastInstant, connectionDistance, segmentationDistance)) { 164 if (ft->minMaxSimilarity(*ft2, firstInstant, lastInstant, connectionDistance, segmentationDistance)) {
165 UndirectedGraph::edge_descriptor e; 165 UndirectedGraph::edge_descriptor e;
166 bool unused; 166 bool unused;
167 tr1::tie(e, unused) = add_edge(newVertex, *vi, graph); 167 tie(e, unused) = add_edge(newVertex, *vi, graph);
168 // no need to add measures to graph[e] (edge properties) 168 // no need to add measures to graph[e] (edge properties)
169 } 169 }
170 } 170 }
171 } 171 }
172 } 172 }
183 183
184 vector<unsigned int> lastInstants(num, 0); // last instant of component with id 184 vector<unsigned int> lastInstants(num, 0); // last instant of component with id
185 vector<vector<vertex_descriptor> > tmpobjects(num), objects; // vector of components (component = vector of vertex descriptors) 185 vector<vector<vertex_descriptor> > tmpobjects(num), objects; // vector of components (component = vector of vertex descriptors)
186 186
187 graph_traits<UndirectedGraph>::vertex_iterator vi, vend; 187 graph_traits<UndirectedGraph>::vertex_iterator vi, vend;
188 for(tr1::tie(vi,vend) = vertices(graph); vi != vend; ++vi) { 188 for(tie(vi,vend) = vertices(graph); vi != vend; ++vi) {
189 unsigned int id = components[*vi]; 189 unsigned int id = components[*vi];
190 lastInstants[id] = max(lastInstants[id], graph[*vi].feature->getLastInstant()); 190 lastInstants[id] = max(lastInstants[id], graph[*vi].feature->getLastInstant());
191 tmpobjects[id].push_back(*vi); 191 tmpobjects[id].push_back(*vi);
192 } 192 }
193 193
244 int FeatureGraph::getNEdges(void) const { return num_edges(graph);} 244 int FeatureGraph::getNEdges(void) const { return num_edges(graph);}
245 245
246 void FeatureGraph::computeVertexIndex(void) { 246 void FeatureGraph::computeVertexIndex(void) {
247 graph_traits<FeatureGraph::UndirectedGraph>::vertex_iterator vi, vend; 247 graph_traits<FeatureGraph::UndirectedGraph>::vertex_iterator vi, vend;
248 graph_traits<FeatureGraph::UndirectedGraph>::vertices_size_type cnt = 0; 248 graph_traits<FeatureGraph::UndirectedGraph>::vertices_size_type cnt = 0;
249 for(tr1::tie(vi,vend) = vertices(graph); vi != vend; ++vi) 249 for(tie(vi,vend) = vertices(graph); vi != vend; ++vi)
250 graph[*vi].index = cnt++; 250 graph[*vi].index = cnt++;
251 } 251 }