From 7f0c67f42d8f2f0fdc78e2a431f712744136b4e5 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 11 Nov 2025 19:51:51 -0500 Subject: [PATCH] mjo/cone/decomposition.py: add new is_reducible() function --- mjo/cone/decomposition.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/mjo/cone/decomposition.py b/mjo/cone/decomposition.py index 31a4e3f..a21b0ec 100644 --- a/mjo/cone/decomposition.py +++ b/mjo/cone/decomposition.py @@ -199,3 +199,30 @@ def irreducible_factors(K): # equivalent but unequal copy of the input cone. return {K} return { Cone(K.rays(c)) for c in G.connected_components() } + + +def is_reducible(K): + r""" + Return whether or not this cone is reducible. + + A pointed convex cone ``K`` is reducible if some other cone + appears in its :func:`irreducible_factors`. + + SETUP:: + + sage: from mjo.cone.decomposition import is_reducible + + EXAMPLES: + + The nonnegative orthant is always reducible in dimension two or + more:: + + sage: is_reducible(cones.nonnegative_orthant(1)) + False + sage: is_reducible(cones.nonnegative_orthant(2)) + True + sage: is_reducible(cones.nonnegative_orthant(3)) + True + + """ + return len(irreducible_factors(K)) > 1 -- 2.51.0