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

Make HPolygonOpt a subtype of HPolygon #20

Closed
schillic opened this issue Nov 1, 2017 · 4 comments
Closed

Make HPolygonOpt a subtype of HPolygon #20

schillic opened this issue Nov 1, 2017 · 4 comments
Assignees
Labels
invalid 🚫 This doesn't seem right simplification 👶 Simplifies code

Comments

@schillic
Copy link
Member

schillic commented Nov 1, 2017

The only type union not affected by #19 exists in Polgyon.jl to handle HPolygons and HPolygonOpts simultaneously.

We should probably just make HPolygonOpt inherit from HPolygon.
This makes sense both from the code and from the conceptual side to me.
I am, however, not sure if Julia finds the correct function if one argument is an array of a subtype; I guess it does, but this has to be tested.

@mforets: What do you think?

@schillic schillic added discussion 🗣️ Requires human input simplification 👶 Simplifies code labels Nov 1, 2017
@schillic schillic self-assigned this Nov 1, 2017
@schillic schillic removed their assignment Nov 8, 2017
@mforets
Copy link
Member

mforets commented Nov 9, 2017

hmm.. i dunno... otherwise we can group them all into a newabstract type LazyPolygon <: LazySet end in the sense that HPolygon <: LazyPolygon, VPolygon <: LazyPolygon and HPolygonOpt <: LazyPolygon.

@schillic
Copy link
Member Author

schillic commented Nov 9, 2017

My motivation was that all functions that handle HPolygon can automatically handle HPolygonOpt.
There is no structural difference.

This is not true for VPolygon.

@mforets
Copy link
Member

mforets commented Nov 9, 2017

that makes sense. ok, then let me do that. today i'll be working on this one and on #13. (i'll put in the same PR).

@schillic schillic removed the discussion 🗣️ Requires human input label Nov 9, 2017
@schillic
Copy link
Member Author

schillic commented Nov 9, 2017

Sorry, subtyping is not allowed in Julia (source).

@mforets mforets closed this as completed Nov 9, 2017
@schillic schillic added the invalid 🚫 This doesn't seem right label Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid 🚫 This doesn't seem right simplification 👶 Simplifies code
Projects
None yet
Development

No branches or pull requests

2 participants