Mercurial > hg > audiodb
changeset 276:5c34b71c5ffa sampling
Restore static decoration to yfun and yinv.
author | mas01cr |
---|---|
date | Tue, 01 Jul 2008 09:00:29 +0000 |
parents | 1c76d5f41708 |
children | d9dba57becd4 |
files | sample.cpp |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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 <gsl/gsl_sf.h> -// 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);