X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=dunshire%2Fmatrices.py;h=94f841d39f888392624077afd12bcdcb7e0c3c19;hb=cb34e104961ce1da242017a0e5ebf60c3fe18a1d;hp=bcf83778d62752436f7894b5a6fbad4cc3e1012e;hpb=040374ca134b2f3d962b91a9dac97a7600032685;p=dunshire.git diff --git a/dunshire/matrices.py b/dunshire/matrices.py index bcf8377..94f841d 100644 --- a/dunshire/matrices.py +++ b/dunshire/matrices.py @@ -3,6 +3,7 @@ Utility functions for working with CVXOPT matrices (instances of the class:`cvxopt.base.matrix` class). """ +from copy import copy from math import sqrt from cvxopt import matrix from cvxopt.lapack import gees, gesdd, syevr @@ -142,7 +143,7 @@ def eigenvalues(symmat): eigs = matrix(0, (domain_dim, 1), tc='d') # Create a copy of ``symmat`` here because ``syevr`` clobbers it. - dummy = matrix(symmat, symmat.size) + dummy = copy(symmat) syevr(dummy, eigs) return list(eigs) @@ -421,10 +422,6 @@ def condition_number(mat): Examples -------- - >>> condition_number(identity(1, typecode='d')) - 1.0 - >>> condition_number(identity(2, typecode='d')) - 1.0 >>> condition_number(identity(3, typecode='d')) 1.0