diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-09-01 13:56:46 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-09-01 13:56:46 +0200 |
commit | 22f703cab05b7cd368f4de9e03991b7664dc5022 (patch) | |
tree | 6f4d50beaa42328e24b1c6b56b6ec059e4ef21a5 /numlib/zbrent.h |
Initial import of argyll version 1.5.1-8debian/1.5.1-8
Diffstat (limited to 'numlib/zbrent.h')
-rw-r--r-- | numlib/zbrent.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/numlib/zbrent.h b/numlib/zbrent.h new file mode 100644 index 0000000..2f8aac4 --- /dev/null +++ b/numlib/zbrent.h @@ -0,0 +1,44 @@ +#ifndef ROOT_H +#define ROOT_H + +/* + * Copyright 2000 Graeme W. Gill + * All rights reserved. + * + * This material is licenced under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 :- + * see the License.txt file for licencing details. + */ + +#ifdef __cplusplus + extern "C" { +#endif + +/* 1 dimentional root finding code */ + +/* Bracket search function */ +/* return 0 on sucess */ +/* -1 on no range */ +/* -2 on too many itterations */ +int zbrac( +double *x1, /* Input and output bracket values */ +double *x2, +double (*func)(void *fdata, double tp), /* function to evaluate */ +void *fdata); /* Opaque data pointer */ + +/* Root finder */ +/* return 0 on sucess */ +/* -1 on root not bracketed */ +/* -2 on too many itterations */ +int zbrent( +double *rv, /* Return value */ +double x1, /* Bracket to search */ +double x2, /* (Min, Max) */ +double tol, /* Desired tollerance */ +double (*func)(void *fdata, double tp), /* function to evaluate */ +void *fdata); /* Opaque data pointer */ + +#ifdef __cplusplus + } +#endif + +#endif /* ROOT_H */ |