Skip to content

Commit

Permalink
src/sage/geometry/cone_critical_angles.py: the full space is admissible
Browse files Browse the repository at this point in the history
Allow _random_admissible_cone() to generate the entire ambient
space. This only affects a few test cases where it doesn't matter.
  • Loading branch information
orlitzky committed Apr 24, 2024
1 parent ae22f68 commit f9a4e32
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions src/sage/geometry/cone_critical_angles.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,15 @@ def _normalize_gevp_solution(gevp_solution):
def _random_admissible_cone(ambient_dim):
r"""
Generate a random cone in a lattice of dimension
``ambient_dim`` that isn't trivial and isn't equal to the full
ambient space.
``ambient_dim`` that isn't trivial.
This is called an "admissible cone" in [Or2020]_, and it's a
nontrivial random cone whose dual is also nontrivial. It is used
to simplify some critical angle test cases. The number of rays
that the cone possesses is limited to two more than
This is a convenience method used to simplify some test cases. The
number of rays that the cone possesses is limited to two more than
``ambient_dim``; so, for example, you will not get more than five
rays in a three-dimensional space. This limits the amount of time
spent in any one test case.
spent in any one test case. In contrast with the definition in
[Or2020]_ we consider the full ambient space to be admissible (it
doesn't hurt anything, and [Or2024]_ was forced to allow it).
INPUT:
Expand All @@ -126,8 +125,8 @@ def _random_admissible_cone(ambient_dim):
OUTPUT:
A "random" closed convex cone that is nontrivial, not equal to its
ambient space, and lives in a lattice of dimension ``ambient_dim``.
A "random" nontrivial closed convex cone in a lattice of dimension
``ambient_dim``.
A ``ValueError`` is raised if ``ambient_dim`` is not positive.
Expand All @@ -142,8 +141,6 @@ def _random_admissible_cone(ambient_dim):
5
sage: K.is_trivial()
False
sage: K.is_full_space()
False
Unless the ``ambient_dim`` argument is nonsense::
Expand All @@ -167,9 +164,7 @@ def _random_admissible_cone(ambient_dim):
'max_rays': ambient_dim+2 }

from sage.geometry.cone import random_cone
K = random_cone(**args)
while (K.is_full_space()):
K = random_cone(**args)
return random_cone(**args)

return K

Expand Down

0 comments on commit f9a4e32

Please sign in to comment.