I have the underdetermined outer optimization problem $$\text{min}_{x\geq 0}\quad \|Ax-b_1\|_2^2+\|AT(x)-b_2\|_2^2$$ with $A\in\mathbb{R}^{m\times n}$ and $m<<n=64^2$ or in corresponding CVX Matlab code
variable x(n) nonnegative
minimize(sum( (A*x-b1).^2 + (A*T(x,p1,p2,p3,p4,p5)-b2).^2 ))
where p1,...,p5
are fixed parameters required by the function T
. Inside T
there is another linear minimization problem
$$\begin{aligned}\text{min}_{c,q} \quad &1^\top q&\\\text{s.t.}\quad&Dc-x \leq q\\-&Dc-x \leq -q\end{aligned}$$
with $D\in\mathbb{R}^{n\times n}$ or in Matlab syntax
function value = T(x,p1,p2,p3,p4,p5)
... something happens ...
cvx_begin
variable c(n)
variable q(n)
minimize sum(q)
subject to
D*c-x <= q
-D*c-x >= -q
cvx_end
... something else happens and calculates return value ...
Unfortunately I get the error
Undefined function 'newcnstr' for input arguments of type 'cvx'.
Error in cvx/lt (line 22)
b = newcnstr( evalin( 'caller', 'cvx_problem', '[]' ), x, y, '<' );
after the cvx_end
line in the function T
.
I encountered this error several times before when dealing with other problems, but this time I cannot replace the outer optimization with a build in Matlab function, since fmincon
is far to slow. Replacing the inner problem by linprog
is too slow as well, unfortunately.
Is it possible to nest CVX optimization problems like that? If yes, how? Are there any other ideas what I could try?