projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed 'Written by' line
[pspp-builds.git]
/
lib
/
gsl-extras
/
hypergeometric.c
diff --git
a/lib/gsl-extras/hypergeometric.c
b/lib/gsl-extras/hypergeometric.c
index 5e4d181ce2852f1e29e047f633299001eb144fe5..67b757b2f93d6a0389d13b004c0df4b9dbc7a31e 100644
(file)
--- a/
lib/gsl-extras/hypergeometric.c
+++ b/
lib/gsl-extras/hypergeometric.c
@@
-1,6
+1,7
@@
/* cdf/hypergeometric.c
*
/* cdf/hypergeometric.c
*
- * Copyright (C) 2004 Jason H. Stover.
+ * Copyright (C) 2004 Free Software Foundation, Inc.
+ *
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-14,7
+15,7
@@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 5
9 Temple Place, Suite 330, Boston, MA 02111-1307
, USA.
+ * Foundation, Inc., 5
1 Franklin Street, Fifth Floor, Boston, MA 02110-1301
, USA.
*/
/*
*/
/*
@@
-28,7
+29,7
@@
*
* References:
*
*
* References:
*
- * T. Wu. An accurate computation of the hypergeometric distribution
+ * T. Wu. An accurate computation of the hypergeometric distribution
* function. ACM Transactions on Mathematical Software. Volume 19, number 1,
* March 1993.
* This algorithm is not used, since it requires factoring the
* function. ACM Transactions on Mathematical Software. Volume 19, number 1,
* March 1993.
* This algorithm is not used, since it requires factoring the
@@
-37,9
+38,8
@@
* time than the algorithm used here.
*
* W. Feller. An Introduction to Probability Theory and Its Applications,
* time than the algorithm used here.
*
* W. Feller. An Introduction to Probability Theory and Its Applications,
- * third edition. 1968. Chapter 2, section 6.
+ * third edition. 1968. Chapter 2, section 6.
*/
*/
-#include <config.h>
#include <math.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_errno.h>
#include <math.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_errno.h>
@@
-51,7
+51,7
@@
* Pr (X <= k)
*/
double
* Pr (X <= k)
*/
double
-gslextras_cdf_hypergeometric_P (const unsigned int k,
+gslextras_cdf_hypergeometric_P (const unsigned int k,
const unsigned int n0,
const unsigned int n1,
const unsigned int t)
const unsigned int n0,
const unsigned int n1,
const unsigned int t)
@@
-125,7
+125,7
@@
gslextras_cdf_hypergeometric_P (const unsigned int k,
* Pr (X > k)
*/
double
* Pr (X > k)
*/
double
-gslextras_cdf_hypergeometric_Q (const unsigned int k,
+gslextras_cdf_hypergeometric_Q (const unsigned int k,
const unsigned int n0,
const unsigned int n1,
const unsigned int t)
const unsigned int n0,
const unsigned int n1,
const unsigned int t)
@@
-153,7
+153,7
@@
gslextras_cdf_hypergeometric_Q (const unsigned int k,
P = 0.0;
mode = (int) t*n0 / (n0+n1);
relerr = 1.0;
P = 0.0;
mode = (int) t*n0 / (n0+n1);
relerr = 1.0;
-
+
if(k < mode)
{
i = mode;
if(k < mode)
{
i = mode;