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

Generalize vertices type in VPolytope #2004

Closed
mforets opened this issue Feb 26, 2020 · 5 comments · Fixed by #2012
Closed

Generalize vertices type in VPolytope #2004

mforets opened this issue Feb 26, 2020 · 5 comments · Fixed by #2012
Assignees

Comments

@mforets
Copy link
Member

mforets commented Feb 26, 2020

It should be:

struct VPolytope{N, VT<:AbstractVector{N}} <: AbstractPolytope{N}
    vertices::Vector{VT}
end
@mforets mforets self-assigned this Feb 26, 2020
@schillic
Copy link
Member

Why restricted it Vector? I would just add another type parameter there.

@mforets
Copy link
Member Author

mforets commented Feb 26, 2020

The vector of abstract vectors is general enough. This is the recommended memory layout for handling many static arrays (https://juliaarrays.github.io/StaticArrays.jl/latest/pages/api/#Arrays-of-static-arrays-1).

@schillic
Copy link
Member

StaticArrays is a good keyword. What about polygons with 5 vertices? This should be exploitable.

@mforets
Copy link
Member Author

mforets commented Feb 26, 2020

Of course, there can be applications that are better off with another outer array type, but none that i'm aware. We can always add a new type to handle further specializations.

@schillic
Copy link
Member

It does not hurt to add the type parameter now. It hurts to change it later again because that is always a breaking change.

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 a pull request may close this issue.

2 participants