mirror of https://github.com/CGAL/cgal
WIP
This commit is contained in:
parent
6f5b927968
commit
d74567a177
|
|
@ -35,7 +35,6 @@ run(const G& g)
|
|||
typedef typename boost::property_map<G,CGAL::vertex_point_t>::const_type VPM;
|
||||
VPM vpm = get(CGAL::vertex_point,g);
|
||||
|
||||
|
||||
std::vector<vertex_descriptor> V, V2;
|
||||
std::vector<Point_3> P1, P2;
|
||||
BOOST_FOREACH(vertex_descriptor vd, vertices(g)){
|
||||
|
|
@ -69,16 +68,17 @@ run(const G& g)
|
|||
std::cerr << "BOOST_FOREACH boost::iterator_range r = vertices(g))\n";
|
||||
t.reset(); t.start();
|
||||
boost::iterator_range<typename boost::graph_traits<G>::vertex_iterator> r = vertices(g);
|
||||
BOOST_FOREACH(vertex_descriptor& vd, r) {
|
||||
BOOST_FOREACH(vertex_descriptor vd, r) {
|
||||
typename Map::iterator it = vm.find(vd);
|
||||
v = v + ((*it).second - CGAL::ORIGIN);
|
||||
}
|
||||
t.stop(); std::cerr << " " <<t.time() << " sec. " << std::endl;
|
||||
|
||||
|
||||
std::cerr << "BOOST_FOREACH CGAL::Iterator_range r = vertices(g))\n";
|
||||
t.reset(); t.start();
|
||||
CGAL::Iterator_range<typename boost::graph_traits<G>::vertex_iterator> ir = vertices(g);
|
||||
BOOST_FOREACH(vertex_descriptor& vd, ir) {
|
||||
BOOST_FOREACH(vertex_descriptor vd, ir) {
|
||||
typename Map::iterator it = vm.find(vd);
|
||||
v = v + ((*it).second - CGAL::ORIGIN);
|
||||
}
|
||||
|
|
@ -105,6 +105,7 @@ run(const G& g)
|
|||
t.stop(); std::cerr << " " <<t.time() << " sec. " << std::endl;
|
||||
|
||||
std::cerr << "v = " << v << std::endl;
|
||||
|
||||
}
|
||||
|
||||
struct blob {
|
||||
|
|
@ -125,15 +126,15 @@ int main(int , char* argv[])
|
|||
Mesh m;
|
||||
std::ifstream input(argv[1]);
|
||||
input >> m;
|
||||
std::cerr << num_vertices(m) << " items\n";
|
||||
std::cerr << "\nSurface_mesh std::map"<< std::endl;
|
||||
run<Mesh,SM>(m);
|
||||
//std::cerr << num_vertices(m) << " items\n";
|
||||
//std::cerr << "\nSurface_mesh std::map"<< std::endl;
|
||||
//run<Mesh,SM>(m);
|
||||
std::cerr << "\nSurface_mesh std::unordered_map"<< std::endl;
|
||||
run<Mesh,SUM>(m);
|
||||
std::cerr << "\nSurface_mesh boost::unordered_map"<< std::endl;
|
||||
run<Mesh,BUM>(m);
|
||||
}
|
||||
|
||||
#if 0
|
||||
{
|
||||
typedef CGAL::Polyhedron_3<Kernel> Mesh;
|
||||
typedef boost::graph_traits<Mesh>::vertex_descriptor vertex_descriptor;
|
||||
|
|
@ -187,6 +188,7 @@ int main(int , char* argv[])
|
|||
std::cerr << " std::unordered_map: " << t.time() << " sec.\n";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ namespace CGAL {
|
|||
: Base(b,e)
|
||||
{}
|
||||
|
||||
|
||||
// Iterator_range(const Iterator_range& ip)
|
||||
// : Base(ip)
|
||||
// {}
|
||||
|
||||
Iterator_range(const std::pair<I,I>& ip)
|
||||
: Base(ip)
|
||||
{}
|
||||
|
|
@ -90,9 +95,19 @@ namespace CGAL {
|
|||
{
|
||||
return x.second;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
// At global scope...
|
||||
|
||||
template<typename T>
|
||||
inline boost::mpl::true_ *
|
||||
boost_foreach_is_lightweight_proxy( CGAL::Iterator_range<T> *&, boost::foreach::tag )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
namespace boost { namespace foreach
|
||||
{
|
||||
template<typename T>
|
||||
|
|
|
|||
Loading…
Reference in New Issue