11 int f(
double* x,
double* ret)
17 int df(
double* x,
double* grad){
19 grad[1] = 0.5 /
sqrt(x[1]);
23 int g1(
double* x,
double* ret)
25 ret[0] = x[0] + x[1] - 10 ;
29 int dg1(
double* x,
double* grad) {
30 grad[0] = grad[1] = 1 ;
34 int h1(
double* x,
double* ret) {
36 ret[0] = ((a * x[0] + b) * (a * x[0] + b) * (a * x[0] + b) - x[1]);
40 int dh1(
double* x,
double* grad) {
42 grad[0] = 3 * a * (a * x[0] + b) * (a * x[0] + b);
47 int nop(
double* x,
double* grad) {
52 double x[2] = { 1, 9 };
53 double x_min[2] = {0,0} ;
54 double x_max[2] = {10,10} ;
55 NLoptSolver nos(x,x_min,x_max,
f,
df,
g1,
dg1,
h1,
dh1,2,1,1,1e-16,1e-8,1e-4,-1,-1,
Optimization::NLopt::COBYLA) ;
int dg1(double *x, double *grad)
int g1(double *x, double *ret)
int nop(double *x, double *grad)
int h1(double *x, double *ret)
void output_result(int result)
int dh1(double *x, double *grad)
int f(double *x, double *ret)
int df(double *x, double *grad)