00001 #ifndef __CMINPACK_H__
00002 #define __CMINPACK_H__
00003
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 typedef int (*minpack_func_nn)(void *p, int n, const double *x, double *fvec, int iflag );
00023
00024
00025
00026
00027
00028
00029
00030 typedef int (*minpack_funcder_nn)(void *p, int n, const double *x, double *fvec, double *fjac,
00031 int ldfjac, int iflag );
00032
00033
00034
00035
00036
00037 typedef int (*minpack_func_mn)(void *p, int m, int n, const double *x, double *fvec,
00038 int iflag );
00039
00040
00041
00042
00043
00044
00045
00046 typedef int (*minpack_funcder_mn)(void *p, int m, int n, const double *x, double *fvec,
00047 double *fjac, int ldfjac, int iflag );
00048
00049
00050
00051
00052
00053
00054
00055 typedef int (*minpack_funcderstr_mn)(void *p, int m, int n, const double *x, double *fvec,
00056 double *fjrow, int iflag );
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 int hybrd1 ( minpack_func_nn fcn,
00074 void *p, int n, double *x, double *fvec, double tol,
00075 double *wa, int lwa );
00076
00077
00078
00079
00080 int hybrd ( minpack_func_nn fcn,
00081 void *p, int n, double *x, double *fvec, double xtol, int maxfev,
00082 int ml, int mu, double epsfcn, double *diag, int mode,
00083 double factor, int nprint, int *nfev,
00084 double *fjac, int ldfjac, double *r, int lr, double *qtf,
00085 double *wa1, double *wa2, double *wa3, double *wa4);
00086
00087
00088
00089 int hybrj1 ( minpack_funcder_nn fcn, void *p, int n, double *x,
00090 double *fvec, double *fjac, int ldfjac, double tol,
00091 double *wa, int lwa );
00092
00093
00094
00095
00096 int hybrj ( minpack_funcder_nn fcn, void *p, int n, double *x,
00097 double *fvec, double *fjac, int ldfjac, double xtol,
00098 int maxfev, double *diag, int mode, double factor,
00099 int nprint, int *nfev, int *njev, double *r,
00100 int lr, double *qtf, double *wa1, double *wa2,
00101 double *wa3, double *wa4 );
00102
00103
00104
00105
00106 int lmdif1 ( minpack_func_mn fcn,
00107 void *p, int m, int n, double *x, double *fvec, double tol,
00108 int *iwa, double *wa, int lwa );
00109
00110
00111
00112
00113
00114 int lmdif ( minpack_func_mn fcn,
00115 void *p, int m, int n, double *x, double *fvec, double ftol,
00116 double xtol, double gtol, int maxfev, double epsfcn,
00117 double *diag, int mode, double factor, int nprint,
00118 int *nfev, double *fjac, int ldfjac, int *ipvt,
00119 double *qtf, double *wa1, double *wa2, double *wa3,
00120 double *wa4 );
00121
00122
00123
00124
00125 int lmder1 ( minpack_funcder_mn fcn,
00126 void *p, int m, int n, double *x, double *fvec, double *fjac,
00127 int ldfjac, double tol, int *ipvt,
00128 double *wa, int lwa );
00129
00130
00131
00132
00133 int lmder ( minpack_funcder_mn fcn,
00134 void *p, int m, int n, double *x, double *fvec, double *fjac,
00135 int ldfjac, double ftol, double xtol, double gtol,
00136 int maxfev, double *diag, int mode, double factor,
00137 int nprint, int *nfev, int *njev, int *ipvt,
00138 double *qtf, double *wa1, double *wa2, double *wa3,
00139 double *wa4 );
00140
00141
00142
00143
00144 int lmstr1 ( minpack_funcderstr_mn fcn, void *p, int m, int n,
00145 double *x, double *fvec, double *fjac, int ldfjac,
00146 double tol, int *ipvt, double *wa, int lwa );
00147
00148
00149
00150
00151 int lmstr ( minpack_funcderstr_mn fcn, void *p, int m,
00152 int n, double *x, double *fvec, double *fjac,
00153 int ldfjac, double ftol, double xtol, double gtol,
00154 int maxfev, double *diag, int mode, double factor,
00155 int nprint, int *nfev, int *njev, int *ipvt,
00156 double *qtf, double *wa1, double *wa2, double *wa3,
00157 double *wa4 );
00158
00159 void chkder ( int m, int n, const double *x, double *fvec, double *fjac,
00160 int ldfjac, double *xp, double *fvecp, int mode,
00161 double *err );
00162
00163 double dpmpar ( int i );
00164
00165 double enorm ( int n, const double *x );
00166
00167
00168
00169
00170 int fdjac2(minpack_func_mn fcn,
00171 void *p, int m, int n, double *x, const double *fvec, double *fjac,
00172 int ldfjac, double epsfcn, double *wa);
00173
00174
00175
00176
00177
00178 int fdjac1(minpack_func_nn fcn,
00179 void *p, int n, double *x, const double *fvec, double *fjac, int ldfjac,
00180 int ml, int mu, double epsfcn, double *wa1,
00181 double *wa2);
00182
00183
00184 void dogleg(int n, const double *r, int lr,
00185 const double *diag, const double *qtb, double delta, double *x,
00186 double *wa1, double *wa2);
00187 void qrfac(int m, int n, double *a, int
00188 lda, int pivot, int *ipvt, int lipvt, double *rdiag,
00189 double *acnorm, double *wa);
00190 void qrsolv(int n, double *r, int ldr,
00191 const int *ipvt, const double *diag, const double *qtb, double *x,
00192 double *sdiag, double *wa);
00193 void qform(int m, int n, double *q, int
00194 ldq, double *wa);
00195 void r1updt(int m, int n, double *s, int
00196 ls, const double *u, double *v, double *w, int *sing);
00197 void r1mpyq(int m, int n, double *a, int
00198 lda, const double *v, const double *w);
00199 void lmpar(int n, double *r, int ldr,
00200 const int *ipvt, const double *diag, const double *qtb, double delta,
00201 double *par, double *x, double *sdiag, double *wa1,
00202 double *wa2);
00203 void rwupdt(int n, double *r, int ldr,
00204 const double *w, double *b, double *alpha, double *cos,
00205 double *sin);
00206 void covar(int n, double *r, int ldr,
00207 const int *ipvt, double tol, double *wa);
00208 #ifdef __cplusplus
00209 }
00210 #endif
00211
00212
00213 #endif