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);

 Réponse acceptée

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)

Plus de réponses (0)

Catégories

En savoir plus sur Linear Programming and Mixed-Integer Linear Programming dans Centre d'aide et File Exchange

Produits

Version

R14SP2

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by