def infer_free_values(A, b):
    """
    Infer the indices of fixed values in an optimization vector.

    Parameters
    ----------
    A : np.ndarray
        The constraint matrix.
    b : np.ndarray
        The constraint values.

    Returns
    -------
    fixed : list
        The list of fixed indices.
    """
    # find locations of b == 0, since pmf values are non-negative, this means they are identically zero.
    free = [i for i, n in enumerate(A[b == 0, :].sum(axis=0)) if n == 0]
    while True:
        # now find rows of A with only a single free value in them. those values must also be fixed.
        fixed = A[:, free].sum(axis=1) == 1
        new_fixed = [[i for i, n in enumerate(row) if n and (i in free)][0] for i, row in enumerate(A) if fixed[i]]
        free = list(sorted(set(free) - set(new_fixed)))
        if not new_fixed:
            break
    return free