view scripts/optimization/glpktest2 @ 17495:995decfed6cc

guidata.m: Overhaul function to use modern Octave conventions. * scripts/plot/guidata.m: Match variable names in function header to documentation. Place input validation first. Add %!error input validation blocks.
author Rik <rik@octave.org>
date Wed, 25 Sep 2013 10:23:30 -0700
parents 652e8aa49fa7
children
line wrap: on
line source

clear;

disp('2nd problem');
s=1;
c=[-1,-1]';
a=[-2,5;2,-2];
b=[5;1];
ctype=['U','U']';
lb=[0;0]; ub=[];
vartype=['I';'I'];
param.msglev=1;
[xmin,fmin,status,extra]=glpk(c,a,b,lb,ub,ctype,vartype,s,param)
[xmin,fmin,status,extra]=glpkmex(s,c,a,b,ctype,lb,ub,vartype,param)
pause;

disp('3rd problem');
s=1;
c=[0 0 0 -1 -1]';
a=[-2 0 0 1 0;...
    0 1 0 0 2;...
    0 0 1 3 2];
b=[4 12 18]';
ctype=['S','S','S']';
lb=[0,0,0,0,0]'; ub=[];
vartype=['C','C','C','C','C']';
[xmin,fmin,status,extra]=glpk(c,a,b,lb,ub,ctype,vartype,s)
[xmin,fmin,status,extra]=glpkmex(s,c,a,b,ctype,lb,ub,vartype)