JuliaGeometry / GeometryTypes.jl

Geometry types for Julia
Other
67 stars 41 forks source link

Make vertices(::Simplex) return an SVector #184

Open CarpeNecopinum opened 4 years ago

CarpeNecopinum commented 4 years ago

As noted in #127, all other variants of vertices return something <: AbstractVector.

To avoid runtime overhead, this PR uses an SVector to conform to that interface. Additionally, a Simplex can now be constructed from an SVector, deleteat has been extended to support SVectors and a type instability that occurred when calling vertexmat with an SVector has been fixed.

CarpeNecopinum commented 4 years ago

Open for comments on e61718d. To pass the tests, I have to allow constructing a Simplex from a StaticVector of points if deleteat can return one. But Simplex already had a constructor taking a StaticVector, which however interpreted that vector as a single point. So I added a constructor that takes nested arrays and interprets them as an array of points again.