[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lp.cc (octave-forge) problem
From: |
Ben Sapp |
Subject: |
Re: lp.cc (octave-forge) problem |
Date: |
Wed, 12 Jun 2002 09:55:27 -0500 |
Hi,
I can not duplicate your results on a Linux machine. However, the problem
seems to be worse on a Linux machine. It causes a segfault in Octave.
Clearly, this program is not operating as intended. I must admit that a
couple of weeks ago I noticed a similar problem with lp on a different
problem. Currently I have many print statements in my version of lp to try
help diagnose the problem. I still do not know what is going wrong.
Thank you for another example problem. Maybe this will help me find the
problem(s) with lp.
On Tuesday 11 June 2002 05:43 pm, A S Hodel wrote:
> I've just started trying Ben Sapp's lp.cc code (from octave-forge) on
> Mac OS X, and I'm getting some strange results. Before I dig too
> deeply, I'd like to see if these results occur on other platforms as
> well or if this is unique to the (currently experimental) .oct file work
> on Mac OS X.
>
> Here's the m-file I use to test lp: all solutions should lie within the
> range [-10,10], with the number of equality constraints increasing from
> 0 to two as the iteration goes. The results on my machine are at the
> end. Notice that the upper bound is violated and that the equality
> constraints are not enforced.
>
> If someone would run this script and let me know if my results are
> duplicated, I'd appreciate it. If they are, then I'll debug the lp.cc
> code itself. If not, then I've got something else going on that I'll
> have to figure out.
>
> Thanks.
>
> A. S. Hodel
>
> MyLpTest.m
> ============
> A = eye(2,6);
> c = [1 -2 3 -4 5 -6]';
> b = [1;1];
> lowerBound = -10*ones(size(c));
> upperBound = 10*ones(size(c));
>
> for nEqConstr = 0:2
> printf("\n\nnEqConstr=%d\n",nEqConstr);
> # compute results
> x = lp(c',A,b,lowerBound,upperBound,nEqConstr);
>
> # check against equality constraints, lower and upper bounds
> mesg = str2mat("low"," ","high");
> for ii=1:length(x)
> istr = 2 - (x(ii) < lowerBound(ii)) + (x(ii) > upperBound(ii));
> printf("%4d: %12.4g %12.4g %12.4g %s\n", ii, lowerBound(ii),
> x(ii), ...
> upperBound(ii), mesg(istr,:));
> endfor
> ConstraintCheck = A*x - b
> end
>
> ========= Output of the program: =========
>
>
> nEqConstr=0
> 1: -10 10 10
> 2: -10 21 10 high
> 3: -10 10 10
> 4: -10 30 10 high
> 5: -10 10 10
> 6: -10 30 10 high
> ConstraintCheck =
>
> 9
> 20
>
>
>
> nEqConstr=1
> 1: -10 10 10
> 2: -10 21 10 high
> 3: -10 10 10
> 4: -10 30 10 high
> 5: -10 10 10
> 6: -10 30 10 high
> ConstraintCheck =
>
> 9
> 20
>
>
>
> nEqConstr=2
> 1: -10 21 10 high
> 2: -10 21 10 high
> 3: -10 10 10
> 4: -10 30 10 high
> 5: -10 10 10
> 6: -10 30 10 high
> ConstraintCheck =
>
> 20
> 20
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
--
Ben Sapp Los Alamos National Laboratory
email: <mailto:address@hidden> Phone: (505)667-3277
Fax: (505)665-7920 URL: http://www.neutrino.lanl.gov/
--
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------