X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;ds=sidebyside;f=mjo%2Fcone%2Fdoubly_nonnegative.py;fp=mjo%2Fcone%2Fdoubly_nonnegative.py;h=f0d2a62b6e9223d3ca5539dab9768e2b6d2367e9;hb=0f625ccf86a08c314e79d203ba5cd1a69bf2ba34;hp=583c3c60e8b46d43f9226e413eea70e83000d969;hpb=08e9c59c8d54f1b5e6fbb48176cdb49bddf7960a;p=sage.d.git diff --git a/mjo/cone/doubly_nonnegative.py b/mjo/cone/doubly_nonnegative.py index 583c3c6..f0d2a62 100644 --- a/mjo/cone/doubly_nonnegative.py +++ b/mjo/cone/doubly_nonnegative.py @@ -56,7 +56,7 @@ def is_doubly_nonnegative(A): raise ValueError.new(msg) # Check that all of the entries of ``A`` are nonnegative. - if not all([ a >= 0 for a in A.list() ]): + if not all( a >= 0 for a in A.list() ): return False # It's nonnegative, so all we need to do is check that it's @@ -460,7 +460,7 @@ def random_doubly_nonnegative(V, accept_zero=True, rank=None): # one of them is nonnegative, then return that. A = random_psd(V, accept_zero, rank) - while not all([ x >= 0 for x in A.list() ]): + while not all( x >= 0 for x in A.list() ): A = random_psd(V, accept_zero, rank) return A