# HG changeset patch # User mas01cr # Date 1214902829 0 # Node ID 5c34b71c5ffa3b31fd355e5bd822f69d694ca92d # Parent 1c76d5f417086f4ab027d05298637c642a0b331f Restore static decoration to yfun and yinv. diff -r 1c76d5f41708 -r 5c34b71c5ffa sample.cpp --- a/sample.cpp Mon Jun 23 09:49:22 2008 +0000 +++ b/sample.cpp Tue Jul 01 09:00:29 2008 +0000 @@ -2,11 +2,12 @@ #include -// static +static double yfun(double d) { return gsl_sf_log(d) - gsl_sf_psi(d); } -// static + +static double yinv(double y) { double a = 1.0e-5; double b = 1000.0; @@ -16,7 +17,8 @@ double c, cy; - /* FIXME: simple binary search */ + /* FIXME: simple binary search; there's probably some clever solver + in gsl somewhere which is less sucky. */ while ((b - a) > 1.0e-5) { c = (a + b) / 2; cy = yfun(c);