]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/cone/decomposition.py: fix the vertices in irreducible_factors()
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 1 Feb 2026 18:10:19 +0000 (13:10 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 1 Feb 2026 18:54:01 +0000 (13:54 -0500)
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

index 8520d119c69894d4b646bc2eb19e83b9adff5952..c28cf78eb79cdf989a9146f64ce40959a06a7384 100644 (file)
@@ -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