def eig_search(W, eps):
    """
    Corrects the eigenvalues if they're smaller than 0.
    """
    for i in range(W.size):
        if W[i] > 0: break
        # else set to condition number
        W[i] = eps
    return W