[Csdp] Error "Function is not defined for sparse inputs." during writesdp.m

Brian Borchers borchers at nmt.edu
Tue Nov 9 20:09:41 EST 2010


It works fine on my system.  I got:

>> load mdlSave.mat
>> csdp(mdl.At,mdl.b,mdl.C,mdl.K,mdl.pars)
Transposing A to match b
Number of constraints: 16
Number of SDP blocks: 4
Number of LP vars: 29
Iter:  0 Ap: 0.00e+00 Pobj: -4.1719444e+03 Ad: 0.00e+00 Dobj:  0.0000000e+00
Iter:  1 Ap: 9.56e-01 Pobj: -3.9568571e+03 Ad: 8.61e-01 Dobj:  2.0229848e+01
Iter:  2 Ap: 7.33e-01 Pobj: -2.2165782e+03 Ad: 9.20e-01 Dobj:  3.7188260e+01
Iter:  3 Ap: 9.53e-01 Pobj: -2.8163727e+02 Ad: 8.65e-01 Dobj:  3.8404171e+01
Iter:  4 Ap: 1.00e+00 Pobj: -1.7910712e+01 Ad: 9.25e-01 Dobj:  2.2304069e+01
Iter:  5 Ap: 1.00e+00 Pobj: -2.9388007e+00 Ad: 9.23e-01 Dobj:  5.2764232e+00
Iter:  6 Ap: 1.00e+00 Pobj:  4.9181598e-01 Ad: 8.05e-01 Dobj:  2.9351435e+00
Iter:  7 Ap: 1.00e+00 Pobj:  1.7326814e+00 Ad: 8.07e-01 Dobj:  2.3611493e+00
Iter:  8 Ap: 1.00e+00 Pobj:  2.0034116e+00 Ad: 9.90e-01 Dobj:  2.0585823e+00
Iter:  9 Ap: 1.00e+00 Pobj:  2.0335186e+00 Ad: 1.00e+00 Dobj:  2.0439900e+00
Iter: 10 Ap: 1.00e+00 Pobj:  2.0383916e+00 Ad: 1.00e+00 Dobj:  2.0416431e+00
Iter: 11 Ap: 1.00e+00 Pobj:  2.0399969e+00 Ad: 1.00e+00 Dobj:  2.0408195e+00
Iter: 12 Ap: 1.00e+00 Pobj:  2.0403999e+00 Ad: 1.00e+00 Dobj:  2.0405801e+00
Iter: 13 Ap: 9.94e-01 Pobj:  2.0405007e+00 Ad: 1.00e+00 Dobj:  2.0405174e+00
Iter: 14 Ap: 1.00e+00 Pobj:  2.0405118e+00 Ad: 1.00e+00 Dobj:  2.0405118e+00
Iter: 15 Ap: 1.00e+00 Pobj:  2.0405131e+00 Ad: 9.99e-01 Dobj:  2.0405132e+00
Iter: 16 Ap: 9.60e-01 Pobj:  2.0405132e+00 Ad: 9.50e-01 Dobj:  2.0405132e+00
Success: SDP solved
Primal objective value: 2.0405132e+00
Dual objective value: 2.0405132e+00
Relative primal infeasibility: 8.15e-16
Relative dual infeasibility: 9.54e-10
Real Relative Gap: 5.70e-10
XZ Relative Gap: 2.68e-09
DIMACS error measures: 1.11e-15 0.00e+00 4.51e-09 0.00e+00 5.70e-10 2.68e-09
Elements time: 0.000536
Factor time: 0.000250
Other time: 0.058147
Total time: 0.058933
0.011u 0.007s 0:00.18 5.5%      0+0k 5008+16io 26pf+0w

ans =

    2.5742
    1.5650
...

The error message that you got is a very odd one.  I can't figure out
what in the line in question could possibly be a sparse array, but
fprintf is complaining that one of its arguments is a sparse array!
First, to make sure that we are testing the same case, I would ask you
to start a new MATLAB session, load mdlSave.mat, and then call csdp()
just as I did.  If it still fails, then I would ask you to turn on the
MATLAB debugger with

dbstop if error

and rerun it.  If the error occurs again, then you can just type

fid
i
c(i)

to see the values of these variables as they were when fprintf() was
called and to see which of them might have been a sparse array.

-- 
Brian Borchers                          borchers at nmt.edu
Department of Mathematics      http://www.nmt.edu/~borchers/
New Mexico Tech                       Phone: (575) 322-2592
Socorro, NM 87801                   FAX: (575) 835-5366




More information about the Csdp mailing list