chiark / gitweb /
77a0eb6c23215a4b3c5670482079d5c916577d18
[nlopt.git] / cdirect / cdirect.h
1 #ifndef CDIRECT_H
2 #define CDIRECT_H
3
4 #include "nlopt-util.h"
5 #include "nlopt.h"
6
7 #ifdef __cplusplus
8 extern "C"
9 {
10 #endif /* __cplusplus */
11
12 extern nlopt_result cdirect_unscaled(int n, nlopt_func f, void *f_data,
13                                      const double *lb, const double *ub,
14                                      double *x,
15                                      double *minf,
16                                      nlopt_stopping *stop,
17                                      double magic_eps, int which_alg);
18
19 extern nlopt_result cdirect(int n, nlopt_func f, void *f_data,
20                             const double *lb, const double *ub,
21                             double *x,
22                             double *minf,
23                             nlopt_stopping *stop,
24                             double magic_eps, int which_alg);
25
26 extern nlopt_result cdirect_hybrid(int n, nlopt_func f, void *f_data,
27                             const double *lb, const double *ub,
28                             double *x,
29                             double *minf,
30                             nlopt_stopping *stop,
31                             nlopt_algorithm local_alg,
32                             int local_maxeval,
33                             int randomized_div);
34
35 extern nlopt_result cdirect_hybrid_unscaled(int n, nlopt_func f, void *f_data,
36                             const double *lb, const double *ub,
37                             double *x,
38                             double *minf,
39                             nlopt_stopping *stop,
40                             nlopt_algorithm local_alg,
41                             int local_maxeval,
42                             int randomized_div);
43
44 /* internal routines and data structures: */
45 extern int cdirect_hyperrect_compare(double *a, double *b);
46 typedef struct {
47      nlopt_func f;
48      void *f_data;
49      double *x;
50      const double *lb, *ub;
51 } cdirect_uf_data;
52 extern double cdirect_uf(int n, const double *xu, double *grad, void *d_);
53
54 #ifdef __cplusplus
55 }  /* extern "C" */
56 #endif /* __cplusplus */
57
58 #endif /* DIRECT_H */