From 78ea728082d93c62e837c527d98f98b9e4815e6c Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 30 Nov 2018 11:25:56 -0500 Subject: [PATCH] mjo/cone/symmetric_psd: add missing set_random_seed() calls. --- mjo/cone/symmetric_psd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mjo/cone/symmetric_psd.py b/mjo/cone/symmetric_psd.py index 40fd90c..dd09ea2 100644 --- a/mjo/cone/symmetric_psd.py +++ b/mjo/cone/symmetric_psd.py @@ -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): -- 2.44.2