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

Kernel_23: Add NonZeroDimension_3 #6102

Merged
merged 11 commits into from
Nov 18, 2021

Conversation

afabri
Copy link
Member

@afabri afabri commented Oct 31, 2021

Summary of Changes

Add a function object to the concept Kernel that enables to find any dimension of a 3D vector that is different from zero.

  • Document the model

Release Management

  • Affected package(s): Kernel_23
  • Feature/Small Feature (if any): link
  • Link to compiled documentation: link
  • License and copyright ownership: not changed

@afabri
Copy link
Member Author

afabri commented Oct 31, 2021

/build:v1

@github-actions
Copy link

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/6102/v1/Manual/index.html

@afabri
Copy link
Member Author

afabri commented Oct 31, 2021

@sloriot why is the added concept not on this page?

Co-authored-by: Sebastien Loriot <sloriot.ml@gmail.com>
@afabri
Copy link
Member Author

afabri commented Nov 1, 2021

/build:v2

@github-actions
Copy link

github-actions bot commented Nov 1, 2021

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/6102/v2/Manual/index.html

@afabri
Copy link
Member Author

afabri commented Nov 1, 2021

/build:v3

@github-actions
Copy link

github-actions bot commented Nov 1, 2021

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/6102/v3/Manual/index.html

@afabri afabri added this to the 5.4-beta milestone Nov 1, 2021
@afabri afabri added the Doc bug label Nov 1, 2021
@MaelRL MaelRL added the Not yet approved The feature or pull-request has not yet been approved. label Nov 2, 2021
@MaelRL
Copy link
Member

MaelRL commented Nov 2, 2021

Shouldn't this be called Non_zero_coordinate_3 rather? Using "dimension" is abusing nomenclature, and it's confusing given that there exists Vector_3::dimension() = 3

@lrineau
Copy link
Member

lrineau commented Nov 2, 2021

Shouldn't this be called Non_zero_coordinate_3 rather? Using "dimension" is abusing nomenclature, and it's confusing given that there exists Vector_3::dimension() = 3

I agree. Here the input of the functor is a Vector_3, and Non_zero_coordinate_3 seems a better naming.

I would understand "non zero dimension" if the input was something like a Bbox_3.

@afabri
Copy link
Member Author

afabri commented Nov 2, 2021

Note that it does not return a coordinate but the index of the dimension. Concerning the name I am wondering it it should be prefixed with Any_.

@afabri
Copy link
Member Author

afabri commented Nov 2, 2021

What about Any_non_zero_coordinate_index_3?

@sloriot
Copy link
Member

sloriot commented Nov 2, 2021

I don't like the any prefix.

@afabri
Copy link
Member Author

afabri commented Nov 2, 2021

So, do we converge to Non_zero_coordinate_index_3?

@sloriot
Copy link
Member

sloriot commented Nov 2, 2021

fine with me

@MaelRL MaelRL added the TODO label Nov 2, 2021
@lrineau
Copy link
Member

lrineau commented Nov 3, 2021

So, do we converge to Non_zero_coordinate_index_3?

It seems a good name.

@afabri
Copy link
Member Author

afabri commented Nov 3, 2021

/force-build:v3

afabri and others added 2 commits November 3, 2021 21:41
Co-authored-by: Mael <mael.rouxel.labbe@geometryfactory.com>
@afabri
Copy link
Member Author

afabri commented Nov 3, 2021

/force-build:v3

@afabri
Copy link
Member Author

afabri commented Nov 3, 2021

/force-build:v3

@github-actions
Copy link

github-actions bot commented Nov 3, 2021

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/6102/v3/Manual/index.html

1 similar comment
@github-actions
Copy link

github-actions bot commented Nov 3, 2021

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/6102/v3/Manual/index.html

@MaelRL MaelRL removed the TODO label Nov 4, 2021
@lrineau
Copy link
Member

lrineau commented Nov 4, 2021

Interdependently from its documentation, about the implementation of Non_zero_coordinate_index_3, should not it return the index of the axis for which the vector has the biggest absolute value? That could increase the performance of the code using that index.

Let's consider we have a set of 3D points that are almost vertical, in the XZ plane. The fitting plane of that point set would have the orthogonal vector v={small_x, big_y, small_z}, where small_x and small_z have small, but non-zero, absolute values. Then, with the current implementation, Non_zero_coordinate_index_3()(v) might return 0, because the value is small, but big enough that certainly_not(is_zero(v.x())) is true. In that case, the bounded_side_2 would be called with a projection on the YZ plane, where the point set is almost degenerated, instead of the plane XZ. If the implementation of Non_zero_coordinate_index_3 tries to return the index of the largest coordinate, it would be 1, instead of 0.

Also, as I said in a private conversion with Andreas, the code should use hx()/hy()/hz(), instead of x()/y()/z(), so that it is as efficient in the homogeneous case as in the cartesian case.

@afabri
Copy link
Member Author

afabri commented Nov 4, 2021

The main gain comes from the fact that we avoid filter failures. I won't explore searching for the biggest for now. I will do the hx() etc.

@lrineau
Copy link
Member

lrineau commented Nov 15, 2021

This small feature is not yet approved, and yet the release 5.4-beta1 was due two weeks ago. I think this small feature is really late, and should not go into CGAL-5.4.

In particular, this PR conflicts with the preparation of CHANGES.md: #6122.

@sloriot
Copy link
Member

sloriot commented Nov 17, 2021

Successfully tested in CGAL-5.4-Ic-95

@lrineau lrineau self-assigned this Nov 18, 2021
@lrineau lrineau removed the Not yet approved The feature or pull-request has not yet been approved. label Nov 18, 2021
@lrineau lrineau modified the milestones: 5.5-beta, 5.4-beta Nov 18, 2021
@lrineau lrineau merged commit df77708 into CGAL:master Nov 18, 2021
@lrineau lrineau deleted the Kernel_23-Non_zero_dimension_3-GF branch November 18, 2021 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants