GalSim-developers/GalSim — Issue #3: Replacing various NR routines from SBProfile Poisson.cpp
Author: rmandelb
Created: 2012-02-24 16:31:30+00:00
State: open

SBProfile code Poisson.cpp uses some NR routines (gammp, gammq, gser, gcf) with very little alteration to build a Poisson deviate from a uniform deviate. Mike gave some references for implementing the incomplete gamma function:

http://en.wikipedia.org/wiki/Incomplete_gamma_function
http://oai.cwi.nl/oai/asset/10080/10080A.pdf
http://www.alglib.net/specialfunctions/incompletegamma.php
http://www.gnu.org/software/gsl/manual/html_node/Incomplete-Gamma-Functions.html

He points out that "The first two could be used to roll our own. The next two are GPL, so we could include those in our stack."