#10046: Polyhedron's incidence_matrix performs poorly on some numerical input
------------------------+---------------------------------------------------
Reporter: mhampton | Owner: mhampton
Type: defect | Status: new
Priority: major | Milestone: sage-4.6.1
Component: geometry | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
The following 3D simplex shouldn't be all that challenging, but we don't
handle it well:
{{{
test = Polyhedron(vertices=[[0.8333333333, 0.8333333333, 0.8333333333],
[1.022799569, 0.6321252838, 0.0], [0.7354697967, 0.280924808,
0.4545456098], [1.348361678, 0.0, 0.5150289612]], field=RDF)
test.facial_incidences()
[[0, [0, 1, 3]], [1, [1, 2, 3]], [2, []], [3, [0, 1, 2]]]
}}}
The root of this seems to be in how the incidence_matrix is based on the
is_zero method:
{{{
H = list(test.Hrep_generator())[2]
print H
for V in test.Vrep_generator():
if test._is_zero(H*V):
test._incidence_matrix[V.index(),H.index()] = 1
else:
print H*V, ' for vertex ', V.vector()
An inequality (848702.5784, 1373226.161, -2221927.54) x + -1.0 >= 0
-0.000499999849126 for vertex (0.8333333333, 0.8333333333, 0.8333333333)
1736102.60814 for vertex (1.022799569, 0.6321252838, 0.0)
-0.000186597928405 for vertex (0.7354697967, 0.280924808, 0.4545456098)
-5.35207800567e-05 for vertex (1.348361678, 0.0, 0.5150289612)
}}}
and in the _init_field method of Polyhedron:
{{{
# 1e-6 is the cddf+ default fuzzy zero cutoff
self._is_zero = lambda x: abs(x)<=1e-6
}}}
I realize that there will always be some problems like this for numerical
(i.e. inexact) polyhedra, but it seems pretty sad that we can't handle a
nice, reasonably sized simplex in 3D. The only thing that immediately
occurs to me is to either change how the inequalities are scaled or do
something more complicated than the current _is_zero.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10046>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.