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

Delabella either hangs or generates incorrect outcomes for circular points on MacOS platform #15

Open
HaipengMao opened this issue Aug 1, 2023 · 0 comments

Comments

@HaipengMao
Copy link

The following code snippet shows how the input points are generated.

  int POINTS = 100;
  const double radius = 5;
  const double PI = 3.14159265358979323846;

  typedef double MyCoord;

  struct MyPoint {
    MyCoord x;
    MyCoord y;
    // ...
  };

  MyPoint* cloud = new MyPoint[POINTS];

  // gen some points on the circle
  for (int i = 0; i < POINTS; i++) {
    double angle = i * PI / 180.0;
    cloud[i].x = radius * cos(angle);
    cloud[i].y = radius * sin(angle);
  }
 

In case of POINTS = 5, it gives the wrong outcome. In case of POINTS = 100, it hangs.

I have found the root cause is due to unexpected #undef on Macro FP_FAST_FMAF, FP_FAST_FMA and FP_FAST_FMAL by random header file in delabella.cpp on MacOS platform. You may want to add the following #error statements before or after random header to verify the problem.

#ifndef FP_FAST_FMAF
#error  FP_FAST_FMAF should be defined for predicates.h
#endif

Though there is no error on Windows platform, it stops the compilation on MacOS platform if you place them after random header file. Therefore, one possible right solution is to move the following Macro definitions after random header file, e.g. right before delabella.h in delabella.cpp.

#undef FP_FAST_FMAF
#define FP_FAST_FMAF
#undef FP_FAST_FMA
#define FP_FAST_FMA
#undef FP_FAST_FMAL
#define FP_FAST_FMAL

May the author fix this problem?

Thanks,
Haipeng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant