From: Michael Orlitzky Date: Thu, 5 Feb 2026 23:44:23 +0000 (-0500) Subject: mjo/cone/decomposition.py: add orthogonalization example over ZZ X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=0e64575e488de9cb18a31f8d17f03c8264c1a37d;p=sage.d.git mjo/cone/decomposition.py: add orthogonalization example over ZZ --- diff --git a/mjo/cone/decomposition.py b/mjo/cone/decomposition.py index 56005fc..33dcf5c 100644 --- a/mjo/cone/decomposition.py +++ b/mjo/cone/decomposition.py @@ -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))