Path: news.mathworks.com!not-for-mail
From: "H A" <cositsjunk@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: linprog: displaying all solutions
Date: Wed, 14 May 2008 16:12:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 83
Message-ID: <g0f30j$juc$1@fred.mathworks.com>
References: <g0d64e$97i$1@fred.mathworks.com> <g0d8ae$n3k$1@fred.mathworks.com>
Reply-To: "H A" <cositsjunk@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210781523 20428 172.30.248.38 (14 May 2008 16:12:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 14 May 2008 16:12:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1385352
Xref: news.mathworks.com comp.soft-sys.matlab:468353


"helper " <spamless@nospam.com> wrote in message 
<g0d8ae$n3k$1@fred.mathworks.com>...
> 
> > options=optimset
> > 
> 
('LargeScale', 'off', 'Simplex', 'on', 'Diagnostics', 'on', 
> > 'Display', 'iter', 'MaxIter', 10000, 'TolFun', 10e-8);
> > 
> > [d,fval,exitflag]=linprog(fM,AM,bM,[],[],0,1,[],options)
> > 
> > I'd like to see all intermediate solutions of fval and 
d 
> > (my variable set) that the program generates, while it 
is 
> > converging. 
> 
> 
> 
> 
> Use the "OutputFcn" property of the options structure.  
> Check the documentation for OutputFcn.
> 
> 
> 
>  
> > I also have another related question: When I set 
display 
> > to "iter", what do the "Dual Infeasibility" values that 
> are displayed imply? 
> 
> 
> 
> 
> Searching the MATLAB doc for "Dual Infeasibility" led me 
to 
> a line that says:
> 
> Dual Infeasibility:   A'*y+z-w-f
> 
> I'm not even going to start to explain what this means 
> (because I won't be able to do it well).  But I am hoping 
> Mr. D'Errico can and will explain it (well).
> 
> 
> 

Thanks for your responses.

I tried using OutputFcn as follows:

.....................................

history.x = []; history.fval = [];

options=optimset('OutputFcn', 
@outfun, 'LargeScale', 'off', 'Simplex', 'on', 'Diagnostics'
, 'on', 'Display', 'iter', 'MaxIter', 10000, 'TolFun', 10e-
8);

[d,fval,exitflag]=linprog(fM,AM,bM,[],[],0,1,[],options);

function stop = outfun (x, optimValues, state)
    stop = false;
    switch state
        case 'iter'
            history.fval = [history.fval; optimValues.fval];
            history.x = [history.x; x];
        otherwise
    end
end

history.fval
history.x

.....................................

But both history.fval and history.x come back empty... am I 
missing something?

Thanks!
h