From a0be560caad344527ea6c9e775497b4a7a016c29 Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Mon, 8 Sep 2008 09:52:37 +0000 Subject: [PATCH] New profiling tool : Profile_branch_counter, that improves the display of failure/calls ratios. With the corresponding macro CGAL_BRANCH_PROFILER(). --- .../CGAL/Lazy_circular_kernel_constructions.h | 25 +++--- .../include/CGAL/Filtered_predicate.h | 88 +++++++++---------- Filtered_kernel/include/CGAL/Lazy.h | 76 ++++++++-------- Number_types/include/CGAL/Lazy_exact_nt.h | 44 +++++----- .../include/CGAL/Profile_counter.h | 61 ++++++++++--- .../include/CGAL/Skin_surface_base_3.h | 18 ++-- 6 files changed, 169 insertions(+), 143 deletions(-) diff --git a/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_constructions.h b/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_constructions.h index 59bce6bd2ff..f1f5b0b229d 100644 --- a/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_constructions.h +++ b/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_constructions.h @@ -91,9 +91,8 @@ public: OutputIterator operator()(const L1& l1, const L2& l2, OutputIterator it) const { - + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Lazy_vector lv(new Lazy_construct_rep_with_vector_2(ac, ec, l1, l2)); @@ -131,7 +130,7 @@ public: } } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); // TODO: Instead of using a vector, write an iterator adapter std::vector exact_objects; @@ -170,9 +169,8 @@ public: OutputIterator operator()(const L1& l1,OutputIterator it) const { - + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Lazy_vector lv(new Lazy_construct_rep_with_vector_1(ac, ec, l1)); // lv.approx() is a std::vector @@ -199,7 +197,7 @@ public: } } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); // TODO: Instead of using a vector, write an iterator adapter std::vector exact_objects; @@ -239,9 +237,8 @@ public: OutputIterator operator()(const L1& l1,OutputIterator it) const { - + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Lazy_vector lv(new Lazy_construct_rep_with_vector_1(ac, ec, l1)); // lv.approx() is a std::vector @@ -268,7 +265,7 @@ public: } } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); // TODO: Instead of using a vector, write an iterator adapter std::vector exact_objects; @@ -315,9 +312,8 @@ template result_type operator()(const L1& l1) const { - + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Lazy_object lo(new Lazy_construct_rep_1(ac, ec, l1)); @@ -351,7 +347,7 @@ template std::cerr << "object_cast inside Lazy_construction_rep::operator() failed. It needs more else if's" << std::endl; } } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); ET eto = ec(CGAL::exact(l1)); return make_lazy_CK(eto); @@ -365,9 +361,8 @@ template result_type operator()(const L1& l1, const L2& l2) const { - + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Lazy_object lo(new Lazy_construct_rep_2(ac, ec, l1, l2)); @@ -402,7 +397,7 @@ template std::cerr << "object_cast inside Lazy_construction_rep::operator() failed. It needs more else if's" << std::endl; } } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); ET eto = ec(CGAL::exact(l1), CGAL::exact(l2)); return make_lazy_CK(eto); diff --git a/Filtered_kernel/include/CGAL/Filtered_predicate.h b/Filtered_kernel/include/CGAL/Filtered_predicate.h index d7525ad6568..c6d6a0f2ba6 100644 --- a/Filtered_kernel/include/CGAL/Filtered_predicate.h +++ b/Filtered_kernel/include/CGAL/Filtered_predicate.h @@ -153,17 +153,17 @@ typename Filtered_predicate::result_type Filtered_predicate:: operator()(const Args&... args) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P; + Protect_FPU_rounding p; Ares res = ap(c2a(args)...); if (is_certain(res)) return get_certain(res); } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P(CGAL_FE_TONEAREST); + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); return ep(c2e(args)...); } @@ -175,17 +175,17 @@ typename Filtered_predicate::result_type Filtered_predicate:: operator()(const A1 &a1) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P; + Protect_FPU_rounding p; Ares res = ap(c2a(a1)); if (is_certain(res)) return get_certain(res); } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P(CGAL_FE_TONEAREST); + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); return ep(c2e(a1)); } @@ -195,17 +195,17 @@ typename Filtered_predicate::result_type Filtered_predicate:: operator()(const A1 &a1, const A2 &a2) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P; + Protect_FPU_rounding p; Ares res = ap(c2a(a1), c2a(a2)); if (is_certain(res)) return get_certain(res); } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("failures of : ")+ std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P(CGAL_FE_TONEAREST); + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); return ep(c2e(a1), c2e(a2)); } @@ -215,17 +215,17 @@ typename Filtered_predicate::result_type Filtered_predicate:: operator()(const A1 &a1, const A2 &a2, const A3 &a3) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P; + Protect_FPU_rounding p; Ares res = ap(c2a(a1), c2a(a2), c2a(a3)); if (is_certain(res)) return get_certain(res); } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P(CGAL_FE_TONEAREST); + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); return ep(c2e(a1), c2e(a2), c2e(a3)); } @@ -235,17 +235,17 @@ typename Filtered_predicate::result_type Filtered_predicate:: operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P; + Protect_FPU_rounding p; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4)); if (is_certain(res)) return get_certain(res); } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P(CGAL_FE_TONEAREST); + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4)); } @@ -256,17 +256,17 @@ Filtered_predicate:: operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P; + Protect_FPU_rounding p; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5)); if (is_certain(res)) return get_certain(res); } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P(CGAL_FE_TONEAREST); + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5)); } @@ -277,17 +277,17 @@ Filtered_predicate:: operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P; + Protect_FPU_rounding p; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6)); if (is_certain(res)) return get_certain(res); } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P(CGAL_FE_TONEAREST); + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5), c2e(a6)); } @@ -299,18 +299,18 @@ Filtered_predicate:: operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P; + Protect_FPU_rounding p; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6), c2a(a7)); if (is_certain(res)) return get_certain(res); } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P(CGAL_FE_TONEAREST); + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5), c2e(a6), c2e(a7)); } @@ -322,18 +322,18 @@ Filtered_predicate:: operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P; + Protect_FPU_rounding p; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6), c2a(a7), c2a(a8)); if (is_certain(res)) return get_certain(res); } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P(CGAL_FE_TONEAREST); + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5), c2e(a6), c2e(a7), c2e(a8)); } @@ -347,18 +347,18 @@ Filtered_predicate:: const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P; + Protect_FPU_rounding p; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6), c2a(a7), c2a(a8), c2a(a9)); if (is_certain(res)) return get_certain(res); } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P(CGAL_FE_TONEAREST); + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5), c2e(a6), c2e(a7), c2e(a8), c2e(a9)); } @@ -372,18 +372,18 @@ Filtered_predicate:: const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9, const A10 &a10) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P; + Protect_FPU_rounding p; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6), c2a(a7), c2a(a8), c2a(a9), c2a(a10)); if (is_certain(res)) return get_certain(res); } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); - Protect_FPU_rounding P(CGAL_FE_TONEAREST); + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5), c2e(a6), c2e(a7), c2e(a8), c2e(a9), c2e(a10)); } diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index 6517d32a04f..74929280310 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -1181,12 +1181,12 @@ struct Lazy_construction_bbox template result_type operator()(const L1& l1) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return ac(CGAL::approx(l1)); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return ec(CGAL::exact(l1)); } @@ -1211,12 +1211,12 @@ struct Lazy_construction_nt { template result_type operator()(const L1& l1) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return new Lazy_rep_1, L1>(ac, ec, l1); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return new Lazy_rep_0 >(ec(CGAL::exact(l1))); } @@ -1225,12 +1225,12 @@ struct Lazy_construction_nt { template result_type operator()(const L1& l1, const L2& l2) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return new Lazy_rep_2, L1,L2>(ac, ec, l1,l2); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return new Lazy_rep_0 >(ec(CGAL::exact(l1), CGAL::exact(l2))); } @@ -1239,12 +1239,12 @@ struct Lazy_construction_nt { template result_type operator()(const L1& l1, const L2& l2, const L3& l3) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return new Lazy_rep_3, L1,L2,L3>(ac, ec, l1,l2,l3); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return new Lazy_rep_0 >(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3))); } @@ -1253,12 +1253,12 @@ struct Lazy_construction_nt { template result_type operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return new Lazy_rep_4, L1,L2,L3,L4>(ac, ec, l1,l2,l3,l4); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return new Lazy_rep_0 >(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4))); } @@ -1267,12 +1267,12 @@ struct Lazy_construction_nt { template result_type operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4, const L5& l5) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return new Lazy_rep_5, L1,L2,L3,L4,L5>(ac, ec, l1,l2,l3,l4,l5); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return new Lazy_rep_0 >(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4), CGAL::exact(l5))); } @@ -1425,13 +1425,13 @@ public: void operator()(const L1& l1, const L2& l2, R1& r1) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; // we suppose that R1 is a Lazy r1 = R1(new Lazy_rep_2_1(ac, ec, l1, l2)); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); typename R1::ET et; ec(CGAL::exact(l1), CGAL::exact(l2), et); @@ -1490,8 +1490,8 @@ public: void operator()(const L1& l1, const L2& l2, R1& r1, R2& r2) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; typedef Lazy, std::pair, EFT, E2A> Lazy_pair; Lazy_pair lv(new Lazy_rep_2_2(ac, ec, l1, l2)); @@ -1499,7 +1499,7 @@ public: r1 = R1(new Lazy_rep_1 >, First >, E2A, Lazy_pair>(First >(), First >(), lv)); r2 = R2(new Lazy_rep_1 >, Second >, E2A, Lazy_pair>(Second >(), Second >(), lv)); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); typename R1::ET et1, et2; ec(CGAL::exact(l1), CGAL::exact(l2), et1, et2); @@ -1535,8 +1535,8 @@ public: OutputIterator operator()(const L1& l1, const L2& l2, OutputIterator it) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Lazy_vector lv(new Lazy_rep_with_vector_2(ac, ec, l1, l2)); // lv.approx() is a std::vector @@ -1556,7 +1556,7 @@ public: } } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); // TODO: Instead of using a vector, write an iterator adapter Protect_FPU_rounding P(CGAL_FE_TONEAREST); std::vector exact_objects; @@ -1614,8 +1614,8 @@ public: result_type operator()(const L1& l1) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Lazy_object lo(new Lazy_rep_1(ac, ec, l1)); @@ -1635,7 +1635,7 @@ public: std::cerr << "dynamic type of the Object : " << lo.approx().type().name() << std::endl; } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); ET eto = ec(CGAL::exact(l1)); return make_lazy(eto); @@ -1647,8 +1647,8 @@ public: result_type operator()(const L1& l1, const L2& l2) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Lazy_object lo(new Lazy_rep_2(ac, ec, l1, l2)); @@ -1668,7 +1668,7 @@ public: std::cerr << "dynamic type of the Object : " << lo.approx().type().name() << std::endl; } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); ET eto = ec(CGAL::exact(l1), CGAL::exact(l2)); return make_lazy(eto); @@ -1712,12 +1712,12 @@ public: result_type operator()(const L1& l1) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return Handle(new Lazy_rep_1(ac, ec, l1)); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return Handle(new Lazy_rep_0(ec(CGAL::exact(l1)))); } @@ -1727,12 +1727,12 @@ public: result_type operator()(const L1& l1, const L2& l2) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return Handle(new Lazy_rep_2(ac, ec, l1, l2)); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2)))); } @@ -1742,12 +1742,12 @@ public: result_type operator()(const L1& l1, const L2& l2, const L3& l3) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return Handle(new Lazy_rep_3(ac, ec, l1, l2, l3)); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3)))); } @@ -1757,12 +1757,12 @@ public: result_type operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return Handle(new Lazy_rep_4(ac, ec, l1, l2, l3, l4)); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4)))); } @@ -1772,12 +1772,12 @@ public: result_type operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4, const L5& l5) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return Handle(new Lazy_rep_5(ac, ec, l1, l2, l3, l4, l5)); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4), CGAL::exact(l5)))); } @@ -1787,12 +1787,12 @@ public: result_type operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4, const L5& l5, const L6& l6) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return Handle(new Lazy_rep_6(ac, ec, l1, l2, l3, l4, l5, l6)); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4), CGAL::exact(l5), CGAL::exact(l6)))); } @@ -1802,12 +1802,12 @@ public: result_type operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4, const L5& l5, const L6& l6, const L7& l7) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return Handle(new Lazy_rep_7(ac, ec, l1, l2, l3, l4, l5, l6, l7)); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4), CGAL::exact(l5), CGAL::exact(l6), CGAL::exact(l7)))); } @@ -1817,12 +1817,12 @@ public: result_type operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4, const L5& l5, const L6& l6, const L7& l7, const L8& l8) const { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; return Handle(new Lazy_rep_8(ac, ec, l1, l2, l3, l4, l5, l6, l7, l8)); } catch (Uncertain_conversion_exception) { - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4), CGAL::exact(l5), CGAL::exact(l6), CGAL::exact(l7), CGAL::exact(l8)))); } diff --git a/Number_types/include/CGAL/Lazy_exact_nt.h b/Number_types/include/CGAL/Lazy_exact_nt.h index bbad6bc9f0a..35ece0937a9 100644 --- a/Number_types/include/CGAL/Lazy_exact_nt.h +++ b/Number_types/include/CGAL/Lazy_exact_nt.h @@ -468,13 +468,13 @@ template bool operator<(const Lazy_exact_nt& a, const Lazy_exact_nt& b) { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); if (a.identical(b)) return false; Uncertain res = a.approx() < b.approx(); if (is_certain(res)) return get_certain(res); - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); return a.exact() < b.exact(); } @@ -482,13 +482,13 @@ template bool operator==(const Lazy_exact_nt& a, const Lazy_exact_nt& b) { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); if (a.identical(b)) return true; Uncertain res = a.approx() == b.approx(); if (is_certain(res)) return get_certain(res); - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); return a.exact() == b.exact(); } @@ -534,11 +534,11 @@ template bool operator<(const Lazy_exact_nt& a, int b) { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); Uncertain res = a.approx() < b; if (is_certain(res)) return res; - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); return a.exact() < b; } @@ -546,11 +546,11 @@ template bool operator>(const Lazy_exact_nt& a, int b) { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); Uncertain res = b < a.approx(); if (is_certain(res)) return get_certain(res); - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); return b < a.exact(); } @@ -558,11 +558,11 @@ template bool operator==(const Lazy_exact_nt& a, int b) { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); Uncertain res = b == a.approx(); if (is_certain(res)) return get_certain(res); - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); return b == a.exact(); } @@ -572,11 +572,11 @@ template bool operator<(const Lazy_exact_nt& a, double b) { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); Uncertain res = a.approx() < b; if (is_certain(res)) return res; - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); return a.exact() < b; } @@ -584,11 +584,11 @@ template bool operator>(const Lazy_exact_nt& a, double b) { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); Uncertain res = b < a.approx(); if (is_certain(res)) return res; - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); return b < a.exact(); } @@ -596,11 +596,11 @@ template bool operator==(const Lazy_exact_nt& a, double b) { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); Uncertain res = b == a.approx(); if (is_certain(res)) return res; - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); return b == a.exact(); } @@ -992,11 +992,11 @@ template < typename ET > class Real_embeddable_traits< Lazy_exact_nt > : public std::unary_function< Type, ::CGAL::Sign > { public: ::CGAL::Sign operator()( const Type& a ) const { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); Uncertain< ::CGAL::Sign> res = CGAL_NTS sign(a.approx()); if (is_certain(res)) return get_certain(res); - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); return CGAL_NTS sign(a.exact()); } }; @@ -1007,13 +1007,13 @@ template < typename ET > class Real_embeddable_traits< Lazy_exact_nt > public: Comparison_result operator()( const Type& a, const Type& b ) const { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); if (a.identical(b)) return EQUAL; Uncertain res = CGAL_NTS compare(a.approx(), b.approx()); if (is_certain(res)) return get_certain(res); - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); return CGAL_NTS compare(a.exact(), b.exact()); } @@ -1026,7 +1026,7 @@ template < typename ET > class Real_embeddable_traits< Lazy_exact_nt > : public std::unary_function< Type, double > { public: double operator()( const Type& a ) const { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); const Interval_nt& app = a.approx(); double r; @@ -1038,7 +1038,7 @@ template < typename ET > class Real_embeddable_traits< Lazy_exact_nt > Lazy_exact_nt::get_relative_precision_of_to_double())) return CGAL_NTS to_double(app); - CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); // Otherwise we trigger exact computation first, // which will refine the approximation. diff --git a/Profiling_tools/include/CGAL/Profile_counter.h b/Profiling_tools/include/CGAL/Profile_counter.h index 6bf23fef25f..6b42042f9ec 100644 --- a/Profiling_tools/include/CGAL/Profile_counter.h +++ b/Profiling_tools/include/CGAL/Profile_counter.h @@ -1,4 +1,4 @@ -// Copyright (c) 2005,2006 INRIA Sophia-Antipolis (France). +// Copyright (c) 2005,2006,2008 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -14,20 +14,28 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Sylvain Pion #ifndef CGAL_PROFILE_COUNTER_H #define CGAL_PROFILE_COUNTER_H -// This file contains the class Profile_counter which is able to keep track -// of a number, and prints a message in the destructor. -// Typically, it can be used as a profile counter in a static variable. +// This file contains 3 classes to help in profiling, together with macros +// triggered by CGAL_PROFILE to enable them: +// +// - Profile_counter which is able to keep track of a number, and prints a +// message in the destructor. Typically, it can be used as a profile counter +// in a static variable. +// +// - Profile_histogram_counter which is similar, but the counter is indexed by +// a value (unsigned int), and the final dump is the histogram of the non-zero +// counters. +// +// - Profile_branch_counter which keeps track of 2 counters, aiming at measuring +// the ratio corresponding to the number of times a branch is taken. -// It also provides the class Profile_histogram_counter which is similar, -// but the counter is indexed by a value (unsigned int), and the final dump -// is the histogram of the non-zero counters. [TODO : to be documented] +// TODO : complete the documentation. #include #include @@ -86,14 +94,43 @@ private: const std::string s; }; + +struct Profile_branch_counter +{ + Profile_branch_counter(const std::string & ss) + : i(0), j(0), s(ss) {} + + void operator++() { ++i; } + + void increment_branch() { ++j; } + + ~Profile_branch_counter() + { + std::cerr << "[CGAL::Profile_branch_counter] " + << std::setw(10) << j << " / " + << std::setw(10) << i << " " << s << std::endl; + } + +private: + unsigned int i, j; + const std::string s; +}; + + #ifdef CGAL_PROFILE # define CGAL_PROFILER(Y) \ - { static CGAL::Profile_counter tmp(Y); ++tmp; } -# define CGAL_HISTOGRAM_PROFILER(Y,Z) \ - { static CGAL::Profile_histogram_counter tmp(Y); tmp(Z); } + { static CGAL::Profile_counter tmp(Y); ++tmp; } +# define CGAL_HISTOGRAM_PROFILER(Y, Z) \ + { static CGAL::Profile_histogram_counter tmp(Y); tmp(Z); } +# define CGAL_BRANCH_PROFILER(Y, NAME) \ + static CGAL::Profile_branch_counter NAME(Y); ++NAME; +# define CGAL_BRANCH_PROFILER_BRANCH(NAME) \ + NAME.increment_branch(); #else # define CGAL_PROFILER(Y) -# define CGAL_HISTOGRAM_PROFILER(Y,Z) +# define CGAL_HISTOGRAM_PROFILER(Y, Z) +# define CGAL_BRANCH_PROFILER(Y, NAME) +# define CGAL_BRANCH_PROFILER_BRANCH(NAME) #endif CGAL_END_NAMESPACE diff --git a/Skin_surface_3/include/CGAL/Skin_surface_base_3.h b/Skin_surface_3/include/CGAL/Skin_surface_base_3.h index c5fc3d83afb..3012f091722 100644 --- a/Skin_surface_3/include/CGAL/Skin_surface_base_3.h +++ b/Skin_surface_3/include/CGAL/Skin_surface_base_3.h @@ -294,18 +294,16 @@ sign(TMC_Vertex_handle vit) const { CGAL_assertion(!_tmc.is_infinite(ch)); // don't use sign, since the point is constructed: + CGAL_BRANCH_PROFILER(std::string(" NGHK: failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("NGHK: calls to : ") + - std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Sign result = vit->cell()->info().second->sign(vit->point()); if (is_certain(result)) return result; } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("NGHK: failures of : ") + - std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); typedef Exact_predicates_exact_constructions_kernel EK; Skin_surface_traits_3 exact_traits(shrink_factor()); @@ -332,18 +330,16 @@ template Sign Skin_surface_base_3:: sign(const Bare_point &p, const Cell_info &info) const { + CGAL_BRANCH_PROFILER(std::string(" NGHK: failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("NGHK: calls to : ") + - std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Sign result = sign_inexact(p,info); if (is_certain(result)) return result; } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("NGHK: failures of : ") + - std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return construct_surface (info.first, @@ -624,10 +620,9 @@ compare(Cell_info &info1, const Bare_point &p1, Cell_info &info2, const Bare_point &p2) const { + CGAL_BRANCH_PROFILER(std::string(" NGHK: failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); try { - CGAL_PROFILER(std::string("NGHK: calls to : ") + - std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Sign result = CGAL_NTS sign(info1.second->value(p1) - info2.second->value(p2)); @@ -635,8 +630,7 @@ compare(Cell_info &info1, return result; } catch (Uncertain_conversion_exception) {} - CGAL_PROFILER(std::string("NGHK: failures of : ") + - std::string(CGAL_PRETTY_FUNCTION)); + CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P(CGAL_FE_TONEAREST); return CGAL_NTS sign(