Skip to content

Commit

Permalink
added hash method for RayVector; fixed wrong test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexej-jordan committed Nov 27, 2024
1 parent 4d753d8 commit 7e21a09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/PolyhedralGeometry/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ Base.:(==)(::PointVector, ::RayVector) =
Base.:(==)(::RayVector, ::PointVector) =
throw(ArgumentError("Cannot compare PointVector to RayVector"))

Base.hash(x::RayVector, h::UInt) = hash(collect(sign.(x)), hash(coefficient_field(x), h))

################################################################################
######## Halfspaces and Hyperplanes
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion test/PolyhedralGeometry/cone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
if T == QQFieldElem
@test hilbert_basis(Cone1) isa SubObjectIterator{PointVector{ZZRingElem}}
@test length(hilbert_basis(Cone1)) == 2
@test issetequal(hilbert_basis(Cone1), ray_vector.(Ref(ZZ), [[1, 0], [0, 1]]))
@test issetequal(hilbert_basis(Cone1), point_vector.(Ref(ZZ), [[1, 0], [0, 1]]))
@test generator_matrix(hilbert_basis(Cone1)) == _oscar_matrix_from_property(ZZ, hilbert_basis(Cone1))
end
@test n_rays(Cone1) == 2
Expand Down

0 comments on commit 7e21a09

Please sign in to comment.