Numerical Recipes Forum  

Go Back   Numerical Recipes Forum > Obsolete Editions Forum > General Problems in Using NR

Reply
 
Thread Tools Display Modes
  #1  
Old 07-21-2004, 02:10 PM
inscara inscara is offline
Member
 
Join Date: Jul 2004
Posts: 3
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.-
Reply With Quote
  #2  
Old 07-22-2004, 12:29 PM
Saul Teukolsky Saul Teukolsky is offline
Numerical Recipes Author
 
Join Date: Dec 2001
Posts: 211
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
Reply With Quote
  #3  
Old 07-22-2004, 01:41 PM
inscara inscara is offline
Member
 
Join Date: Jul 2004
Posts: 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) {
   ...
}
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.-
Reply With Quote
  #4  
Old 07-23-2004, 07:57 AM
Saul Teukolsky Saul Teukolsky is offline
Numerical Recipes Author
 
Join Date: Dec 2001
Posts: 211
Sorry, can't help you. The code can certainly solve the
test problem, so you're obviously doing something wrong.

Saul Teukolsky
Reply With Quote
  #5  
Old 08-04-2004, 07:36 AM
inscara inscara is offline
Member
 
Join Date: Jul 2004
Posts: 3
Quote:
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is On

Forum Jump


All times are GMT -5. The time now is 10:37 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.