old_options = sdpsettings
sdpsettings(old_options,'cplex.timelimit',timelimit)
>> which cplex
'cplex' not found.
>> ops = sdpsettings;
>> ops.cplex
ans =
presol: 1
niter: 1
epgap: 1.0000e-04
epagap: 1.0000e-06
relobjdif: 0
objdif: 0
tilim: 1.0000e+75
logfile: 0
param: [1x1 struct]
>> addpath(genpath('C:\Program Files\IBM\ILOG\CPLEX_Enterprise_Server126\CPLEX_Studio\cplex\matlab'))
>> ops = sdpsettings;
>> ops.cplex
ans =
advance: 1
barrier: [1x1 struct]
clocktype: 2
conflict: [1x1 struct]
dettimelimit: 1.0000e+75
distmip: [1x1 struct]
emphasis: [1x1 struct]
feasopt: [1x1 struct]
lpmethod: 0
mip: [1x1 struct]
network: [1x1 struct]
...
Hm, I guess I didn't explain myself properly...
I hope I'm using recent enough cplex version, and it does show timelimit as the option within
>> solvers=getavailablesolvers(0);>> solvers(2)
ans =
tag: 'CPLEX' version: 'IBM' subversion: '12.5' checkfor: {'cplexqcp.m' 'cplexlink125'} testcode: {''} call: 'call_cplexibm_qcmiqp' subcall: '' show: 1 usesother: 0 supportsinitial: 0 supportsinitialNAN: 0 objective: [1x1 struct] constraint: [1x1 struct] dual: 1 complex: 0 interval: 0 parametric: 0 evaluation: 0 uncertain: 0
>> which cplex
/apps/numerics/matlab_toolboxes/cplex-ibm/@Cplex/Cplex.p % Cplex constructor
>> ops = sdpsettings;
>> ops.cplex
ans =
advance: 1
barrier: [1x1 struct]
clocktype: 2
conflict: [1x1 struct]
dettimelimit: 1.0000e+75
emphasis: [1x1 struct]
feasopt: [1x1 struct]
lpmethod: 0
mip: [1x1 struct]
output: [1x1 struct]
parallel: 0
preprocessing: [1x1 struct]
qpmethod: 0
randomseed: 201207272
read: [1x1 struct]
sifting: [1x1 struct]
simplex: [1x1 struct]
solutiontarget: 0
threads: 0
timelimit: 1.0000e+75
tune: [1x1 struct]
workdir: '.'
workmem: 128
diagnostics: 'off'
exportmodel: ''
The problem is that when I try modifying it using YALMIP sdpsettings function, it produces an error:
>> sdpsettings(ops,'cplex.timelimit',1)
Error using sdpsettings (line 1655)
Unrecognized property name 'cplex.timelimit'.
While if I try using the old syntax, it passes through:
>> newops = sdpsettings(ops,'cplex.tilim',1);
>> newops.cplex
ans =
advance: 1
barrier: [1x1 struct]
clocktype: 2
conflict: [1x1 struct]
dettimelimit: 1.0000e+75
emphasis: [1x1 struct]
feasopt: [1x1 struct]
lpmethod: 0
mip: [1x1 struct]
output: [1x1 struct]
parallel: 0
preprocessing: [1x1 struct]
qpmethod: 0
randomseed: 201207272
read: [1x1 struct]
sifting: [1x1 struct]
simplex: [1x1 struct]
solutiontarget: 0
threads: 0
timelimit: 1.0000e+75
tune: [1x1 struct]
workdir: '.'
workmem: 128
diagnostics: 'off'
exportmodel: ''
tilim: 1
This is the reason I haven't caught on to this for so long. When I checked what's happening inside the sdpsettings, I saw that by the point when you check the option name, you compare it somehow with the "names" list for option names, that seems to contain tilim.
ops = sdpsettings;
ops.cplex.timelimit = 1;