Skip to content
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

EPECK defines Has_static_filters as "false" regardless of CGAL_NO_STATIC_FILTERS_FOR_LAZY_KERNEL #8671

Open
MaelRL opened this issue Dec 20, 2024 · 1 comment

Comments

@MaelRL
Copy link
Member

MaelRL commented Dec 20, 2024

Issue Details

https://github.com/CGAL/cgal/blob/master/Filtered_kernel/include/CGAL/Lazy_kernel.h#L130

This should be 'true' when CGAL_NO_STATIC_FILTERS_FOR_LAZY_KERNEL is not defined but the fix is more complicated than that: EPECK's static filtered predicates are defined as EPICK's if static filters are used:

#define CGAL_Kernel_pred(P, Pf)  \
  typedef Static_filtered_predicate<Approximate_kernel, Filtered_predicate<typename Exact_kernel::P, typename Approximate_kernel::P, C2E, C2F>, Exact_predicates_inexact_constructions_kernel::P> P; \
    P Pf() const { return P(); }

and

https://github.com/CGAL/cgal/blob/master/Filtered_kernel/include/CGAL/Static_filtered_predicate.h

However, a typical call in Static_filtered_predicate is as follows:

  template <typename A1>
  result_type operator()(const A1& a1) const
  {
    CGAL::Epic_converter<AK> convert;
    auto aa1 = convert(approx(a1));
    if(! aa1.second){
      return fp(a1);
    }

    return epicp(aa1.first);
  }

meaning, this assumes that the EPICK static filter and the EPECK filtered predicate have the same parameters, but this does not always stand because of for example https://github.com/CGAL/cgal/blob/master/AABB_tree/include/CGAL/AABB_traits_3.h#L407, which is a speed-up that passes a Boolean to the static filtered version of Do_intersect_3 (but the overload with a Boolean does not exist in the "standard version"), introduced in #5507.

This wasn't seen before because it was going into the branch "no static filters provided".

@MaelRL
Copy link
Member Author

MaelRL commented Dec 20, 2024

Before EPECK's static filters were defined as EPICK's, there was a "proper" implementation of EPECK with static filters (8eac6ca) which would not have had this issue, but this was reverted (for speed reasons?).

MaelRL added a commit to MaelRL/cgal that referenced this issue Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant