cvx_begin error

I never have problems using cvx, until I tried to use it on a university cluster. I get this error every time \begin{verbatim} Undefined function ‘cvx_begin’ for input arguments of type ‘char’.\end{verbatim}

That is certainly a setup problem. You will have to contact your system administrator.

1 Like

Okay, that aspect is solved. But now I get the error
Undefined function ‘cvx_bcompress_mex’ for input arguments of type ‘double’.

Error in cvx_bcompress (line 29)
[ ndxs, scls ] = cvx_bcompress_mex( sparse( x ), mode, num_sorted );

Error in cvx/bcompress (line 21)
[ xR, xb ] = cvx_bcompress( xb, mode, nsrt );

Error in cvx/svec (line 13)
[ xR, y ] = bcompress( x );

Error in cvx/norm (line 46)
x = svec( x, p );

Error in constr (line 132)
minimize( norm( A * x - b, 2 ) )

where constr is a function where I use cvx_begin quiet
variable x(15)
minimize( norm( A * x - b, 2 ))
subject to

cvx_end

I’m sorry, there’s just no way I’m going to be able to diagnose this from afar. I remain convinced it is simply not being set up properly on the cluster. You will have to do the setup yourself.

1 Like

Hi Mohamed

Did you solve this? My otherwise working CVX installation suddenly started throwing up a similar error message, and am a bit at a loss?

Perhaps your CVX installation got corrupted somehow.

Try removing all CVX directories from the MATLAB path and then reinstall CVX. If you are using CVVX3.0beta, switch to CVX 2,1.

HI Mark
It turned out to be a stupid error caused by too little sleep. Writing x =< 0 =< 1 instead of 0=< x =< 1 will cause this.

1 Like

That’s an example of CVX producing misleading error messages. I think the design of CVX ensures (except for a few bugs) that an error message is generated if CVX’s rules are not followed. But sometimes the actual error message generated seemingly has nothing to do with the rule that was actually violated, or at least is non-informative as to what the true error is. The CVX developer is aware of this behavior, and could probably improve it if enough development effort were put in.

Well, I tried it out.

>> cvx_begin;variable x;x<=0<=1;cvx_end
Undefined function 'bcompress' for input arguments of type 'double'.
Error in cvxprob/newcnstr (line 233)
[ zR, zL ] = bcompress( z, cmode );
Error in  <=  (line 21)
b = newcnstr( evalin( 'caller', 'cvx_problem', '[]' ), x, y, '<=' );
>> cvx_clear;cvx_begin;variable x;0<=x<=1;cvx_end

Calling SDPT3 4.0: 2 variables, 1 equality constraints
------------------------------------------------------------

num. of constraints =  1
dim. of linear var  =  2
*******************************************************************
SDPT3: Infeasible path-following algorithms
*******************************************************************
version  predcorr  gam  expon  scale_data
NT      1      0.000   1        0
it pstep dstep pinfeas dinfeas  gap      prim-obj      dual-obj    cputime
-------------------------------------------------------------------
0|0.000|0.000|9.5e+00|1.4e+01|2.0e+02| 0.000000e+00  0.000000e+00| 0:0:00| chol  1  1
1|1.000|1.000|3.3e-06|1.0e-01|9.0e+00| 0.000000e+00 -8.955355e+00| 0:0:00| chol  1  1
2|1.000|0.989|6.1e-08|1.1e-02|9.8e-02| 0.000000e+00 -9.061411e-02| 0:0:00| chol  1  1
3|1.000|0.989|1.9e-08|1.1e-03|1.1e-03| 0.000000e+00 -2.963690e-04| 0:0:00| chol  1  1
4|1.000|0.989|2.3e-09|1.1e-04|1.2e-05| 0.000000e+00  6.667558e-05| 0:0:00| chol  1  1
5|1.000|0.989|2.1e-10|1.2e-06|1.3e-07| 0.000000e+00  7.325592e-07| 0:0:00| chol  1  1
6|1.000|1.000|1.1e-12|4.2e-11|1.5e-09| 0.000000e+00 -1.438312e-09| 0:0:00|
stop: max(relative gap, infeasibilities) < 1.49e-08
-------------------------------------------------------------------
number of iterations   =  6
primal objective value =  0.00000000e+00
dual   objective value = -1.43831202e-09
gap := trace(XZ)       = 1.47e-09
relative gap           = 1.47e-09
actual relative gap    = 1.44e-09
rel. primal infeas (scaled problem)   = 1.15e-12
rel. dual     "        "       "      = 4.19e-11
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual     "        "       "      = 0.00e+00
norm(X), norm(y), norm(Z) = 7.1e-01, 1.4e-09, 2.1e-09
norm(A), norm(b), norm(C) = 2.4e+00, 2.0e+00, 1.0e+00
Total CPU time (secs)  = 0.04
CPU time per iteration = 0.01
termination code       =  0
DIMACS: 1.1e-12  0.0e+00  4.2e-11  0.0e+00  1.4e-09  1.5e-09
-------------------------------------------------------------------

------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +0