Simplex method problems...
inscara
07-21-2004, 02:10 PM
Hi,
I'm using code from second edition of Numerical Recipes in C extracted from the book (pp. 439-443). I'm using the examples on p. 438 (tableau 10.8.18), but the algorhitm enter in an infinite loop. Is there any errata for the code???
Thanks in advance !!!
Best regards.-
Saul Teukolsky
07-22-2004, 12:29 PM
There was a major bug fix for simplx in v 2.08 (i.e. in going from
v. 2.06 to v.2.08). If your printing of the book is earlier than 2.08
(look on p.iv to check), you'll have to look at the text version of
the upgrade files on www.nr.com to figure out what was changed.
Much easier if you have the downloaded software itself.
Saul Teukolsky
inscara
07-22-2004, 01:41 PM
Thank you very much for the answer. But I've checked the version of the soft in the book and it states "This reprinting is corrected to software version 2.08". I've typed the code from the book, and revised it several times to discard typing errors. So I don't know what could be wrong. However, I've found some pitfalls running the code step-by-step into the debbuger. One of this was something like that:
if (q < q1) {
...
}
what I need to change to:
if (q < q1 && fabs(q-q1) > EPS) {
...
}
because I've seen that with the sample data the condition was true but the difference was less than EPS.
Any suggestion???
Best regards.-
Saul Teukolsky
07-23-2004, 07:57 AM
Sorry, can't help you. The code can certainly solve the
test problem, so you're obviously doing something wrong.
Saul Teukolsky
inscara
08-04-2004, 07:36 AM
Originally posted by Saul Teukolsky
Sorry, can't help you. The code can certainly solve the
test problem, so you're obviously doing something wrong.
Saul Teukolsky
Ok. Thank you very much. I'm going to check my transcription again.
Best regards.