]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/cone/symmetric_psd: add missing set_random_seed() calls.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 30 Nov 2018 16:25:56 +0000 (11:25 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 30 Nov 2018 16:25:56 +0000 (11:25 -0500)
mjo/cone/symmetric_psd.py

index 40fd90c0e3b1d20cf8e522e8504ef8f55804b959..dd09ea2ca410438c68de51428b0ba5e676093526 100644 (file)
@@ -29,6 +29,7 @@ def is_symmetric_psd(A):
     Every completely positive matrix is symmetric
     positive-semidefinite::
 
+        sage: set_random_seed()
         sage: v = vector(map(abs, random_vector(ZZ, 10)))
         sage: A = v.column() * v.row()
         sage: is_symmetric_psd(A)
@@ -260,6 +261,7 @@ def random_symmetric_psd(V, accept_zero=True, rank=None):
 
     Well, it doesn't crash at least::
 
+        sage: set_random_seed()
         sage: V = VectorSpace(QQ, 2)
         sage: A = random_symmetric_psd(V)
         sage: A.matrix_space()
@@ -269,6 +271,7 @@ def random_symmetric_psd(V, accept_zero=True, rank=None):
 
     A matrix with the desired rank is returned::
 
+        sage: set_random_seed()
         sage: V = VectorSpace(QQ, 5)
         sage: A = random_symmetric_psd(V,False,1)
         sage: A.rank()
@@ -288,6 +291,7 @@ def random_symmetric_psd(V, accept_zero=True, rank=None):
 
     If the user asks for a rank that's too high, we fail::
 
+        sage: set_random_seed()
         sage: V = VectorSpace(QQ, 2)
         sage: A = random_symmetric_psd(V,False,3)
         Traceback (most recent call last):