Originally posted by: PingLiu
I am using the following code to create a LP file for a problem, why is the LP(attached) different from the original problem defined by Aeq, Aineq, beq, bineq, lb, ub, ctype? For example, the bounds in LP file has 71 variables, but the actual problem has only 38 vars. CPLEX version is 12.6.2 (64 bit), MATLAB version is R2011b. OS is windows 7 64 bit.
options = cplexoptimset('cplex');
options.Display = 'on';
options.exportmodel = 'model.lp';
[x, fval, exitflag, output] = cplexmilp (f', Aineq, bineq', Aeq, beq',...
[ ], [ ], [ ], lb', ub', ctype, [ ], options);
***************************************************************************
If I am using another method to create the lp file, then the error would be generated.
cplex=Cplex('enr');
cplex.Model.sense = 'minimize';
cplex.addCols(f',[],lb',ub',ctype);
cplex.addRows([-inf*ones(length(bineq),1);beq'], [Aineq;Aeq], [bineq';beq']);
cplex.writeModel('enr.lp');
-------------------------------------------
Error using vertcat
The following error occurred converting from double to single:
Error using single
Attempt to convert to unimplemented sparse type
Error in
C:\IBM\ILOG\CPLEX_Studio1262\cplex\matlab\x64_win64\@Cplex\Cplex.p>Cplex.addRows
(line 2502)
Error in
C:\IBM\ILOG\CPLEX_Studio1262\cplex\matlab\x64_win64\@Cplex\Cplex.p>Cplex.subsref
(line 3975)
Error in CplexSol (line 32)
cplex.addRows([-inf*ones(length(bineq),1);beq'], [Aineq;Aeq], [bineq';beq']);
#CPLEXOptimizers#DecisionOptimization