由于我所定义的优化问题是凸问题,约束条件中设计到投影函数(镜像函数),保持原函数的凹凸性,即若f(x)关于x>0是凹的,则x*f(y/x)guanyu x>0及y>=0也是凹的。但是在写入cvx中时,由于不会表达,导致程序一直报错,报错信息如下:
错误使用 .* (line 173)
Disciplined convex programming error:
Cannot perform the operation: {real affine} .* {convex}
在论坛求助后才知道cvx中有下面这个函数可以用来表达我遇到的情况,解决了问题。
rel_entr Scalar relative entropy.
rel_entr(X,Y) returns an array of the same size as X+Y with the
relative entropy function applied to each element:
{ X.*LOG(X./Y) if X > 0 & Y > 0,
rel_entr(X,Y) = { 0 if X == 0 & Y >= 0,
{ +Inf otherwise.
X and Y must either be the same size, or one must be a scalar. If X and
Y are vectors, then SUM(rel_entr(X,Y)) returns their relative entropy.
If they are PDFs (that is, if X>=0, Y>=0, SUM(X)==1, SUM(Y)==1) then