Why do I receive errors when using the LINPROG function in the Optimization Toolbox for a dense linear algebra problem?

I run the following code:
load DataFile % you can find this file in the attachment
options = optimset(options, 'Display','iter');
X=linprog(f,[],[],Aeq,Beq,LB,UB,[],options)
I receive the following error message:
??? Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> optim\private\lipsol>sherman at 1475
tmp = U * (Mdense \ (U' * x));
Error in ==> optim\private\lipsol>densol at 1422
[x,Mdense,Rinf] = sherman(P,U,b,flag,Mdense,perm,Rinf);
Error in ==> optim\private\lipsol at 684
[x,Sherman_OK,Mdense,Rinf,cgiter] = ...
Error in ==> linprog at 212
[x,fval,lambda,exitflag,output] =
lipsol(f,A,B,Aeq,Beq,lb,ub,options,defaultopt,computeLambda);

 采纳的回答

This is a bug in the way that the LINPROG function in Optimization Toolbox handles dense columns in large scale constraint matrices.
To work around this issue, try the medium-scale simplex algorithm. Use OPTIMSET to set the "LargeScale" option to 'off' and the "Simplex" option to 'on', as shown below:
options = optimset(options, 'Display','iter','LargeScale','off','simplex','on');
X=linprog(f,[],[],Aeq,Beq,LB,UB,[],options)
To use the medium-scale algorithm involving the QPSUB function, just set the "LargeScale" option to "off":
options = optimset(options, 'Display','iter','LargeScale','off');
X=linprog(f,[],[],Aeq,Beq,LB,UB,[],options)

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Linear Programming and Mixed-Integer Linear Programming 的更多信息

产品

版本

R14SP2

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by