Skip to content

Commit

Permalink
remove deprecated normalization code
Browse files Browse the repository at this point in the history
  • Loading branch information
axsk committed Jun 10, 2020
1 parent dd65351 commit 3822a2e
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/cmdtools/analysis/pcca.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,26 +131,3 @@ def krylovschur(A, n, massmatrix=None, onseperation="continue"):
E.solve()
X = np.column_stack([x.array for x in E.getInvariantSubspace()])
return X[:, :n]


def normalizeschur(X):
# find the constant eigenvector corresponding to ev. 1,
# move it to the front and set it to 1
# as required by the optimization routine

X /= np.linalg.norm(X, axis=0)
i = np.argmax(np.abs(np.sum(X, axis=0)))
X[:, i] = X[:, 0]
X[:, 0] = 1 # TODO: check if this column is indeed constant

return X


def normalizeschur2(X):
n, m = np.shape(X)
T = np.identity(m)
T[:, 0] = np.dot(np.ones(n)/np.sqrt(n), X)
if np.isclose(T[0, 0], 0):
raise RuntimeError("X[:,1] must not be orthogonal to the one-vector")
tX = np.dot(X, T)
return tX

0 comments on commit 3822a2e

Please sign in to comment.