Numerical Recipes Forum  

Go Back   Numerical Recipes Forum > Numerical Recipes Third Edition Forum > General Problems in Using NR3

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-07-2009, 11:37 AM
SimonG SimonG is offline
Registered User
 
Join Date: Aug 2009
Posts: 2
Minor bug in markovgen?

Hi,

In Section 16.3, in function markovgen, in the line 11 from the bottom (r=ran.doub() / cum[j][m-1]), I believe that the "/" (divide) should be a " * " (multiply).

Otherwise any error in the normalizations gets amplified rather than corrected!

Simon
Reply With Quote
  #2  
Old 08-17-2009, 02:56 PM
Bill Press Bill Press is offline
Numerical Recipes Author
 
Join Date: Jan 2002
Posts: 227
Yes, you are correct. Thanks for finding this. Other users may take note that this bug only affects the case of the function attempting to recover from questionable user input (row sums not being exactly 1).

Cheers,
Bill P.
Reply With Quote
Reply

Tags
bug, markov, markovgen

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:34 PM.


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