CGAL/cgal

Epeck_d::Vector_d is missing `==` operator

Closed this issue · 3 comments

Issue Details

Actually it's missing the 6 operators ==, !=, <=, <', >=, >.
Disclaimer: The operators are not listed in the manual.
However, the operators are supported for Epick_d::Vector_d.
I would expect them to be supported and properly added to the manual.
Also, Point_d does support the == and != operators with both Epick_d and Epeck_d.

Source Code

#if 1
#include <CGAL/Epeck_d.h>
#else
#include <CGAL/Epick_d.h>
#endif
#include <CGAL/Kernel_d/Vector_d.h>

int main() {
  using Dimension_tag = CGAL::Dynamic_dimension_tag;
#if 1
  using Kernel_d = CGAL::Epeck_d<Dimension_tag>;
 #else
  using Kernel_d = CGAL::Epick_d<Dimension_tag>;
#endif
  using FT_d = Kernel_d::FT;
  using Point_d = Kernel_d::Point_d;
  using Segment_d = Kernel_d::Segment_d;
  using Vector_d = Kernel_d::Vector_d;
  Vector_d a, b;
  return (a == b);
}

Environment

  • Operating system (Windows/Mac/Linux, 32/64 bits):
  • Compiler:
  • Release or debug mode:
  • Specific flags used (if any):
  • CGAL version: latest
  • Boost version:
  • Other libraries versions if used (Eigen, TBB, etc.): Eigen

However, the operators are supported for Epick_d::Vector_d.

I wouldn't say "supported", they accidentally compile because I publicly derive from std::vector.

I would expect them to be supported and properly added to the manual.

Ok for == and !=, but what are <, <=, etc supposed to mean? Is that canonical enough to deserve an operator notation?

Also, Point_d does support the == and != operators with both Epick_d and Epeck_d.

Point_d has explicit code to handle that. It should be simple to do the same for Vector_d.