File: mygsl.h

package info (click to toggle)
iqtree 1.5.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,780 kB
  • ctags: 11,529
  • sloc: cpp: 96,162; ansic: 59,874; python: 242; sh: 189; makefile: 45
file content (57 lines) | stat: -rw-r--r-- 1,356 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

/**
	stripped GSL (GNU Scientific library) used for IQ-TREE code
*/

#ifndef _MYGSL_H
#define _MYGSL_H

#include <stdio.h>

/*
    x power n (x^n)
    @return x^n
*/
double gsl_pow_uint(double x, unsigned int n);

/*
    binomial sampling
    @param p probability
    @param n sample size
    @return random value drawn from binominal distribution 
*/
unsigned int gsl_ran_binomial (double p, unsigned int n, int *rstream);

/*
    multinomial sampling
    @param K number of categories
    @param N sample size
    @param p probability vector of length K, will be normalized to 1 if not summing up to 1
    @param[out] n output vector of length K as drawn from multinomial distribution, sum to N
*/
void gsl_ran_multinomial (const size_t K, const unsigned int N, const double p[], unsigned int n[], int *rstream);


/*
    probability density function for standard normal distribution
    @param x x-value
    @return probability density p(x)
*/
double gsl_ran_ugaussian_pdf (const double x);

/*
    cumulative distribution function for standard normal distribution 
    @param x x-value
    @return CDF at x
*/
double gsl_cdf_ugaussian_P (const double x);

/*
    quantile function for standard normal distribution (or CDF-inverse function)
    @param P probability value
    @return x-value
*/
double gsl_cdf_ugaussian_Pinv (const double P);

#endif