##// END OF EJS Templates
Backport PR #6005: Changed right arrow key movement function to mirror left arrow key...
Backport PR #6005: Changed right arrow key movement function to mirror left arrow key Seems to solve Issue #5926 on this machine, and passing the test file locally. Changed from `cursor.movePosition` to `self._control.moveCursor`, the latter is what the left-arrow key uses. Also removed line 1373 which seems unnecessary and which prevents the cursor from moving at all. I'm not certain how to further test this to make sure nothing was broken.

File last commit:

r16120:24b93a1d
r17151:477b3912
Show More
rmtkernel.py
42 lines | 1.2 KiB | text/x-python | PythonLexer
#-------------------------------------------------------------------------------
# Core routines for computing properties of symmetric random matrices.
#-------------------------------------------------------------------------------
import numpy as np
ra = np.random
la = np.linalg
def GOE(N):
"""Creates an NxN element of the Gaussian Orthogonal Ensemble"""
m = ra.standard_normal((N,N))
m += m.T
return m/2
def center_eigenvalue_diff(mat):
"""Compute the eigvals of mat and then find the center eigval difference."""
N = len(mat)
evals = np.sort(la.eigvals(mat))
diff = np.abs(evals[N/2] - evals[N/2-1])
return diff
def ensemble_diffs(num, N):
"""Return num eigenvalue diffs for the NxN GOE ensemble."""
diffs = np.empty(num)
for i in xrange(num):
mat = GOE(N)
diffs[i] = center_eigenvalue_diff(mat)
return diffs
def normalize_diffs(diffs):
"""Normalize an array of eigenvalue diffs."""
return diffs/diffs.mean()
def normalized_ensemble_diffs(num, N):
"""Return num *normalized* eigenvalue diffs for the NxN GOE ensemble."""
diffs = ensemble_diffs(num, N)
return normalize_diffs(diffs)