0

下面是我程序中的一段代码。

import CVXPY as cp

X = cp.Variable(shape=(10,4), boolean = True)

y = cp.exp(X[0,1])

objective = cp.Minimize(cp.sum(X))

constraint = [y <= 0]

prob = cp.Problem(objective, constraints)

result = prob.solve(solver = cp.MOSEK)

我的问题是 Mosek 说我的模型中指数锥的数量是 40 而不是 1。为什么会这样?

4

1 回答 1

0

正如预期的那样,使用 CVXPY 1.0.25 和 Mosek 9.1.10 我只看到一个锥体:

Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 4               
  Cones                  : 1               
  Scalar variables       : 44              
  Matrix variables       : 0               
  Integer variables      : 40   

(在修复代码中的小错别字之后)。

于 2019-12-09T07:31:36.580 回答