From f79e891ca154b0fa935a14001b0b6ed194425741 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 4 Nov 2018 01:42:23 -0500 Subject: [PATCH] cone/symmetric_psd.py: use two more generator expressions. --- mjo/cone/symmetric_psd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() -- 2.44.2