1 #include <R.h>
2 #include <Rinternals.h>
3 #include <R_ext/Rdynload.h>
4 
5 void tseries_pp_sum (double* u, int* n, int* l, double* sum);
6 void tseries_quad_map (double *x, double *xi, double *a, int *n);
7 void tseries_arma (double *x, double *u, double *a, int *ar, int *ma,
8 		   int *arl, int *mal, int *max, int *n, int *intercept);
9 void tseries_bdstest_main (int *N, int *M, double *x, double *c,
10 			   double *cstan, double *EPS, int *TRACE);
11 void tseries_boot (double *x, double *xb, int *n, double *b, int *type);
12 void tseries_fit_garch (double *y, int *n, double *par, int *p, int *q,
13 			int *itmax, double *afctol, double *rfctol,
14 			double *xctol, double *xftol, double *fret,
15 			int *agrad, int *trace);
16 void tseries_ophess_garch (double *y, int *n, double *par, double *he,
17 			   int *p, int *q);
18 void tseries_pred_garch (double *y, double *h, int *n, double *par,
19 			 int *p, int *q, int *genuine);
20 
21 static const R_CMethodDef CEntries[] = {
22     {"tseries_pp_sum", (DL_FUNC) &tseries_pp_sum, 4},
23     {"tseries_quad_map", (DL_FUNC) &tseries_quad_map, 4},
24     {"tseries_arma", (DL_FUNC) &tseries_arma, 10},
25     {"tseries_bdstest_main", (DL_FUNC) &tseries_bdstest_main, 7},
26     {"tseries_boot", (DL_FUNC) &tseries_boot, 5},
27     {"tseries_fit_garch", (DL_FUNC) &tseries_fit_garch, 13},
28     {"tseries_ophess_garch", (DL_FUNC) &tseries_ophess_garch, 6},
29     {"tseries_pred_garch", (DL_FUNC) &tseries_pred_garch, 7},
30     {NULL, NULL, 0}
31 };
32 
R_init_tseries(DllInfo * dll)33 void R_init_tseries(DllInfo *dll)
34 {
35     R_registerRoutines(dll, CEntries, NULL, NULL, NULL);
36     R_useDynamicSymbols(dll, FALSE);
37 }
38