, ( ), " ". A, ( ). , - , .
( numpy python), , ( c ). , ( ) :
from numpy import *
import pylab as plt
N = 30
c = 5
A = zeros((N*c,N*c))
for m in xrange(c):
A[m*N:(m+1)*N, m*N:(m+1)*N] = random.random((N,N))
A += random.random(A.shape) * 0.1
A += A.T - diag(A.diagonal())
plt.subplot(131)
plt.imshow(A.copy(), interpolation='nearest')
idx = random.permutation(N*c)
A = A[idx,:][:,idx]
L = linalg.eigvalsh(A)
plt.subplot(132)
plt.imshow(A, interpolation='nearest')
plt.subplot(133)
plt.plot(sorted(L,reverse=True))
plt.plot([c-.5,c-.5],[0,max(L)],'r--')
plt.ylim(0,max(L))
plt.xlim(0,20)
plt.show()
