mirror of https://github.com/CGAL/cgal
Adapted sorting algorithms based on compare_xyz to handle weighted point vectors
This commit is contained in:
parent
6c7313bc96
commit
aa03fdc65e
|
|
@ -32,6 +32,7 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <boost/mpl/if.hpp>
|
#include <boost/mpl/if.hpp>
|
||||||
#include <boost/mpl/identity.hpp>
|
#include <boost/mpl/identity.hpp>
|
||||||
|
#include <boost/bind.hpp>
|
||||||
|
|
||||||
|
|
||||||
#ifdef CGAL_LINKED_WITH_TBB
|
#ifdef CGAL_LINKED_WITH_TBB
|
||||||
|
|
@ -1627,13 +1628,22 @@ dual(Cell_handle c) const
|
||||||
return os;
|
return os;
|
||||||
|
|
||||||
// We are now in a degenerate case => we do a symbolic perturbation.
|
// We are now in a degenerate case => we do a symbolic perturbation.
|
||||||
|
typename Geom_traits::Construct_point_3 cp =
|
||||||
|
geom_traits().construct_point_3_object();
|
||||||
|
|
||||||
// We sort the points lexicographically.
|
// We sort the points lexicographically.
|
||||||
const Weighted_point * points[5] = {&p0, &p1, &p2, &p3, &p};
|
const Weighted_point * points[5] = {&p0, &p1, &p2, &p3, &p};
|
||||||
|
|
||||||
|
// It is important to tell boost::bind that we want references in return
|
||||||
|
// by writing `boost::bind<const ... &>(...)` otherwise we get temporaries
|
||||||
|
// and we call Compare_xyz_3 on objects that might have been cleaned
|
||||||
std::sort(points, points + 5,
|
std::sort(points, points + 5,
|
||||||
boost::bind<Comparison_result>(geom_traits().compare_xyz_3_object(),
|
boost::bind<Comparison_result>(geom_traits().compare_xyz_3_object(),
|
||||||
boost::bind(Dereference<Weighted_point>(), _1),
|
boost::bind<const Bare_point&>(
|
||||||
boost::bind(Dereference<Weighted_point>(), _2)) == SMALLER);
|
cp, boost::bind<const Weighted_point&>(Dereference<Weighted_point>(), _1)),
|
||||||
|
boost::bind<const Bare_point&>(
|
||||||
|
cp, boost::bind<const Weighted_point&>(Dereference<Weighted_point>(), _2)))
|
||||||
|
== SMALLER);
|
||||||
|
|
||||||
// We successively look whether the leading monomial, then 2nd monomial
|
// We successively look whether the leading monomial, then 2nd monomial
|
||||||
// of the determinant has non null coefficient.
|
// of the determinant has non null coefficient.
|
||||||
|
|
@ -1737,13 +1747,22 @@ dual(Cell_handle c) const
|
||||||
return os;
|
return os;
|
||||||
|
|
||||||
// We are now in a degenerate case => we do a symbolic perturbation.
|
// We are now in a degenerate case => we do a symbolic perturbation.
|
||||||
|
typename Geom_traits::Construct_point_3 cp =
|
||||||
|
geom_traits().construct_point_3_object();
|
||||||
|
|
||||||
// We sort the points lexicographically.
|
// We sort the points lexicographically.
|
||||||
const Weighted_point * points[4] = {&p0, &p1, &p2, &p};
|
const Weighted_point * points[4] = {&p0, &p1, &p2, &p};
|
||||||
|
|
||||||
|
// It is important to tell boost::bind that we want references in return
|
||||||
|
// by writing `boost::bind<const ... &>(...)` otherwise we get temporaries
|
||||||
|
// and we call Compare_xyz_3 on objects that might have been cleaned
|
||||||
std::sort(points, points + 4,
|
std::sort(points, points + 4,
|
||||||
boost::bind<Comparison_result>(geom_traits().compare_xyz_3_object(),
|
boost::bind<Comparison_result>(geom_traits().compare_xyz_3_object(),
|
||||||
boost::bind(Dereference<Weighted_point>(), _1),
|
boost::bind<const Bare_point&>(
|
||||||
boost::bind(Dereference<Weighted_point>(), _2)) == SMALLER);
|
cp, boost::bind<const Weighted_point&>(Dereference<Weighted_point>(), _1)),
|
||||||
|
boost::bind<const Bare_point&>(
|
||||||
|
cp, boost::bind<const Weighted_point&>(Dereference<Weighted_point>(), _2)))
|
||||||
|
== SMALLER);
|
||||||
|
|
||||||
// We successively look whether the leading monomial, then 2nd monomial
|
// We successively look whether the leading monomial, then 2nd monomial
|
||||||
// of the determinant has non null coefficient.
|
// of the determinant has non null coefficient.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue