function ret=eigenvalsfrommoments(moms)
  %Implementation of the Newton-Girard formulas. These are identities between symmetric polynomials and the sums of the powers of the variables
  n = length(moms);
  newmoms = n .* moms;
  for k=1:n
    newmoms(k) = (-1)^(k+1) * newmoms(k);
  end
    
  coeffs = zeros(1,n+1);
  coeffs(1) = 1;
  for k=1:n
    convolved = conv(newmoms,coeffs);
    coeffs(k+1) = (1/k) * convolved(k);
  end
  
  for k=1:(n+1)
    coeffs(k) = (-1)^(k+1) * coeffs(k);
  end
    
  ret=roots(coeffs);


  
  
  


  
  

  
  

  
  
  

  
  
