52 #include <R_ext/Boolean.h>
54 #include <R_ext/BLAS.h>
63 typedef void integr_fn(
double *x,
int n,
void *ex);
66 void Rdqags(integr_fn f,
void *ex,
double *a,
double *b,
67 double *epsabs,
double *epsrel,
68 double *result,
double *abserr,
int *neval,
int *ier,
69 int *limit,
int *lenw,
int *last,
int *iwork,
double *work);
71 void Rdqagi(integr_fn f,
void *ex,
double *bound,
int *inf,
72 double *epsabs,
double *epsrel,
73 double *result,
double *abserr,
int *neval,
int *ier,
74 int *limit,
int *lenw,
int *last,
75 int *iwork,
double *work);
78 void rcont2(
int *nrow,
int *ncol,
int *nrowt,
int *ncolt,
int *ntotal,
79 double *fact,
int *jwork,
int *matrix);
82 typedef double optimfn(
int,
double *,
void *);
83 typedef void optimgr(
int,
double *,
double *,
void *);
85 void vmmin(
int n,
double *b,
double *Fmin,
86 optimfn fn, optimgr gr,
int maxit,
int trace,
87 int *mask,
double abstol,
double reltol,
int nREPORT,
88 void *ex,
int *fncount,
int *grcount,
int *fail);
89 void nmmin(
int n,
double *Bvec,
double *X,
double *Fmin, optimfn fn,
90 int *fail,
double abstol,
double intol,
void *ex,
91 double alpha,
double bet,
double gamm,
int trace,
92 int *fncount,
int maxit);
93 void cgmin(
int n,
double *Bvec,
double *X,
double *Fmin,
94 optimfn fn, optimgr gr,
95 int *fail,
double abstol,
double intol,
void *ex,
96 int type,
int trace,
int *fncount,
int *grcount,
int maxit);
97 void lbfgsb(
int n,
int m,
double *x,
double *l,
double *u,
int *nbd,
98 double *Fmin, optimfn fn, optimgr gr,
int *fail,
void *ex,
99 double factr,
double pgtol,
int *fncount,
int *grcount,
100 int maxit,
char *msg,
int trace,
int nREPORT);
101 void samin(
int n,
double *pb,
double *yb, optimfn fn,
int maxit,
102 int tmax,
double ti,
int trace,
void *ex);
109 void bakslv(
double *,
int *,
int *,
110 double *,
int *,
int *,
111 double *,
int *,
int *);
114 void bincode (
double *x,
int *n,
double *breaks,
int *nb,
115 int *code,
int *right,
int *include_border,
int *naok);
116 void bincount(
double *x,
int *n,
double *breaks,
int *nb,
int *count,
117 int *right,
int *include_border,
int *naok);
120 void F77_NAME(ch2inv)(
double *x,
int *ldx,
int *n,
double *v,
int *info);
123 void F77_NAME(chol)(
double *a,
int *lda,
int *n,
double *v,
int *info);
126 void R_cpolyroot(
double *opr,
double *opi,
int *degree,
127 double *zeror,
double *zeroi, Rboolean *fail);
139 void R_cumsum(
double *,
int *,
double *,
double *);
142 int F77_NAME(cg)(
int *nm,
int *n,
double *ar,
double *ai,
143 double *wr,
double *wi,
int *matz,
double *zr,
double *zi,
144 double *fv1,
double *fv2,
double *fv3,
int *ierr);
145 int F77_NAME(ch)(
int *nm,
int *n,
double *ar,
double *ai,
146 double *w,
int *matz,
double *zr,
double *zi,
147 double *fv1,
double *fv2,
double *fm1,
int *ierr);
148 int F77_NAME(rg)(
int *nm,
int *n,
double *a,
double *wr,
double *wi,
149 int *matz,
double *z,
int *iv1,
double *fv1,
int *ierr);
151 int F77_NAME(rs)(
int *nm,
int *n,
double *a,
double *w,
152 int *matz,
double *z,
double *fv1,
double *fv2,
int *ierr);
160 void fft_factor(
int n,
int *pmaxf,
int *pmaxp);
161 Rboolean fft_work(
double *a,
double *b,
int nseg,
int n,
int nspn,
162 int isn,
double *work,
int *iwork);
165 double Brent_fmin(
double ax,
double bx,
double (*f)(
double,
void *),
166 void *info,
double tol);
170 int F77_SUB(interv)(
double *xt,
int *n,
double *x,
171 Rboolean *rightmost_closed, Rboolean *all_inside,
172 int *ilo,
int *mflag);
173 void find_interv_vec(
double *xt,
int *n,
double *x,
int *nx,
174 int *rightmost_closed,
int *all_inside,
int *indx);
176 int findInterval(
double *xt,
int n,
double x,
177 Rboolean rightmost_closed, Rboolean all_inside,
int ilo,
181 void setulb(
int n,
int m,
double *x,
double *l,
double *u,
int *nbd,
182 double *f,
double *g,
double factr,
double *pgtol,
183 double *wa,
int * iwa,
char *task,
int iprint,
184 int *lsave,
int *isave,
double *dsave);
187 void machar(
int *ibeta,
int *it,
int *irnd,
int *ngrd,
int *machep,
188 int *negep,
int *iexp,
int *minexp,
int *maxexp,
189 double *eps,
double *epsneg,
double *xmin,
double *xmax);
192 void R_max_col(
double *matrix,
int *nr,
int *nc,
int *maxes,
int *ties_meth);
196 double R_pretty0(
double *lo,
double *up,
int *ndiv,
int min_n,
197 double shrink_sml,
double high_u_fact[],
198 int eps_correction,
int return_bounds);
199 void R_pretty(
double *lo,
double *up,
int *ndiv,
int *min_n,
200 double *shrink_sml,
double *high_u_fact,
201 int *eps_correction);
204 void R_rowsum(
int *dim,
double *na_x,
double *x,
double *group);
207 Rboolean stemleaf(
double *x,
int *n,
double *scale,
int *width,
double *atom);
210 void str_signif(
char *x,
int *n,
const char **type,
int *width,
int *digits,
211 const char **format,
const char **flag,
char **result);
214 void R_tabulate(
int *x,
int *n,
int *nbin,
int *ans);
219 typedef void (*fcn_p)(int,
double *,
double *,
void *);
222 typedef void (*d2fcn_p)(int, int,
double *,
double *,
void *);
224 void fdhess(
int n,
double *x,
double fval, fcn_p fun,
void *state,
225 double *h,
int nfd,
double *step,
double *f,
int ndigit,
229 void optif9(
int nr,
int n,
double *x,
230 fcn_p fcn, fcn_p d1fcn, d2fcn_p d2fcn,
231 void *state,
double *typsiz,
double fscale,
int method,
232 int iexp,
int *msg,
int ndigit,
int itnlim,
int iagflg,
233 int iahflg,
double dlt,
double gradtl,
double stepmx,
234 double steptl,
double *xpls,
double *fpls,
double *gpls,
235 int *itrmcd,
double *a,
double *wrk,
int *itncnt);
237 void optif0(
int nr,
int n,
double *x, fcn_p fcn,
void *state,
238 double *xpls,
double *fpls,
double *gpls,
int *itrmcd,
239 double *a,
double *wrk);
242 double R_zeroin(
double ax,
double bx,
double (*f)(
double,
void *),
void *info,
243 double *Tol,
int *Maxit);
246 double R_zeroin2(
double ax,
double bx,
double fa,
double fb,
247 double (*f)(
double,
void *),
void *info,
double *Tol,
int *Maxit);
281 void F77_NAME(dqrdc2)(
double *x,
int *ldx,
int *n,
int *p,
282 double *tol,
int *rank,
283 double *qraux,
int *pivot,
double *work);
284 void F77_NAME(dqrls)(
double *x,
int *n,
int *p,
double *y,
int *ny,
285 double *tol,
double *b,
double *rsd,
287 int *jpvt,
double *qraux,
double *work);
290 void F77_NAME(dqrqty)(
double *x,
int *n,
int *k,
double *qraux,
291 double *y,
int *ny,
double *qty);
292 void F77_NAME(dqrqy)(
double *x,
int *n,
int *k,
double *qraux,
293 double *y,
int *ny,
double *qy);
294 void F77_NAME(dqrcf)(
double *x,
int *n,
int *k,
double *qraux,
295 double *y,
int *ny,
double *b,
int *info);
296 void F77_NAME(dqrrsd)(
double *x,
int *n,
int *k,
double *qraux,
297 double *y,
int *ny,
double *rsd);
298 void F77_NAME(dqrxb)(
double *x,
int *n,
int *k,
double *qraux,
299 double *y,
int *ny,
double *xb);