-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Epick_d and Has_filtered_predicates_tag #8256
Comments
We can probably do something, but can you explain what you are trying to achieve there (otherwise I may answer the wrong question)? |
The input points are transformed in points with interval arithmetic. In case of an uncertain exception we create a |
Would the following patch be acceptable? diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_filter_K.h b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_filter_K.h
index ef44403f9f5..bc7d88deefa 100644
--- a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_filter_K.h
+++ b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_filter_K.h
@@ -58,11 +58,15 @@ struct Cartesian_filter_K : public Base_
typedef Base_ Kernel_base;
typedef AK_ AK;
typedef EK_ EK;
+ typedef EK Exact_kernel;
typedef typename Store_kernel<AK_>::reference_type AK_rt;
AK_rt approximate_kernel()const{return sak.kernel();}
typedef typename Store_kernel<EK_>::reference_type EK_rt;
EK_rt exact_kernel()const{return sek.kernel();}
+ enum { Has_filtered_predicates = true };
+ typedef Boolean_tag<Has_filtered_predicates> Has_filtered_predicates_tag;
+
// MSVC is too dumb to perform the empty base optimization.
typedef std::bool_constant<
internal::Do_not_store_kernel<Kernel_base>::value && |
Plus the following: diff --git a/NewKernel_d/test/NewKernel_d/Epick_d.cpp b/NewKernel_d/test/NewKernel_d/Epick_d.cpp
index 5693977869a..61fed477750 100644
--- a/NewKernel_d/test/NewKernel_d/Epick_d.cpp
+++ b/NewKernel_d/test/NewKernel_d/Epick_d.cpp
@@ -751,6 +751,9 @@ int main(){
test2<Ker2>(); test2i<Ker2>();
test3<Ker3>();
test3<Kerd>();
+ static_assert(Ker2::Has_filtered_predicates_tag::value);
+ static_assert(Ker3::Has_filtered_predicates_tag::value);
+ static_assert(Kerd::Has_filtered_predicates_tag::value); |
Yes, but
The explanation was not super clear, it sounds vaguely like a |
I won't make a dedicated pull request, but it will go in PR #8284 |
Right. We will do that. But... to be honest, I have not the impression that the patch will decrease the readability of the code! 😃 cgal/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_filter_K.h Lines 43 to 98 in 1b534cd
In my editor (VS Code), the TODO and FIXME are highlighted, there are.. a lot! (click to see more...)... and there are also several typedefs that are unused, and could now be replaced by
Yes, probably. I will review Andreas's patch, once it is done.
I am not completely sure. Andreas will test in #8284.
That is probably to construct kind of "filtered constructions", where the constructed objects are sometimes reconstructed using an exact kernel, if needed. I do not know the details. See this example of a valid usage: cgal/Skin_surface_3/include/CGAL/Skin_surface_traits_3.h Lines 148 to 181 in 1b534cd
|
If we want the probability of a cleanup to be non-zero, we should
(I completely agree the code is not pretty)
Comments (whether they are marked TODO/FIXME or not) are a completely different thing. They usually contain important information. And yes, there are a lot of things that I never did because they were not priorities.
I had an Epack_d branch (it should still exist) to do filtered constructions in dD, but it didn't offer the option for each functor to use a different exact type (rational, sqrt-extension, etc).
It looks like it would have been much simpler to add Side_of_mixed_cell_3 to the kernel. |
In fact I also need a function object for constructing the filtered type and the exact type, In |
You are right. And the comments are indeed very important for that (both TODO/FIXME and notes about why something has been added).
I was not able to retrieve the branch? Do you still have it? What is its name? |
https://github.com/mglisse/cgal/tree/NewKernel_d-Epack-glisse |
There are typedefs C2A and C2E in Cartesian_filter_K. Kernels were designed for a separation of concerns between algorithms and predicates/constructions. Handling filtering by hand for a specific algorithm may indeed be more efficient, but it is bound to be a bit awkward. |
Issue Details
The upcoming Frechet distance package works in any dimension. Here we want to obtain
K::Has_filtered_predicates_tag::value
for the kernel, and we then want to accessK::Exact_kernel
.@mglisse Can this be added to
Epick_d
without breaking its design?The text was updated successfully, but these errors were encountered: