ValueError: cone must be strictly convex (AKA pointed) for its
irreducible factors to be well-defined
+ Trivial cones are handled correctly::
+
+ sage: K = cones.trivial(0)
+ sage: irreducible_factors(K) == {K}
+ True
+ sage: K = cones.trivial(4)
+ sage: irreducible_factors(K) == {K}
+ True
+
"""
if not K.is_strictly_convex():
raise ValueError("cone must be strictly convex (AKA pointed) for"
" its irreducible factors to be well-defined")
+ if K.is_trivial():
+ # Trivial cones are valid inputs, but they have no generators
+ # so a special case is required.
+ return {K}
+
V = K.ambient_vector_space()
# Create a column matrix from the generators of K, and then