From 1cb31cef14664d7eb8afbeec9bf2cd46671a2bf1 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 8 Feb 2026 20:03:25 -0500 Subject: [PATCH] mjo/cone/decomposition.py: add more nonlineal_part() tests --- mjo/cone/decomposition.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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 -- 2.51.0