Skip to content

Commit

Permalink
matrix size from number of eigen values
Browse files Browse the repository at this point in the history
  • Loading branch information
aivuk committed Jul 16, 2012
1 parent 042ef83 commit da78bc1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rr_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from numpy import linalg, zeros, dot, diag_indices_from, array, var, genfromtxt
from docopt import docopt

def a_m(value, vector, mat_size):
mat = zeros((mat_size, mat_size))
def a_m(value, vector):
mat = zeros((len(value), len(value)))
mat[diag_indices_from(mat)] = value
mat = dot(dot(vector, mat), vector.transpose())
return mat
Expand Down Expand Up @@ -57,7 +57,7 @@ def noise_control(matrix, cutoff, output_filename, var_mat_filename):
last_ev_index = last_big_eval_index(eig_vals, cutoff, var_mat_filename)
last_ev_index = ask_number(last_ev_index)
eig_vals[:-last_ev_index] = eig_vals[last_ev_index]
p = a_m(eig_vals, eig_vecs, matrix.shape[0])
p = a_m(eig_vals, eig_vecs)

new_matrix = ''
for i in range(num_evals):
Expand Down

0 comments on commit da78bc1

Please sign in to comment.