Python 用于熵最小化的 CVXOPT

Python CVXOPT for entropy minimization

我正在查看页面上的示例:

http://cvxopt.org/examples/book/maxent.html

问题陈述是:

# minimize     p'*log p
# subject to  -0.1 <= a'*p <= 0.1
#              0.5 <= (a**2)'*p <= 0.6
#             -0.3 <= (3*a**3 - 2*a)'*p <= -0.2
#              0.3 <= sum_{k:ak < 0} pk <= 0.4
#              sum(p) = 1

但是最后一行

#              sum(p) = 1

似乎从未实施过?

实现在行

A, b = matrix(1.0, (1,n)), matrix(1.0)