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

Quick hull #1539

Merged
merged 82 commits into from
Apr 27, 2021
Merged

Quick hull #1539

merged 82 commits into from
Apr 27, 2021

Conversation

JacquesOlivierLachaud
Copy link
Member

@JacquesOlivierLachaud JacquesOlivierLachaud commented Jan 3, 2021

PR Description

This Pull Request provides an implementation of the Quick Hull convex hull algorithm. It works in arbitrary dimension. It provides several kernels to deal with lattice or rational points, and also to compute the Delaunay cell complex.

Checklist

  • Unit-test of your feature with Catch.
  • Doxygen documentation of the code completed (classes, methods, types, members...)
  • Documentation module page added or updated.
  • New entry in the ChangeLog.md added.
  • No warning raised in Debug cmake mode (otherwise, Travis C.I. will fail).
  • All continuous integration tests pass (Travis & appveyor)

@JacquesOlivierLachaud
Copy link
Member Author

All done !

// }

// #ifdef WITH_BIGINTEGER
// /// @param i any integer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this code is commented? not working?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry I have to clean this part. I moved it into kernel

/// Allows seamless conversion of integral types and lattice
/// points, while checking for errors when going from a more
/// precise to a less precise type.
///
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all this, why not relying on NumericalTraits?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is introducing duplicate codes/features

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because they are not sufficient for this purpose.
In fact gmp cannot initialize a big int from an int64 variable (but can from a const expression).
Conversely, gmp can do some conversion with long (which may or may not be 64 bits), but not on long long.
Finally, I wish to print warnings when bad conversions occur.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove the NumberTraits converter and use this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we have to make more checks before doing that. Anyway the numbertraits converter just converts to int64. I was afraid that it was incorrect for BigInteger but it was working on my mac (where long is also 64 bits). So perhaps it is no harm keeping it. Otherwise, a cleaner IntegerConverter would have a "status", instead of displaying warnings. We can perhaps make an issue and I do a small PR afterwards to do that. What do you think ? Among other limitations, I only treat the signed case, and I do not care about small integers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know.. I am afraid that having converters at several location could be a problem (like the dozen of functors/classes to threshold an image). For me, NumberTraits is a good place to contain such helpers/converters. Let me check again the converters you have here...

Copy link
Member

@dcoeurjo dcoeurjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to follow, github has lot the "edits after the last review"

/// Allows seamless conversion of integral types and lattice
/// points, while checking for errors when going from a more
/// precise to a less precise type.
///
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is introducing duplicate codes/features

@dcoeurjo
Copy link
Member

I'd need to clone locally. Is the new version working on big integers without floating point computations?

@JacquesOlivierLachaud
Copy link
Member Author

The new version normally works with int32, int64, BigInteger (coordinate or internal integers).
In checkLatticeBallQuickHull, I tested from 2D to 6D, pairs int64/int64, int64/BigInteger, BigInteger/BigInteger

@JacquesOlivierLachaud
Copy link
Member Author

Should be ok now ;-)

@dcoeurjo
Copy link
Member

Thx!

@dcoeurjo dcoeurjo merged commit 60c0074 into DGtal-team:master Apr 27, 2021
@dcoeurjo
Copy link
Member

🎉🎉🎉

@dcoeurjo
Copy link
Member

I think we are good for the release (plenty of new stuff + python)

@JacquesOlivierLachaud
Copy link
Member Author

Yes. DGtal is very alive !

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.

3 participants