From: Michael Orlitzky Date: Thu, 11 Jun 2026 19:09:25 +0000 (-0400) Subject: mjo/cone/decomposition.py: combine two tests X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=1a2373ab92ed6443603f3042f80b0e2186408a16;p=sage.d.git mjo/cone/decomposition.py: combine two tests 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. --- diff --git a/mjo/cone/decomposition.py b/mjo/cone/decomposition.py index ff80302..2eacc7b 100644 --- a/mjo/cone/decomposition.py +++ b/mjo/cone/decomposition.py @@ -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