]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/cone/decomposition.py: add orthogonalization example over ZZ
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 5 Feb 2026 23:44:23 +0000 (18:44 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 5 Feb 2026 23:44:23 +0000 (18:44 -0500)
mjo/cone/decomposition.py

index 56005fca83827e7d4feae1106f44b595a475fb62..33dcf5c878dd2129a58ba81a9c49f52a6e5b755c 100644 (file)
@@ -58,6 +58,21 @@ def _orthogonalize(S):
         [         0      14805          0]
         [         0          0 1349105625]
 
+    An example over the integers::
+
+        sage: V = ZZ^5
+        sage: v1 = V((0, -11, 5, -1, 1))
+        sage: v2 = V((-4, 1, -1, -12, -1))
+        sage: v3 = V((-2, 1, 1, 38, 1))
+        sage: v4 = V((-1, 0, -3, -1, 1))
+        sage: v5 = V((-2, 1, 0, 1, 2))
+        sage: O = _orthogonalize([v1,v2,v3,v4,v5])
+        sage: all( O[i].inner_product(O[j]).is_zero()
+        ....:      for i in range(len(O))
+        ....:      for j in range(len(O))
+        ....:      if not i == j )
+        True
+
     """
     if len(S) == 0:
         return S
@@ -204,6 +219,9 @@ def pointed_linspace_decomposition(K):
         p = _orthogonalize_wrt(r, L_ortho_basis)
         P_ortho_rays.append(p)
 
+    # Both generating sets should be minimal, but PPL may be able to
+    # rescale them (no guarantee we don't have a bunch of rays that
+    # can all be divided by two, for example).
     return (Cone(P_ortho_rays, lattice=lat),
             Cone(L_ortho_rays, lattice=lat))