]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/cone/doubly_nonnegative.py: don't check rank validity of None.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 7 Dec 2019 23:31:53 +0000 (18:31 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 7 Dec 2019 23:31:53 +0000 (18:31 -0500)
mjo/cone/doubly_nonnegative.py

index 9dcae61856e6e9d5bda7f689cadf905de27290ac..1fb350cb46559a55b982ee3de15678e02d5a04de 100644 (file)
@@ -530,7 +530,7 @@ def random_extreme_doubly_nonnegative(V, accept_zero=True, rank=None):
 
     """
 
-    if not is_admissible_extreme_rank(rank, V.dimension()):
+    if rank is not None and not is_admissible_extreme_rank(rank, V.dimension()):
         msg = 'Rank %d not possible in dimension %d.'
         raise ValueError(msg % (rank, V.dimension()))