Skip to content

PKG: Add convexhull computation package #1840

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

Merged
merged 2 commits into from
May 23, 2023

Conversation

ubaidsk
Copy link
Collaborator

@ubaidsk ubaidsk commented May 20, 2023

towards #992

@ubaidsk ubaidsk requested a review from certik May 20, 2023 13:51
@ubaidsk
Copy link
Collaborator Author

ubaidsk commented May 20, 2023

Ready.


n: i32 = len(points)
if n < 3:
return [(-1, -1)] # Convex hull not possible
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It seems that we do not support returning empty lists (#1841). Therefore, returning a list with single item with negative/invalid coordinates.

@@ -528,6 +528,7 @@ RUN(NAME test_package_01 LABELS cpython llvm)
RUN(NAME test_pkg_lpdraw LABELS cpython llvm wasm)
RUN(NAME test_pkg_lnn_01 LABELS cpython llvm)
RUN(NAME test_pkg_lnn_02 LABELS cpython llvm)
RUN(NAME test_pkg_lpconvexhull LABELS cpython c)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it work with llvm?

Copy link
Collaborator Author

@ubaidsk ubaidsk May 22, 2023

Choose a reason for hiding this comment

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

Does it work with llvm?

It does not work with LLVM yet. I will create an issue for it soon.

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

In that case I think this looks good. Let's merge the sync PR first .

@ubaidsk ubaidsk enabled auto-merge May 23, 2023 05:53
@ubaidsk ubaidsk merged commit cdbfddc into lcompilers:main May 23, 2023
@ubaidsk ubaidsk deleted the pkg_convexhull branch May 23, 2023 18:29
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

Successfully merging this pull request may close these issues.

3 participants