modified: src1/input.c
[GalaxyCodeBases.git] / c_cpp / lib / klib / kmath.h
blob1815a14c8acac37c5008f3903cbc589dc6994ef0
1 #ifndef AC_KMATH_H
2 #define AC_KMATH_H
4 #include <stdint.h>
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
10 /**************************
11 * Non-linear programming *
12 **************************/
14 #define KMIN_RADIUS 0.5
15 #define KMIN_EPS 1e-7
16 #define KMIN_MAXCALL 50000
18 typedef double (*kmin_f)(int, double*, void*);
19 typedef double (*kmin1_f)(double, void*);
21 double kmin_hj(kmin_f func, int n, double *x, void *data, double r, double eps, int max_calls); // Hooke-Jeeves'
22 double kmin_brent(kmin1_f func, double a, double b, void *data, double tol, double *xmin); // Brent's 1-dimenssion
24 /*********************
25 * Special functions *
26 *********************/
28 double kf_lgamma(double z); // log gamma function
29 double kf_erfc(double x); // complementary error function
30 double kf_gammap(double s, double z); // regularized lower incomplete gamma function
31 double kf_gammaq(double s, double z); // regularized upper incomplete gamma function
32 double kf_betai(double a, double b, double x); // regularized incomplete beta function
34 #ifdef __cplusplus
36 #endif
38 #endif