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

 Respuesta aceptada

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)

Más respuestas (0)

Categorías

Más información sobre Linear Programming and Mixed-Integer Linear Programming en Centro de ayuda y File Exchange.

Productos

Versión

R14SP2

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by