]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/cone/decomposition.py: remove that NOTE master
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 3 Feb 2026 00:20:18 +0000 (19:20 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 3 Feb 2026 14:51:57 +0000 (09:51 -0500)
I found an example where PPL does not remove the lineal components of
the remaining generators. It is now included as a doctest.

mjo/cone/decomposition.py

index d581d83dc65db6f02b464d6f5ab85159d48e26e7..56005fca83827e7d4feae1106f44b595a475fb62 100644 (file)
@@ -89,15 +89,6 @@ def pointed_linspace_decomposition(K):
     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 (
@@ -137,6 +128,31 @@ def pointed_linspace_decomposition(K):
         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)
@@ -150,6 +166,7 @@ def pointed_linspace_decomposition(K):
         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