/usr/lib/python2.7/dist-packages/openopt/solvers/scipy_optim/numpy_eig_oo.py is in python-openopt 0.38+svn1589-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | from openopt.kernel.baseSolver import baseSolver
from openopt.kernel.nonOptMisc import Vstack, isspmatrix
from numpy.linalg import eig
#from nonOptMisc import Hstack
class numpy_eig(baseSolver):
__name__ = 'numpy_eig'
__license__ = "BSD"
__authors__ = ''
__alg__ = ''
__info__ = """ """
__optionalDataThatCanBeHandled__ = []
_canHandleScipySparse = True
#def __init__(self): pass
def __solver__(self, p):
A = p.C
if isspmatrix(A):
p.warn('numpy.linalg.eig cannot handle sparse matrices, cast to dense will be performed')
A = A.A
#M = p.M
if p._goal != 'all':
p.err('numpy_eig cannot handle the goal "%s" yet' % p._goal)
eigenvalues, eigenvectors = eig(A)
p.xf = p.xk = Vstack((eigenvalues, eigenvectors))
p.eigenvalues = eigenvalues
p.eigenvectors = eigenvectors
p.ff = 0
|