# Error when using gurobi to solve SOCP

I’m trying to solve the following SOCP problem:
B(kn,n), Nin(n,3), lambda(1,1), p=ones(kn,1) are known, t(kn,1) and Nout(n,3) are variables to optimize

``````min p'*t s.t.
norm((B*Nout)(i,:))<=t(i)
norm(Nout(i,:)-Nin(i,:))<=lambda
``````

the code I use is:

``````cvx_clear;
% cvx optimization
cvx_begin
% cvx_solver sedumi
cvx_solver gurobi
p=ones(kn,1);
variable Nout(n,3)
variable t(kn,1)
minimize(p'*t);
subject to
sum((Nout-Nin).^2,2)<=lambda;
sum((B*Nout).^2,2)<=t;
cvx_end
``````

It can be solved by sedumi without problem. However, when I try to use gurobi for better performance, cvx give me the following error message:

``````Barrier solved model in 63 iterations and 266.48 seconds
Optimal objective 4.81483354e-02

Warning: to get QCP duals, please set parameter QCPDual to 1

------------------------------------------------------------
Status: Error
Optimal value (cvx_optval): NaN

Undefined function or variable 'need_duals'.

Error in D:\work\matlab\cvx\shims\cvx_gurobi.p>solve (line 499)

Error in D:\work\matlab\cvx\shims\cvx_gurobi.p>@(varargin)solve(grb,varargin{:}) (line 188)

Error in cvxprob/solve (line 427)
[ x, status, tprec, iters ] = shim.solve( At, b, c, cones, quiet, prec, solv.settings
);

Error in cvx_end (line 79)
solve( prob );

Error in cvx_wrapper (line 25)
cvx_end

Error in getall (line 48)
normals_new=cvx_wrapper(points,normals,k,lambda,true); % cvx version``````

The chances of any help are greatly improved if you post a full example including data
(even trivial ones).

[EDIT]
I get the following results running it with MOSEK 7 beta:

Interior-point solution summary
Problem status : PRIMAL_AND_DUAL_FEASIBLE
Solution status : NEAR_OPTIMAL
Primal. obj: -4.8141999326e-02 Viol. con: 1e-07 var: 0e+00 cones: 0e+00
Dual. obj: -4.8142074105e-02 Viol. con: 0e+00 var: 3e-13 cones: 8e-14
Optimizer summary
Optimizer - time: 32.10
Interior-point - iterations : 41 time: 31.89

Hi, I have uploaded the test data and script, could you please check that?
The link is https://dl.dropboxusercontent.com/u/55773469/test.7z .
I’m using matlab 2012a 64bit, cvx2.0 beta and gurobi5.1, Thanks!

Hi, I have uploaded the test data and script, could you please check that? The link is https://dl.dropboxusercontent.com/u/55773469/test.7z . I’m using matlab 2012a 64bit, cvx2.0 beta and gurobi5.1, Thanks!

This is a bug, so please submit this to http://support.cvxr.com … also, can you please make sure you’re using the absolute latest build of CVX?

Yes, I am using the version Build 945. I will submit this to http://support.cvxr.com/

Great, thanks!