![]() |
|
#1
|
|||
|
|||
|
Simplex method problems...
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.- |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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:
Code:
if (q < q1) {
...
}
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.- |
|
#4
|
|||
|
|||
|
Sorry, can't help you. The code can certainly solve the
test problem, so you're obviously doing something wrong. Saul Teukolsky |
|
#5
|
|||
|
|||
|
Quote:
Best regards. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|