comparison rDiff/src/locfit/Source/mut.h @ 0:0f80a5141704

version 0.3 uploaded
author vipints
date Thu, 14 Feb 2013 23:38:36 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0f80a5141704
1 /*
2 * Copyright 1996-2006 Catherine Loader.
3 */
4 /*
5 * Headers for math utility functions.
6 */
7
8 #ifndef I_MUT_H
9 #define I_MUT_H
10
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <string.h>
14 #include <math.h>
15
16 typedef int (*prf)();
17 extern prf mut_printf;
18 extern void mut_redirect();
19
20 typedef struct {
21 double *Z; /* jacobian matrix, length p*p */
22 double *Q; /* eigenvalue matrix, length p*p */
23 double *wk; /* work vector in eig_solve, length p */
24 double *dg; /* diag vector in eigd, length p */
25 int p; /* dimension */
26 int st; /* status */
27 int sm; /* requested decomposition */
28 } jacobian;
29
30 /* m_jacob.c */
31 extern int jac_reqd();
32 extern double *jac_alloc();
33 extern void jacob_dec(), chol_dec(), eig_dec();
34 extern int jacob_solve(), chol_solve(), eig_solve();
35 extern int jacob_hsolve(),chol_hsolve(),eig_hsolve();
36 extern int jacob_isolve(),chol_isolve(),eig_isolve();
37 extern double jacob_qf(), chol_qf(), eig_qf();
38 extern int jacob_mult(), chol_mult();
39
40 /* m_max.c */
41 extern double max_grid(), max_golden(), max_quad(), max_nr();
42
43 /* maxbv.c */
44 extern double maxbvgrid(), maxbvstep(), maxquadstep(), maxbv(), maxbvq();
45
46 /* quadmin.c */
47 extern void quadmin(), project(), resproj(), conquadmin();
48
49 /* m_qr.c */
50 extern void qr(), qrinvx(), qrtinvx(), qrsolv();
51
52 /* m_svd.c */
53 extern void svd(), hsvdsolve();
54 extern int svdsolve();
55
56 /* m_solve.c */
57 extern double solve_bisect(), solve_secant(), solve_nr(), solve_fp();
58
59 /* m_vector.c */
60 extern void setzero(), unitvec(), addouter();
61 extern void matrixmultiply(), multmatscal(), transpose();
62 extern double innerprod(), m_trace(), vecsum();
63
64 #define BDF_NONE 0
65 #define BDF_EXPLEFT 1
66 #define BDF_EXPRIGHT 2
67
68 /* return codes for functions optimized by max_nr */
69 #define NR_OK 0
70 #define NR_INVALID 1
71 #define NR_BREAK 2
72 #define NR_REDUCE 3
73 #define NR_NCON 10
74 #define NR_NDIV 11
75
76
77 /* jacobian status definitions */
78 #define JAC_RAW 0
79 #define JAC_CHOL 1
80 #define JAC_EIG 2
81 #define JAC_EIGD 3
82
83 /* Numerical Integration Stuff
84 */
85 #define MXRESULT 5
86 #define MXIDIM 10 /* max. dimension */
87 extern void simpsonm(), simpson4(), integ_disc(), integ_circ();
88 extern void integ_sphere(), monte(), rn3();
89 extern double simpson(), sptarea();
90
91 /* Density, distribution stuff
92 */
93
94 #ifndef PI
95 #define PI 3.141592653589793238462643
96 #endif
97 #define S2PI 2.506628274631000502415765 /* sqrt(2*pi) */
98 #define PIx2 6.283185307179586476925286 /* 2*pi */
99 #define SQRPI 1.772453850905516027298 /* sqrt(pi) */
100 #define HF_LG_PIx2 0.918938533204672741780329736406 /* 0.5*log(2*pi) */
101 #define SQRT2 1.4142135623730950488 /* sqrt(2.0) */
102 #define gold_rat 0.6180339887498948482045870 /* (sqrt(5.0)-1)/2 */
103
104 #define LOG_ZERO -1e100
105 #define D_0 ((give_log) ? LOG_ZERO : 0.0)
106 #define D_1 ((give_log) ? 0.0 : 1.0)
107 #define DEXP(x) ((give_log) ? (x) : exp(x))
108 #define FEXP(f,x) ((give_log) ? -0.5*log(f)+(x) : exp(x)/sqrt(f))
109
110 #define INVALID_PARAMS 0.0
111
112 extern double stirlerr(), bd0();
113 extern double dbinom_raw(), dpois_raw();
114 extern double dbinom(), dpois(), dnbinom(), dbeta(), dgamma(), dt(), df(), dhyper();
115 extern double dchisq();
116
117 extern double igamma(), ibeta();
118 extern double pf(), pchisq();
119 #define pchisq(x,df) igamma((x)/2.0,(df)/2.0)
120
121 /* order.c */
122 extern void mut_order();
123
124 /* erf.c */
125 extern double mut_erf(), mut_erfc(), mut_pnorm();
126
127 /* lgamma.c */
128 extern double mut_lgamma(), mut_lgammai();
129
130 /* math.c */
131 extern double mut_exp(), mut_daws(), ptail(), logit(), expit();
132 extern int factorial();
133 #endif /* define I_MUT_H */