File: dhsx.h

package info (click to toggle)
argyll 2.0.1%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 38,928 kB
  • sloc: ansic: 380,801; xml: 1,551; sh: 655; makefile: 604
file content (36 lines) | stat: -rwxr-xr-x 1,092 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#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 0 on sucess, 1 on failure due to excessive itterations */
/* Result will be in cp */
int dhsx(
 double *rv,			/* If not NULL, return the residual error */
 int di,				/* Dimentionality */
 double *cp,			/* Initial starting point, return minimum */
 double *s,				/* Size of initial search area */
 double ftol,			/* Finishing tollerance of error change */
 double athr,			/* Absolute return value threshold. (Set high to not use) */
 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 */