]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/cone/decomposition.py: add more nonlineal_part() tests
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 9 Feb 2026 01:03:25 +0000 (20:03 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 9 Feb 2026 01:03:25 +0000 (20:03 -0500)
mjo/cone/decomposition.py

index 714588c475f857479ab0ab852f790a19e74d00c2..209857417a3b1c1e6b5f667edbc6f46a1efdcaa3 100644 (file)
@@ -120,6 +120,29 @@ def nonlineal_part(K):
         sage: J.is_equivalent(K)
         True
 
+    The nonlineal part of a pointed cone is itself::
+
+        sage: K = random_cone(strictly_convex=True)
+        sage: nonlineal_part(K) 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: 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
+
     """
     # We need to compute inner products and doing it in the ambient
     # vector space (rather than in a more picky lattice) is the