fprintf('hahaha\n')

repeats = 10;
fid = fopen('diag_haha.txt','w');

for n = [40 50 60]
  for eta = [0.05 0.1]    
    orig = 0;
    answer = 0;
    answer2 = 0;
    maxd = inf;
    
    for i = 1:repeats
      A = randn(n,n);
      A = A*A';
      
      d = 1./sqrt(diag(A));
      maxd = min(max(d),maxd);
      [answer0,diagX0] = cond_se_diag_dual(A,d,eta);
      
      answer = answer + answer0;      
      orig = orig + cond(A);
      DG = diag(d);
      answer2 = answer2 + cond(DG*A*DG); 
    end
    
    orig = orig/repeats;
    answer = answer/repeats;
    answer2 = answer2/repeats;
    fprintf(fid,' %d& %3.2f& %6.4e& %6.4e& %6.4e& %5.4f\n', n, eta, orig, answer2, answer, maxd)
  end
end
fclose(fid);