Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Saikat's re-entrant nlm

git-svn-id: https://svn.r-project.org/R/branches/R-exp-uncmin@6956 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
commit a9fcb343ce2e25b1365ac337e5618e8b4ef5186d 1 parent c5be020
bates authored
View
4 src/appl/ROUTINES
@@ -47,13 +47,13 @@ F77_SUBROUTINE(dtrco)
#
C_FUNCTION(fft_factor)
C_FUNCTION(fft_work)
-F77_SUBROUTINE(fdhess)
+C_FUNCTION(fdhess)
F77_SUBROUTINE(fmin)
F77_SUBROUTINE(lminfl)
C_FUNCTION(loglin)
C_FUNCTION(lowess)
C_FUNCTION(massdist)
-F77_SUBROUTINE(optif9)
+C_FUNCTION(optif9)
C_FUNCTION(pretty)
C_FUNCTION(rowsum)
C_FUNCTION(zeroin)
View
7 src/appl/uncmin.c
@@ -5,6 +5,7 @@
#include <math.h>
#include "S.h"
+#include "Applic.h"
#ifndef max
#define max(a, b) ((a) < (b) ? (b) : (a))
@@ -13,12 +14,6 @@
#define min(a, b) ((a) > (b) ? (b) : (a))
#endif
-/* type of pointer to the target and gradient functions */
-typedef void (*fcn_p)(int, double *, double *, void *);
-
-/* type of pointer to the hessian functions */
-typedef void (*d2fcn_p)(int, int, double *, double *, void *);
-
extern double d1mach(int);
extern int i1mach(int);
View
35 src/include/Applic.h
@@ -156,6 +156,29 @@ void tabulate(int *x, int *n, int *ans);
int F77_SYMBOL(result)(int *nr, int *n, double *x, double *f, double *g,
double *a, double *p, int *itncnt, int *iflg, int *ipr);
+/* uncmin.c : */
+
+/* type of pointer to the target and gradient functions */
+typedef void (*fcn_p)(int, double *, double *, void *);
+
+/* type of pointer to the hessian functions */
+typedef void (*d2fcn_p)(int, int, double *, double *, void *);
+
+void fdhess(int n, double *x, double fval, fcn_p fun, void *state,
+ double *h, int nfd, double *step, double *f, int ndigit,
+ double *typx);
+
+void optif9(int nr, int n, double *x, fcn_p fcn, fcn_p d1fcn, d2fcn_p
+ d2fcn, void *state, double *typsiz, double fscale, int
+ method, int iexp, int *msg, int ndigit, int itnlim, int iagflg,
+ int iahflg, double dlt, double gradtl, double stepmx,
+ double steptl, double *xpls, double *fpls, double *gpls,
+ int *itrmcd, double *a, double *wrk, int *itncnt);
+
+void optif0(int nr, int n, double *x, fcn_p fcn, void *state,
+ double *xpls, double *fpls, double *gpls, int *itrmcd,
+ double *a, double *wrk);
+
/* ALL ../appl/<foobar>.f [semi-automatically by
* f2c -A -P *.f; cat *.P > all.h and editing]
@@ -227,18 +250,6 @@ int F77_SYMBOL(dtrsl)(double *t, int *ldt, int *n, double *b, int *job,
double F77_SYMBOL(fmin)(double *ax, double *bx, D_fp f, double *tol);
int F77_SYMBOL(lminfl)(double *x, int *ldx, int *n, int *k, double *qraux,
double *resid, double *hat, double *coef, double *sigma);
-/* Only exported headers from ../appl/uncmin.f : */
-int F77_SYMBOL(fdhess)(int *n, double *x, double *fval,
- S_fp fun, double *h__, int *nfd,
- double *step, double *f, int *ndigit, double *typx);
-int F77_SYMBOL(optif9)(int *nr, int *n, double *x,
- S_fp fcn, S_fp d1fcn, S_fp d2fcn, double *typsiz,
- double *fscale, int *method, int *iexp, int *msg,
- int *ndigit, int *itnlim, int *iagflg, int *iahflg,
- int *ipr, double *dlt, double *gradtl,
- double *stepmx, double *steptl,
- double *xpls, double *fpls, double *gpls,
- int *itrmcd, double *a, double *wrk, int *itncnt);
double zeroin(double ax, double bx, double (*f)(double, void *), void *info,
double *tol, int *maxit);
View
17 src/main/optimize.c
@@ -221,23 +221,6 @@ SEXP do_zeroin(SEXP call, SEXP op, SEXP args, SEXP rho)
/* General Nonlinear Optimization */
-/* type of pointer to the target and gradient functions */
-typedef void (*fcn_p)(int, double *, double *, void *);
-
-/* type of pointer to the hessian functions */
-typedef void (*d2fcn_p)(int, int, double *, double *, void *);
-
-/* These two functions are defined in ../appl/uncmin.c */
-
-extern void fdhess(int, double *, double, fcn_p, void *, double *,
- int, double *, double *, int, double *);
-
-extern void optif9(int, int, double *, fcn_p, fcn_p, d2fcn_p, void *,
- double *, double, int, int, int *, int, int, int,
- int, double, double, double, double, double *,
- double *, double *, int *, double *, double *, int *);
-
-
#define FT_SIZE 5 /* default size of table to store computed
function values */
Please sign in to comment.
Something went wrong with that request. Please try again.