GCOPTER-求多面体的chebyshev中心

一多面体的chebyshev中心

1.chebyshev中心

2.凸集的 Chebyshev 中心

3.多面体的 Chebyshev 中心

 二.SDLP求解器

https://github.com/ZJU-FAST-Lab/SDLP

Seidel's LP Algorithm: Linear-Complexity Linear Programming (LP) for Small-Dimensions

 三GCOPTER求多面体的chebyshev中心

gcopter\include\gcopter\firi.hpp

// Each row of hPoly is defined by h0, h1, h2, h3 as
    // h0*x + h1*y + h2*z + h3 <= 0
    // R, p, r are ALWAYS taken as the initial guess
    // R is also assumed to be a rotation matrix
    inline bool maxVolInsEllipsoid(const Eigen::MatrixX4d &hPoly,
                                   Eigen::Matrix3d &R,
                                   Eigen::Vector3d &p,
                                   Eigen::Vector3d &r)
    {
        // Find the deepest interior point
        const int M = hPoly.rows();   //这里行数表示多面体由几个半平面组成
        Eigen::MatrixX4d Alp(M, 4);   //这里定义约束s.t. Ax<=b,
        Eigen::VectorXd blp(M);
        Eigen::Vector4d clp, xlp;    //这里定义目标函数min cTx,  x前三维表示球心坐标,第四维表示半径
        const Eigen::ArrayXd hNorm = hPoly.leftCols<3>().rowwise().norm(); //这里计算每一个半平面法向量的长度
        Alp.leftCols<3>() = hPoly.leftCols<3>().array().colwise() / hNorm;
        Alp.rightCols<1>().setConstant(1.0);
        blp = -hPoly.rightCols<1>().array() / hNorm;
        clp.setZero();    //由于min cTx,而原来目标是max R,所以这里c前三维为0,第四维为-1,即min -R
        clp(3) = -1.0;
        const double maxdepth = -sdlp::linprog<4>(clp, Alp, blp, xlp);
        if (!(maxdepth > 0.0) || std::isinf(maxdepth))
        {
            return false;
        }

  • 17
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值