]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/cone/decomposition.py: combine two tests master codeberg/master
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 11 Jun 2026 19:09:25 +0000 (15:09 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 11 Jun 2026 19:12:35 +0000 (15:12 -0400)
The fact that the generators of the lineality space are orthogonal is
now tested in the Sage library -- we don't need to repeat it. To save
time, move two checks for the nonlineal part being pointed into an
earlier example.

mjo/cone/decomposition.py

index ff803029b3be186670cc5e6b1afa02e60df54173..2eacc7b3dd665723fbe4cefddc51801bfaa4fee4 100644 (file)
@@ -145,17 +145,22 @@ def nonlineal_part(K, orthogonal=False):
 
     Verify that the sum of the lineality space and the nonlineal part
     is the original cone for both values of ``orthogonal``. When
-    ``orthogonal`` is ``True``, we verify that orthogonality::
+    ``orthogonal`` is ``True``, we verify that orthogonality. In both
+    cases, we erify that the nonlineal part is pointed::
 
         sage: K = random_cone(strictly_convex=False)
         sage: lat = K.lattice()
         sage: V = lat.vector_space()
         sage: linspace_rays = [ c*l for l in K.lines() for c in [-1,1] ]
         sage: P = nonlineal_part(K)
+        sage: P.is_strictly_convex()
+        True
         sage: J = Cone(list(P.rays()) + linspace_rays, lattice=lat)
         sage: J.is_equivalent(K)
         True
         sage: P = nonlineal_part(K, orthogonal=True)
+        sage: P.is_strictly_convex()
+        True
         sage: all( V(p).inner_product(V(l)).is_zero()
         ....:      for p in P
         ....:      for l in K.lines())
@@ -172,25 +177,6 @@ def nonlineal_part(K, orthogonal=False):
         sage: nonlineal_part(K, orthogonal=False) is K
         True
 
-    Verify the assumption that :meth:`lines` is always orthogonal,
-    and check that the nonlineal part is pointed while we're at it::
-
-        sage: K = random_cone(strictly_convex=False)
-        sage: nonlineal_part(K).is_strictly_convex()
-        True
-        sage: nonlineal_part(K, orthogonal=True).is_strictly_convex()
-        True
-        sage: V = K.lattice().vector_space()
-        sage: L = [V(l) for l in K.lines()]
-        sage: d = len(L)
-        sage: d > 0
-        True
-        sage: all( L[i].inner_product(L[j]).is_zero()
-        ....:      for i in range(d)
-        ....:      for j in range(d)
-        ....:      if i != j )
-        True
-
     An example where the sum is not direct. The idea is that
     ``[l1,l2]`` and ``[h1,h2,h3,h4]`` begin as orthogonal generating
     sets for the lineality space and pointed component of a cone