一多面体的chebyshev中心
1.chebyshev中心
2.凸集的 Chebyshev 中心
3.多面体的 Chebyshev 中心
二.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;
}