Generates a multidimensional lattice
    :param bounds: box constraints
    :param points_count: number of points per dimension.

def multigrid(bounds, points_count):
    """
    Generates a multidimensional lattice
    :param bounds: box constraints
    :param points_count: number of points per dimension.
    """
    if len(bounds)==1:
        return np.linspace(bounds[0][0], bounds[0][1], points_count).reshape(points_count, 1)
    x_grid_rows = np.meshgrid(*[np.linspace(b[0], b[1], points_count) for b in bounds])
    x_grid_columns = np.vstack([x.flatten(order='F') for x in x_grid_rows]).T
    return x_grid_columns