我正在按照 Mosek 文档检索求解器的信息。特别是我想通过以下方式获得约束的数量:
Model::t M = new Model("cqo1");
Variable::t x = M->variable("x", 3, Domain::greaterThan(0.0));
Variable::t y = M->variable("y", 3, Domain::unbounded());
Variable::t z1 = Var::vstack(y->index(0), x->slice(0, 2));
Variable::t z2 = Var::vstack(y->slice(1, 3), x->index(2));
auto aval = new_array_ptr<double, 1>({1.0, 1.0, 2.0});
M->constraint("lc", Expr::dot(aval, x), Domain::equalsTo(1.0));
Constraint::t qc1 = M->constraint("qc1", z1, Domain::inQCone());
Constraint::t qc2 = M->constraint("qc2", z2, Domain::inRotatedQCone());
M->objective("obj", ObjectiveSense::Minimize, Expr::sum(y));
int anaProNumCon = M->getSolverIntInfo("anaProNumCon");
但是它返回 anaProNumCon=0(应该是 3)。通话中可能有什么问题?
最好的