Skip to content

Commit

Permalink
Make Cone.rays return input rays, if possible
Browse files Browse the repository at this point in the history
There are cases for which one wants Cone(rays=R).rays() to always return R. Currently, if the extremal rays of the cone are also found, it'll return the extremal rays
  • Loading branch information
natemacfadden committed Nov 14, 2024
1 parent 50b6084 commit 98c6b72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cytools/cone.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,6 @@ def rays(self, use_extremal_hyperplanes: bool=False, verbosity: int=0):
# [-1, 1]])
```
"""
if self._ext_rays is not None:
return np.array(self._ext_rays)
if self._rays is not None:
return np.array(self._rays)
if self._ambient_dim >= 12 and len(self._hyperplanes) != self._ambient_dim:
Expand Down Expand Up @@ -877,6 +875,8 @@ def extremal_rays(self, tol=1e-4, verbose=False):

try:
self._ext_rays = rays[list(ext_rays)]
if self._rays is None:
self._rays = self._ext_rays
except IndexError as e:
raise Exception(
f"Dimension/indexing error rays={rays}; " + f"ext_rays={ext_rays}"
Expand Down

0 comments on commit 98c6b72

Please sign in to comment.