From: Michael Orlitzky Date: Sun, 4 Nov 2018 06:42:23 +0000 (-0500) Subject: cone/symmetric_psd.py: use two more generator expressions. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=f79e891ca154b0fa935a14001b0b6ed194425741;p=sage.d.git cone/symmetric_psd.py: use two more generator expressions. --- diff --git a/mjo/cone/symmetric_psd.py b/mjo/cone/symmetric_psd.py index 68be78f..1b3dd8a 100644 --- a/mjo/cone/symmetric_psd.py +++ b/mjo/cone/symmetric_psd.py @@ -193,10 +193,10 @@ def factor_psd(A): all_evs = unit_eigenvectors(A) evs = [ (val,vec) for (val,vec) in all_evs if not val == 0 ] - d = [ sqrt(val) for (val,vec) in evs ] + d = ( val.sqrt() for (val,vec) in evs ) root_D = diagonal_matrix(d).change_ring(A.base_ring()) - Q = matrix(A.base_ring(), [ vec for (val,vec) in evs ]).transpose() + Q = matrix(A.base_ring(), ( vec for (val,vec) in evs )).transpose() return Q*root_D*Q.transpose()