fwdutils.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:invo 作者: rafidrm 项目源码 文件源码
def fit_convex_hull(points):
    """ Creates a feasible set by taking a convex hull of the points given. Returns P = { x : Ax >= b }

    Args:
        points (list): Set of numpy points.

    Returns:
        A (numpy): constraint matrix
        b (numpy): constraint vector
    """
    hull = ConvexHull(points)
    m,n = hull.equations.shape
    A = -1 * hull.equations[:,0:n-1]
    b = hull.equations[:,n-1]
    return np.mat(A), np.mat(b).T
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号