From: Michael Orlitzky Date: Wed, 12 Nov 2025 00:51:51 +0000 (-0500) Subject: mjo/cone/decomposition.py: add new is_reducible() function X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=7f0c67f42d8f2f0fdc78e2a431f712744136b4e5;p=sage.d.git mjo/cone/decomposition.py: add new is_reducible() function --- 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