def nonlinear_meshnd(D, N=10):
    """
    :param D:  1+dimensionality of the simplex
    :param N:  number of points per dimension
    :param edges:
    :return:
    """
    # Compute the points
    inds = np.array(np.unravel_index(np.arange(N**D), (N,)*D))
    inds = inds.T
    inds = inds.astype(np.float)

    # The point is simply the normalized index
    # Firs we remove the point (0,0,...,0)
    inds = inds[1:]
    pts = inds / inds.sum(1)[:,None]

    # Remove redundant points
    pts = np.unique(pts)

    assert np.allclose(pts.sum(1), 1.0)
    assert np.amin(pts) >= 0
    assert np.amax(pts) <= 1

    return pts
dataset/ETHPy150Open HIPS/pgmult/pgmult/internals/simplex.py/nonlinear_meshnd/original