summaryrefslogtreecommitdiff
path: root/numlib/powell.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-07-11 22:20:14 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-07-11 22:20:14 +0200
commit7beb00cd8d28c3d5893ce3db907a828d64afdea9 (patch)
tree395a3dee2fe197b8284dee02c5f527889df78413 /numlib/powell.h
parente2d30e0583c047a4bedf4c8d0c86320f1b3fd8ed (diff)
parenta0442ed58dee48a521ea053083ea967894507898 (diff)
Update upstream source from tag 'upstream/2.0.1+repack'
Update to upstream version '2.0.1+repack' with Debian dir 6edb5dd2df9aca152662fc4a8f72bd6d86f8552e
Diffstat (limited to 'numlib/powell.h')
-rwxr-xr-xnumlib/powell.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/numlib/powell.h b/numlib/powell.h
index 4b86573..642cb65 100755
--- a/numlib/powell.h
+++ b/numlib/powell.h
@@ -15,6 +15,8 @@
extern "C" {
#endif
+#define DFUNC_NRV 1e100
+
/* Standard interface for powell function */
/* return 0 on sucess, 1 on failure due to excessive itterations */
/* Result will be in cp */
@@ -32,7 +34,7 @@ void (*prog)(void *pdata, int perc), /* Optional progress percentage callback *
void *pdata /* Opaque data needed by prog() */
);
-/* Conjugate Gradient optimiser */
+/* Conjugate Gradient optimiser using partial derivatives. */
/* return 0 on sucess, 1 on failure due to excessive itterations */
/* Result will be in cp */
int conjgrad(
@@ -43,7 +45,8 @@ double s[], /* Size of initial search area */
double ftol, /* Tollerance of error change to stop on */
int maxit, /* Maximum iterations allowed */
double (*func)(void *fdata, double tp[]), /* Error function to evaluate */
-double (*dfunc)(void *fdata, double dp[], double tp[]), /* Gradient function to evaluate */
+double (*dfunc)(void *fdata, double dp[], double tp[]), /* Gradient & function to evaluate */
+ /* dfunc() should return DFUNC_NRV if it doesn't return function value */
void *fdata, /* Opaque data needed by function */
void (*prog)(void *pdata, int perc), /* Optional progress percentage callback */
void *pdata /* Opaque data needed by prog() */
@@ -69,6 +72,22 @@ double (*func)(void *fdata, double tp[]), /* Error function to evaluate */
void *fdata /* Opaque data for func() */
);
+/* Line bracketing and minimisation routine using derivatives. */
+/* Return value at minimum. */
+double linmind(
+double cp[], /* Start point, and returned value */
+double xi[], /* Search vector */
+int di, /* Dimensionality */
+#ifdef ABSTOL
+double ftol, /* Absolute tolerance to stop on */
+#else
+double ftol, /* Relative tolerance to stop on */
+#endif
+double (*func)(void *fdata, double tp[]), /* Error function to evaluate */
+double (*dfunc)(void *fdata, double dp[], double tp[]), /* Gradient & function to evaluate */
+void *fdata /* Opaque data for func() */
+);
+
#ifdef __cplusplus
}
#endif