Skip to content

Commit

Permalink
Relax tolerance for detecting rays a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Nov 9, 2020
1 parent ce82216 commit bc22a53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function _row_is_point(row::Vector)
return false
elseif isone(row[1])
return true
elseif abs(row[1]) < 1e-9
elseif abs(row[1]) < 1e-7
# Close to zero so we will assume it is zero.
# See https://github.com/JuliaPolyhedra/CDDLib.jl/issues/38
return false
Expand Down
7 changes: 7 additions & 0 deletions test/polyhedral_function.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ using CDDLib
@test nrays(p) == 1
@test nlines(p) == 0
end
@testset "Another tricky one #38" begin
pf = HalfSpace([-1.0, 0.0, 0.0], 10.0) HalfSpace([1.0, 0.0, 0.0], -6.0) HalfSpace([0.0, -1.0, 0.0], 5.0) HalfSpace([0.0, 1.0, 0.0], 2.0) HalfSpace([0.0, 0.0, -1.0], -1.0) HalfSpace([-0.418649200578628, -0.4999999988700277, -1.0], 0.9397722384772047) HalfSpace([-0.4659572920302226, -0.4999999971144193, -1.0], 0.9837823697735852)
v = vrep(polyhedron(pf, CDDLib.Library()))
@test npoints(v) == 7
@test nrays(v) == 1
@test nlines(v) == 0
end

0 comments on commit bc22a53

Please sign in to comment.