From 22f703cab05b7cd368f4de9e03991b7664dc5022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 1 Sep 2014 13:56:46 +0200 Subject: Initial import of argyll version 1.5.1-8 --- numlib/dhsx.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 numlib/dhsx.h (limited to 'numlib/dhsx.h') diff --git a/numlib/dhsx.h b/numlib/dhsx.h new file mode 100644 index 0000000..828b8b2 --- /dev/null +++ b/numlib/dhsx.h @@ -0,0 +1,42 @@ +#ifndef DHSX_H +#define DHSX_H + +/* A general purpose downhill simplex multivariate optimser, */ +/* as described in */ +/* "Numerical Recipes in C", by W.H.Press, B.P.Flannery, */ +/* S.A.Teukolsky & W.T.Vetterling. */ + +#ifdef __cplusplus + extern "C" { +#endif + +/* Down hill simplex function */ +/* return err on sucess, -1.0 on failure */ +/* Result will be in cp */ +/* Arrays start at 0 */ + +/* Standard interface for optimizer function */ +/* return 0 on sucess, 1 on failure due to excessive itterations */ +/* Result will be in cp */ +/* Arrays start at 0 */ +int dhsx( +double *rv, /* If not NULL, return the residual error */ +int di, /* Dimentionality */ +double cp[], /* Initial starting point */ +double s[], /* Size of initial search area */ +double ftol, /* Tollerance of error change to stop on */ +double atol, /* Absolute return value tollerance */ +int maxit, /* Maximum iterations allowed */ +double (*funk)(void *fdata, double tp[]), /* Error function to evaluate */ +void *fdata /* Data needed by function */ +); + +double dhsx_funk( /* Return function value */ + void *fdata, /* Opaque data pointer */ + double tp[]); /* Multivriate input value */ + +#ifdef __cplusplus + } +#endif + +#endif /* DHSX_H */ -- cgit v1.2.3