Increasing the perf of the filtered predicate

When FT is Interval_nt, it is better that the
Do_intersect_bbox_segment_aux_is_greater returns a Uncertain<bool> instead
of a bool. That can delay the conversion of Uncertain<bool> to bool, and
hence better perf.
This commit is contained in:
Laurent Rineau 2012-03-21 14:24:31 +00:00
parent e940d97a75
commit b5d987a4b5
1 changed files with 7 additions and 6 deletions

View File

@ -25,6 +25,7 @@
#include <CGAL/Segment_3.h> #include <CGAL/Segment_3.h>
#include <CGAL/Bbox_3.h> #include <CGAL/Bbox_3.h>
#include <CGAL/Kernel/Same_uncertainty.h>
// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf
@ -41,12 +42,12 @@ namespace CGAL {
namespace internal { namespace internal {
template <bool use_static_filters = false> template <typename FT, bool use_static_filters = false>
struct Do_intersect_bbox_segment_aux_is_greater { struct Do_intersect_bbox_segment_aux_is_greater
typedef bool result_type; {
typedef typename Same_uncertainty<bool, FT>::type result_type;
template <typename FT> result_type operator()(const FT& a, const FT& b) const {
bool operator()(const FT& a, const FT& b) const {
return a > b; return a > b;
} }
}; };
@ -267,7 +268,7 @@ namespace internal {
CGAL_assertion(dzmin >= 0); CGAL_assertion(dzmin >= 0);
CGAL_assertion(dzmax >= 0); CGAL_assertion(dzmax >= 0);
typedef Do_intersect_bbox_segment_aux_is_greater<false> Is_greater; typedef Do_intersect_bbox_segment_aux_is_greater<FT, false> Is_greater;
typedef typename Is_greater::result_type Is_greater_value; typedef typename Is_greater::result_type Is_greater_value;
Is_greater is_greater; Is_greater is_greater;