def calcHinges(self):
if self._array is None:
raise ValueError("Modes are not calculated.")
V = np.sign(self._array)
(m, n) = V.shape
hinges = []
for i in xrange(n):
v = V[:,i]
After Change
for i in xrange(n):
v = V[:,i]
// obtain the signs of eigenvector
s = np.insert(np.sign(v), 0, 0)
// obtain the relative magnitude of eigenvector
mag = np.insert(np.sign(np.diff(np.abs(v))), 0, 0)
// obtain the cross-overs
torf = np.diff(s)!=0
indices = np.where(torf)[0]
// find which side is more close to zero
for i in xrange(len(indices)):
idx = indices[i]
if mag[idx] > 0:
indices[i] -= 1
hinges.append(indices)
self._hinges = np.array(hinges)
return self._hinges