From c7533f22bd759fd07f6af842b9e2bcf665f7d6dd Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 1 Feb 2026 13:10:19 -0500 Subject: [PATCH] mjo/cone/decomposition.py: fix the vertices in irreducible_factors() This bug is fixed in the upstream SageMath branch (with additional tests), but let's fix it here too until it hits "develop". --- mjo/cone/decomposition.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mjo/cone/decomposition.py b/mjo/cone/decomposition.py index 8520d11..c28cf78 100644 --- a/mjo/cone/decomposition.py +++ b/mjo/cone/decomposition.py @@ -199,9 +199,9 @@ def irreducible_factors(K): # Make a graph with ray -> ray edges where the coefficients in the # W-representation nonzero. Beware: while they ultimately represent # rays of K, the W-coordinates have been renumbered by pivots(). - vertices = list(range(W.dimension())) + vertices = list(range(K.nrays())) edges = [ (i,pivots[j]) - for i in range(K.nrays()) + for i in vertices for j in W.coordinate_vector(K.ray(i)).nonzero_positions() if pivots[j] != i ] from sage.graphs.graph import Graph -- 2.51.0