Skip to content

Commit

Permalink
Fix vectortype for SMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Sep 22, 2020
1 parent 6085cf8 commit 5369753
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Polyhedra.jl
Expand Up @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions test/representation.jl
Expand Up @@ -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])]
Expand Down

0 comments on commit 5369753

Please sign in to comment.