I found an example where PPL does not remove the lineal components of
the remaining generators. It is now included as a doctest.
to the lineality space and its orthogonal complement. This is a
direct sum decomposition of the original cone.
to the lineality space and its orthogonal complement. This is a
direct sum decomposition of the original cone.
- .. NOTE::
-
- I strongly believe that PPL does this anyway, since it claims to
- implement the double-description method from Fukuda and Prodon,
- and they mention this. If we're implementing an algorithm in Sage,
- it probably suffices to verify that the lineal subset (the
- generators that live in the cone's ``linear_subspace()`` is
- orthogonal to the remaining generators.
-
SETUP::
sage: from mjo.cone.decomposition import (
SETUP::
sage: from mjo.cone.decomposition import (
N(-1, 0, 0)
in 3-d lattice N
N(-1, 0, 0)
in 3-d lattice N
+ Here is an example where PPL does not do this implicitly::
+
+ sage: K = Cone([(-13, 3, 0, -1),
+ ....: (11, -1, -1, 0),
+ ....: (-11, 1, 1, 0)])
+ sage: K.lines()
+ N(11, -1, -1, 0)
+ in 4-d lattice N
+ sage: M = K.lattice().dual()
+ sage: K.ray(0)*M(K.lines()[0].dense_coefficient_list())
+ -146
+
+ But we get it right::
+
+ sage: P,L = pointed_linspace_decomposition(K)
+ sage: P.rays()
+ N(7, 223, -146, -123)
+ in 4-d lattice N
+ sage: L.rays()
+ N( 11, -1, -1, 0),
+ N(-11, 1, 1, 0)
+ in 4-d lattice N
+ sage: P.ray(0)*M(L.ray(0).dense_coefficient_list())
+ 0
+
TESTS::
sage: K = random_cone(strictly_convex=False)
TESTS::
sage: K = random_cone(strictly_convex=False)
sage: J = Cone(P.rays() + L.rays(), lattice=lat)
sage: J.is_equivalent(K)
True
sage: J = Cone(P.rays() + L.rays(), lattice=lat)
sage: J.is_equivalent(K)
True
"""
from sage.geometry.cone import Cone
"""
from sage.geometry.cone import Cone