Open myirci opened 8 years ago
@MoniqueTeillaud as package maintainer, what do you think of these different suggestions?
@myirci commented on Jul 11, 2016, https://github.com/CGAL/cgal/issues/1261#issue-164889443:
Since a triangulation with dimension 1 has two finite vertices, it should be enough to compare the vertices of two triangulations for equality
A triangulation with dimension 1 can have more than two vertices: it can have two vertices or many more, as long as they are all colinear. But the rest of the sentence is true: it is sufficient to compare the set of points, because there is only one way to "triangulate" a set of colinear points, as far as I know.
I agree with Laurent.
About another comment:
A 3D triangulation with dimension 0 has a single finite vertex which has to be checked for the > equality of two triangulations.
Agreed, this is a bug. The case of dimension 0 should be treated as for dimension 1: compare the point(s).
(sorry for the previous version of my answer, which I erased. I had not read the comment correctly)
@MoniqueTeillaud, in https://github.com/CGAL/cgal/issues/1261#issuecomment-316949374:
A 3D triangulation with dimension 0 has a single finite vertex which has to be checked for the > equality of two triangulations.
The infinite vertex is just the infinite vertex. There is nothing to compare, the two triangulations have no finite vertex, they are equal.
No. A Triangulation_3
of dimension()==0
has exactly one finite vertex (plus the infinite vertex). An empty Triangulation_3
has dimension()==-1
.
That is said here in the manual, in the subsection Degenerate Dimensions.
(Laurent, I updated my comment, see its new version + the parenthesis...)
Hi all, I want to report a minor bug and propose minor improvements for the overloaded equality operator function ( Source File: "Triangulation_3.h", Function: operator==).
CGAL Version 4.8.1
1) The following line given below ( Source File: "Triangulation_3.h", Function: operator==)
should be changed with
A 3D triangulation with dimension 0 has a single finite vertex which has to be checked for the equality of two triangulations. For instance, the current operator== function returns true for the following two triangulations, which should return false.
Furhermore,
should be changed with
if (dim < 2) {
That is, the curly bracket should be for dim = 0 and dim = 1. Since a triangulation with dimension 1 has two finite vertices, it should be enough to compare the vertices of two triangulations for equality.
2) For an improvement, std::map data structure can be replaced with
3) The following lines are redundant for the function (test_next()) that is called form operator==.
Since initially infinite vertices are mapped to eachother and vn1 is queried in the map. Therefore, if vn2 is infinite, it is handled when vn1 is found in the map and these lines never runs.
Thank you.
Regards,
Murat Yirci