From: Michael Orlitzky Date: Mon, 9 Feb 2026 01:03:25 +0000 (-0500) Subject: mjo/cone/decomposition.py: add more nonlineal_part() tests X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=1cb31cef14664d7eb8afbeec9bf2cd46671a2bf1;p=sage.d.git mjo/cone/decomposition.py: add more nonlineal_part() tests --- diff --git a/mjo/cone/decomposition.py b/mjo/cone/decomposition.py index 714588c..2098574 100644 --- a/mjo/cone/decomposition.py +++ b/mjo/cone/decomposition.py @@ -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