X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Fcone%2Fsymmetric_psd.py;h=c9f2a4df4ac87ffca9e44a956516af794a934ee7;hb=bc4804ef6cbf4b5f12fb654193e133f719dcc623;hp=d85ac247e12ca2a4936851182081415bba688061;hpb=2d95c4e34d085c9647c73b73b2957f937cfee26b;p=sage.d.git diff --git a/mjo/cone/symmetric_psd.py b/mjo/cone/symmetric_psd.py index d85ac24..c9f2a4d 100644 --- a/mjo/cone/symmetric_psd.py +++ b/mjo/cone/symmetric_psd.py @@ -22,7 +22,7 @@ def is_symmetric_psd(A): INPUT: - - ``A`` - The matrix in question + - ``A`` - The matrix in question OUTPUT: @@ -74,7 +74,7 @@ def unit_eigenvectors(A): INPUT: - - ``A`` - The matrix whose eigenvectors we want to compute. + - ``A`` - The matrix whose eigenvectors we want to compute. OUTPUT: @@ -178,14 +178,15 @@ def factor_psd(A): """ if not A.base_ring().is_exact() and not A.base_ring() is SR: - raise ValueError('The base ring of ``A`` must be either exact or symbolic.') + msg = 'The base ring of ``A`` must be either exact or symbolic.' + raise ValueError(msg) if not A.base_ring().is_field(): raise ValueError('The base ring of ``A`` must be a field.') if not A.base_ring() is SR: # Change the base field of ``A`` so that we are sure we can take - # roots. The symbolic ring has no algebraic closure. + # roots. The symbolic ring has no algebraic_closure method. A = A.change_ring(A.base_ring().algebraic_closure())