1 #ifndef LUKSAN_H
2 #define LUKSAN_H
3 
4 #include "nlopt.h"
5 #include "nlopt-util.h"
6 
7 #ifdef __cplusplus
8 extern "C"
9 {
10 #endif /* __cplusplus */
11 
12 nlopt_result luksan_plis(int n, nlopt_func f, void *f_data,
13                   const double *lb, const double *ub, /* bounds */
14                   double *x, /* in: initial guess, out: minimizer */
15                   double *minf,
16 		  nlopt_stopping *stop,
17 			 int mf);
18 
19 nlopt_result luksan_plip(int n, nlopt_func f, void *f_data,
20 			 const double *lb, const double *ub, /* bounds */
21 			 double *x, /* in: initial guess, out: minimizer */
22 			 double *minf,
23 			 nlopt_stopping *stop,
24 			 int mf,
25 			 int method);
26 
27 nlopt_result luksan_pnet(int n, nlopt_func f, void *f_data,
28 			 const double *lb, const double *ub, /* bounds */
29 			 double *x, /* in: initial guess, out: minimizer */
30 			 double *minf,
31 			 nlopt_stopping *stop,
32 			 int mf,
33 			 int mos1, int mos2);
34 
35 typedef struct {
36      double fl, fu, pl, rl, pu, ru;
37      int mes1, mes2, mes3, mode, mtyp;
38 } ps1l01_state;
39 
40 /*****************************  internal routines *************************/
41 
42 /* mssubs.c: */
43 void luksan_mxdcmd__(int *n, int *m, double *a,
44 		     double *x, double *alf, double *y, double *z__);
45 void luksan_mxdrcb__(int *n, int *m, double *a,
46 		     double *b, double *u, double *v, double *x, int *
47 		     ix, int *job);
48 void luksan_mxdrcf__(int *n, int *m, double *a,
49 		     double *b, double *u, double *v, double *x, int *
50 		     ix, int *job);
51 void luksan_mxdrmm__(int *n, int *m, double *a,
52 		     double *x, double *y);
53 void luksan_mxdrsu__(int *n, int *m, double *a,
54 		     double *b, double *u);
55 void luksan_mxucop__(int *n, double *x, double *y,
56 		     int *ix, int *job);
57 void luksan_mxudir__(int *n, double *a, double *x,
58 		     double *y, double *z__, int *ix, int *job);
59 void luksan_mxuneg__(int *n, double *x, double *y,
60 		     int *ix, int *job);
61 void luksan_mxuzer__(int *n, double *x, int *ix,
62 		     int *job);
63 void luksan_mxvcop__(int *n, double *x, double *y);
64 void luksan_mxvdif__(int *n, double *x, double *y,
65 		     double *z__);
66 void luksan_mxvneg__(int *n, double *x, double *y);
67 void luksan_mxvscl__(int *n, double *a, double *x,
68 		     double *y);
69 void luksan_mxvset__(int *n, double *a, double *x);
70 double luksan_mxudot__(int *n, double *x, double *y, int *ix,
71 		       int *job);
72 double luksan_mxvdot__(int *n, double *x, double *y);
73 void luksan_mxvdir__(int *n, double *a, double *x,
74 		     double *y, double *z__);
75 void luksan_mxdcmu__(int *n, int *m, double *a,
76 		     double *alf, double *x, double *y);
77 void luksan_mxvlin__(int *n, double *a, double *x,
78 		     double *b, double *y, double *z__);
79 void luksan_mxdcmv__(int *n, int *m, double *a,
80 		     double *alf, double *x, double *u, double *bet,
81 		     double *y, double *v);
82 void luksan_mxvsav__(int *n, double *x, double *y);
83 void luksan_mxvine__(int *n, int *ix);
84 double luksan_mxvmax__(int *n, double *x);
85 
86 /* pssubs.c: */
87 void luksan_pcbs04__(int *nf, double *x, int *ix,
88 		     double *xl, double *xu, double *eps9, int *kbf);
89 void luksan_ps1l01__(double *r__, double *rp,
90 		     double *f, double *fo, double *fp, double *p,
91 		     double *po, double *pp, double *minf, double *fmax,
92 		     double *rmin, double *rmax, double *tols, double *
93 		     tolp, double *par1, double *par2, int *kd, int *ld,
94 		     int *nit, int *kit, int *nred, int *mred, int *
95 		     maxst, int *iest, int *inits, int *iters, int *kters,
96 		     int *mes, int *isys, ps1l01_state *state);
97 void luksan_pulsp3__(int *n, int *m, int *mf,
98 		     double *xm, double *gr, double *xo, double *go,
99 		     double *r__, double *po, double *sig, int *iterh,
100 		     int *met3);
101 void luksan_pulvp3__(int *n, int *m, double *xm,
102 		     double *xr, double *gr, double *s, double *so,
103 		     double *xo, double *go, double *r__, double *po,
104 		     double *sig, int *iterh, int *met2, int *met3,
105 		     int *met5);
106 void luksan_pyadc0__(int *nf, int *n, double *x,
107 		     int *ix, double *xl, double *xu, int *inew);
108 void luksan_pyfut1__(int *n, double *f, double *
109 		     fo, double *umax, double *gmax,
110 		     int xstop, const nlopt_stopping *stop,
111 		     double *tolg, int *kd, int *nit, int *kit, int *mit,
112 		     int *nfg, int *mfg, int *ntesx,
113 		     int *mtesx, int *ntesf, int *mtesf, int *ites,
114 		     int *ires1, int *ires2, int *irest, int *iters,
115 		     int *iterm);
116 void luksan_pyrmc0__(int *nf, int *n, int *ix,
117 		     double *g, double *eps8, double *umax, double *gmax,
118 		     double *rmax, int *iold, int *irest);
119 void luksan_pytrcd__(int *nf, double *x, int *ix,
120 		     double *xo, double *g, double *go, double *r__,
121 		     double *f, double *fo, double *p, double *po,
122 		     double *dmax__, int *kbf, int *kd, int *ld, int *
123 		     iters);
124 void luksan_pytrcg__(int *nf, int *n, int *ix,
125 		     double *g, double *umax, double *gmax, int *kbf,
126 		     int *iold);
127 void luksan_pytrcs__(int *nf, double *x, int *ix,
128 		     double *xo, double *xl, double *xu, double *g,
129 		     double *go, double *s, double *ro, double *fp,
130 		     double *fo, double *f, double *po, double *p,
131 		     double *rmax, double *eta9, int *kbf);
132 void luksan_pnint1__(double *rl, double *ru, double *fl,
133 		     double *fu, double *pl, double *pu, double *r__,
134 		     int *mode, int *mtyp, int *merr);
135 
136 /* Common Block Declarations */
137 typedef struct {
138      int nres, ndec, nin, nit;
139      /* int nfv;   -- now stored in stop->nevals */
140      int nfg, nfh;
141 } stat_common;
142 
143 /* number of double variables that can be stored in scratch memory
144    ... it's >= 2007, and this is in the context of scientific computation,
145    so assume that at least 10M are available, and that sizeof(double)==8 */
146 #define MEMAVAIL 1310720
147 
148 #ifdef __cplusplus
149 }  /* extern "C" */
150 #endif /* __cplusplus */
151 
152 #endif /* LUKSAN_H */
153