diff --git a/src/Polyhedra.jl b/src/Polyhedra.jl index a9329858..1248a26e 100644 --- a/src/Polyhedra.jl +++ b/src/Polyhedra.jl @@ -44,6 +44,7 @@ vectortype(p::Rep) = vectortype(typeof(p)) vectortype(::Type{<:AbstractSparseArray{T}}) where T = SparseVector{T, Int} vectortype(::Type{<:AbstractMatrix{T}}) where T = Vector{T} +vectortype(::Type{StaticArrays.SArray{Tuple{N, M}, T, 2, NM}}) where {N, M, T, NM} = StaticArrays.SVector{M, T} hmatrixtype(RepT::Type{<:HRep}, T::Type) = matrixtype(similar_type(hvectortype(RepT), T)) vmatrixtype(RepT::Type{<:VRep}, T::Type) = matrixtype(similar_type(vvectortype(RepT), T)) diff --git a/test/representation.jl b/test/representation.jl index ba46570f..c3b3e8cf 100644 --- a/test/representation.jl +++ b/test/representation.jl @@ -89,8 +89,10 @@ end #htest((@inferred hrep(shps, shss)), SVector{3, Float64}) htest(hrep(shps, shss), SVector{3, Float64}) htest(hrep([1 2 3; 4 5 6], [7., 8], BitSet([1])), Vector{Float64}) + htest(hrep(@SMatrix([1 2 3; 4 5 6]), @SVector([7., 8]), BitSet([1])), SVector{3, Float64}) htest(hrep(spzeros(2, 3), [7., 8], BitSet([1])), SparseVector{Float64, Int}) htest(hrep([1 2 3; 4 5 6], [7., 8]), Vector{Float64}) + htest(hrep(@SMatrix([1 2 3; 4 5 6]), @SVector([7., 8])), SVector{3, Float64}) ps = [[1, 2], [3, 4]] sps = [(@SVector [1, 2]), (@SVector [3, 4])] rs = [Ray([0, 1])]