/* automatically generated by rust-bindgen 0.60.1 */

pub type size_t = ::std::os::raw::c_ulong;
pub type wchar_t = ::std::os::raw::c_int;
pub type max_align_t = f64;
pub type nlopt_func = ::std::option::Option<
    unsafe extern "C" fn(
        n: ::std::os::raw::c_uint,
        x: *const f64,
        gradient: *mut f64,
        func_data: *mut ::std::os::raw::c_void,
    ) -> f64,
>;
pub type nlopt_mfunc = ::std::option::Option<
    unsafe extern "C" fn(
        m: ::std::os::raw::c_uint,
        result: *mut f64,
        n: ::std::os::raw::c_uint,
        x: *const f64,
        gradient: *mut f64,
        func_data: *mut ::std::os::raw::c_void,
    ),
>;
pub type nlopt_precond = ::std::option::Option<
    unsafe extern "C" fn(
        n: ::std::os::raw::c_uint,
        x: *const f64,
        v: *const f64,
        vpre: *mut f64,
        data: *mut ::std::os::raw::c_void,
    ),
>;
pub const nlopt_algorithm_NLOPT_GN_DIRECT: nlopt_algorithm = 0;
pub const nlopt_algorithm_NLOPT_GN_DIRECT_L: nlopt_algorithm = 1;
pub const nlopt_algorithm_NLOPT_GN_DIRECT_L_RAND: nlopt_algorithm = 2;
pub const nlopt_algorithm_NLOPT_GN_DIRECT_NOSCAL: nlopt_algorithm = 3;
pub const nlopt_algorithm_NLOPT_GN_DIRECT_L_NOSCAL: nlopt_algorithm = 4;
pub const nlopt_algorithm_NLOPT_GN_DIRECT_L_RAND_NOSCAL: nlopt_algorithm = 5;
pub const nlopt_algorithm_NLOPT_GN_ORIG_DIRECT: nlopt_algorithm = 6;
pub const nlopt_algorithm_NLOPT_GN_ORIG_DIRECT_L: nlopt_algorithm = 7;
pub const nlopt_algorithm_NLOPT_GD_STOGO: nlopt_algorithm = 8;
pub const nlopt_algorithm_NLOPT_GD_STOGO_RAND: nlopt_algorithm = 9;
pub const nlopt_algorithm_NLOPT_LD_LBFGS_NOCEDAL: nlopt_algorithm = 10;
pub const nlopt_algorithm_NLOPT_LD_LBFGS: nlopt_algorithm = 11;
pub const nlopt_algorithm_NLOPT_LN_PRAXIS: nlopt_algorithm = 12;
pub const nlopt_algorithm_NLOPT_LD_VAR1: nlopt_algorithm = 13;
pub const nlopt_algorithm_NLOPT_LD_VAR2: nlopt_algorithm = 14;
pub const nlopt_algorithm_NLOPT_LD_TNEWTON: nlopt_algorithm = 15;
pub const nlopt_algorithm_NLOPT_LD_TNEWTON_RESTART: nlopt_algorithm = 16;
pub const nlopt_algorithm_NLOPT_LD_TNEWTON_PRECOND: nlopt_algorithm = 17;
pub const nlopt_algorithm_NLOPT_LD_TNEWTON_PRECOND_RESTART: nlopt_algorithm = 18;
pub const nlopt_algorithm_NLOPT_GN_CRS2_LM: nlopt_algorithm = 19;
pub const nlopt_algorithm_NLOPT_GN_MLSL: nlopt_algorithm = 20;
pub const nlopt_algorithm_NLOPT_GD_MLSL: nlopt_algorithm = 21;
pub const nlopt_algorithm_NLOPT_GN_MLSL_LDS: nlopt_algorithm = 22;
pub const nlopt_algorithm_NLOPT_GD_MLSL_LDS: nlopt_algorithm = 23;
pub const nlopt_algorithm_NLOPT_LD_MMA: nlopt_algorithm = 24;
pub const nlopt_algorithm_NLOPT_LN_COBYLA: nlopt_algorithm = 25;
pub const nlopt_algorithm_NLOPT_LN_NEWUOA: nlopt_algorithm = 26;
pub const nlopt_algorithm_NLOPT_LN_NEWUOA_BOUND: nlopt_algorithm = 27;
pub const nlopt_algorithm_NLOPT_LN_NELDERMEAD: nlopt_algorithm = 28;
pub const nlopt_algorithm_NLOPT_LN_SBPLX: nlopt_algorithm = 29;
pub const nlopt_algorithm_NLOPT_LN_AUGLAG: nlopt_algorithm = 30;
pub const nlopt_algorithm_NLOPT_LD_AUGLAG: nlopt_algorithm = 31;
pub const nlopt_algorithm_NLOPT_LN_AUGLAG_EQ: nlopt_algorithm = 32;
pub const nlopt_algorithm_NLOPT_LD_AUGLAG_EQ: nlopt_algorithm = 33;
pub const nlopt_algorithm_NLOPT_LN_BOBYQA: nlopt_algorithm = 34;
pub const nlopt_algorithm_NLOPT_GN_ISRES: nlopt_algorithm = 35;
pub const nlopt_algorithm_NLOPT_AUGLAG: nlopt_algorithm = 36;
pub const nlopt_algorithm_NLOPT_AUGLAG_EQ: nlopt_algorithm = 37;
pub const nlopt_algorithm_NLOPT_G_MLSL: nlopt_algorithm = 38;
pub const nlopt_algorithm_NLOPT_G_MLSL_LDS: nlopt_algorithm = 39;
pub const nlopt_algorithm_NLOPT_LD_SLSQP: nlopt_algorithm = 40;
pub const nlopt_algorithm_NLOPT_LD_CCSAQ: nlopt_algorithm = 41;
pub const nlopt_algorithm_NLOPT_GN_ESCH: nlopt_algorithm = 42;
pub const nlopt_algorithm_NLOPT_GN_AGS: nlopt_algorithm = 43;
pub const nlopt_algorithm_NLOPT_NUM_ALGORITHMS: nlopt_algorithm = 44;
pub type nlopt_algorithm = ::std::os::raw::c_uint;
extern "C" {
    pub fn nlopt_algorithm_name(a: nlopt_algorithm) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn nlopt_algorithm_to_string(algorithm: nlopt_algorithm) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn nlopt_algorithm_from_string(name: *const ::std::os::raw::c_char) -> nlopt_algorithm;
}
pub const nlopt_result_NLOPT_FAILURE: nlopt_result = -1;
pub const nlopt_result_NLOPT_INVALID_ARGS: nlopt_result = -2;
pub const nlopt_result_NLOPT_OUT_OF_MEMORY: nlopt_result = -3;
pub const nlopt_result_NLOPT_ROUNDOFF_LIMITED: nlopt_result = -4;
pub const nlopt_result_NLOPT_FORCED_STOP: nlopt_result = -5;
pub const nlopt_result_NLOPT_NUM_FAILURES: nlopt_result = -6;
pub const nlopt_result_NLOPT_SUCCESS: nlopt_result = 1;
pub const nlopt_result_NLOPT_STOPVAL_REACHED: nlopt_result = 2;
pub const nlopt_result_NLOPT_FTOL_REACHED: nlopt_result = 3;
pub const nlopt_result_NLOPT_XTOL_REACHED: nlopt_result = 4;
pub const nlopt_result_NLOPT_MAXEVAL_REACHED: nlopt_result = 5;
pub const nlopt_result_NLOPT_MAXTIME_REACHED: nlopt_result = 6;
pub const nlopt_result_NLOPT_NUM_RESULTS: nlopt_result = 7;
pub type nlopt_result = ::std::os::raw::c_int;
extern "C" {
    pub fn nlopt_result_to_string(algorithm: nlopt_result) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn nlopt_result_from_string(name: *const ::std::os::raw::c_char) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_srand(seed: ::std::os::raw::c_ulong);
}
extern "C" {
    pub fn nlopt_srand_time();
}
extern "C" {
    pub fn nlopt_version(
        major: *mut ::std::os::raw::c_int,
        minor: *mut ::std::os::raw::c_int,
        bugfix: *mut ::std::os::raw::c_int,
    );
}
#[doc = " OBJECT-ORIENTED API"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nlopt_opt_s {
    _unused: [u8; 0],
}
pub type nlopt_opt = *mut nlopt_opt_s;
extern "C" {
    pub fn nlopt_create(algorithm: nlopt_algorithm, n: ::std::os::raw::c_uint) -> nlopt_opt;
}
extern "C" {
    pub fn nlopt_destroy(opt: nlopt_opt);
}
extern "C" {
    pub fn nlopt_copy(opt: nlopt_opt) -> nlopt_opt;
}
extern "C" {
    pub fn nlopt_optimize(opt: nlopt_opt, x: *mut f64, opt_f: *mut f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_min_objective(
        opt: nlopt_opt,
        f: nlopt_func,
        f_data: *mut ::std::os::raw::c_void,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_max_objective(
        opt: nlopt_opt,
        f: nlopt_func,
        f_data: *mut ::std::os::raw::c_void,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_precond_min_objective(
        opt: nlopt_opt,
        f: nlopt_func,
        pre: nlopt_precond,
        f_data: *mut ::std::os::raw::c_void,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_precond_max_objective(
        opt: nlopt_opt,
        f: nlopt_func,
        pre: nlopt_precond,
        f_data: *mut ::std::os::raw::c_void,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_algorithm(opt: nlopt_opt) -> nlopt_algorithm;
}
extern "C" {
    pub fn nlopt_get_dimension(opt: nlopt_opt) -> ::std::os::raw::c_uint;
}
extern "C" {
    pub fn nlopt_get_errmsg(opt: nlopt_opt) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn nlopt_set_param(
        opt: nlopt_opt,
        name: *const ::std::os::raw::c_char,
        val: f64,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_param(
        opt: nlopt_opt,
        name: *const ::std::os::raw::c_char,
        defaultval: f64,
    ) -> f64;
}
extern "C" {
    pub fn nlopt_has_param(
        opt: nlopt_opt,
        name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn nlopt_num_params(opt: nlopt_opt) -> ::std::os::raw::c_uint;
}
extern "C" {
    pub fn nlopt_nth_param(
        opt: nlopt_opt,
        n: ::std::os::raw::c_uint,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn nlopt_set_lower_bounds(opt: nlopt_opt, lb: *const f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_lower_bounds1(opt: nlopt_opt, lb: f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_lower_bound(opt: nlopt_opt, i: ::std::os::raw::c_int, lb: f64)
        -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_lower_bounds(opt: nlopt_opt, lb: *mut f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_upper_bounds(opt: nlopt_opt, ub: *const f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_upper_bounds1(opt: nlopt_opt, ub: f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_upper_bound(opt: nlopt_opt, i: ::std::os::raw::c_int, ub: f64)
        -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_upper_bounds(opt: nlopt_opt, ub: *mut f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_remove_inequality_constraints(opt: nlopt_opt) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_add_inequality_constraint(
        opt: nlopt_opt,
        fc: nlopt_func,
        fc_data: *mut ::std::os::raw::c_void,
        tol: f64,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_add_precond_inequality_constraint(
        opt: nlopt_opt,
        fc: nlopt_func,
        pre: nlopt_precond,
        fc_data: *mut ::std::os::raw::c_void,
        tol: f64,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_add_inequality_mconstraint(
        opt: nlopt_opt,
        m: ::std::os::raw::c_uint,
        fc: nlopt_mfunc,
        fc_data: *mut ::std::os::raw::c_void,
        tol: *const f64,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_remove_equality_constraints(opt: nlopt_opt) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_add_equality_constraint(
        opt: nlopt_opt,
        h: nlopt_func,
        h_data: *mut ::std::os::raw::c_void,
        tol: f64,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_add_precond_equality_constraint(
        opt: nlopt_opt,
        h: nlopt_func,
        pre: nlopt_precond,
        h_data: *mut ::std::os::raw::c_void,
        tol: f64,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_add_equality_mconstraint(
        opt: nlopt_opt,
        m: ::std::os::raw::c_uint,
        h: nlopt_mfunc,
        h_data: *mut ::std::os::raw::c_void,
        tol: *const f64,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_stopval(opt: nlopt_opt, stopval: f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_stopval(opt: nlopt_opt) -> f64;
}
extern "C" {
    pub fn nlopt_set_ftol_rel(opt: nlopt_opt, tol: f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_ftol_rel(opt: nlopt_opt) -> f64;
}
extern "C" {
    pub fn nlopt_set_ftol_abs(opt: nlopt_opt, tol: f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_ftol_abs(opt: nlopt_opt) -> f64;
}
extern "C" {
    pub fn nlopt_set_xtol_rel(opt: nlopt_opt, tol: f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_xtol_rel(opt: nlopt_opt) -> f64;
}
extern "C" {
    pub fn nlopt_set_xtol_abs1(opt: nlopt_opt, tol: f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_xtol_abs(opt: nlopt_opt, tol: *const f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_xtol_abs(opt: nlopt_opt, tol: *mut f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_x_weights1(opt: nlopt_opt, w: f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_x_weights(opt: nlopt_opt, w: *const f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_x_weights(opt: nlopt_opt, w: *mut f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_maxeval(opt: nlopt_opt, maxeval: ::std::os::raw::c_int) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_maxeval(opt: nlopt_opt) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn nlopt_get_numevals(opt: nlopt_opt) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn nlopt_set_maxtime(opt: nlopt_opt, maxtime: f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_maxtime(opt: nlopt_opt) -> f64;
}
extern "C" {
    pub fn nlopt_force_stop(opt: nlopt_opt) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_force_stop(opt: nlopt_opt, val: ::std::os::raw::c_int) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_force_stop(opt: nlopt_opt) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn nlopt_set_local_optimizer(opt: nlopt_opt, local_opt: nlopt_opt) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_population(opt: nlopt_opt, pop: ::std::os::raw::c_uint) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_population(opt: nlopt_opt) -> ::std::os::raw::c_uint;
}
extern "C" {
    pub fn nlopt_set_vector_storage(opt: nlopt_opt, dim: ::std::os::raw::c_uint) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_vector_storage(opt: nlopt_opt) -> ::std::os::raw::c_uint;
}
extern "C" {
    pub fn nlopt_set_default_initial_step(opt: nlopt_opt, x: *const f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_initial_step(opt: nlopt_opt, dx: *const f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_set_initial_step1(opt: nlopt_opt, dx: f64) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_initial_step(opt: nlopt_opt, x: *const f64, dx: *mut f64) -> nlopt_result;
}
pub type nlopt_munge = ::std::option::Option<
    unsafe extern "C" fn(p: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void,
>;
extern "C" {
    pub fn nlopt_set_munge(
        opt: nlopt_opt,
        munge_on_destroy: nlopt_munge,
        munge_on_copy: nlopt_munge,
    );
}
pub type nlopt_munge2 = ::std::option::Option<
    unsafe extern "C" fn(
        p: *mut ::std::os::raw::c_void,
        data: *mut ::std::os::raw::c_void,
    ) -> *mut ::std::os::raw::c_void,
>;
extern "C" {
    pub fn nlopt_munge_data(opt: nlopt_opt, munge: nlopt_munge2, data: *mut ::std::os::raw::c_void);
}
pub type nlopt_func_old = ::std::option::Option<
    unsafe extern "C" fn(
        n: ::std::os::raw::c_int,
        x: *const f64,
        gradient: *mut f64,
        func_data: *mut ::std::os::raw::c_void,
    ) -> f64,
>;
extern "C" {
    pub fn nlopt_minimize(
        algorithm: nlopt_algorithm,
        n: ::std::os::raw::c_int,
        f: nlopt_func_old,
        f_data: *mut ::std::os::raw::c_void,
        lb: *const f64,
        ub: *const f64,
        x: *mut f64,
        minf: *mut f64,
        minf_max: f64,
        ftol_rel: f64,
        ftol_abs: f64,
        xtol_rel: f64,
        xtol_abs: *const f64,
        maxeval: ::std::os::raw::c_int,
        maxtime: f64,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_minimize_constrained(
        algorithm: nlopt_algorithm,
        n: ::std::os::raw::c_int,
        f: nlopt_func_old,
        f_data: *mut ::std::os::raw::c_void,
        m: ::std::os::raw::c_int,
        fc: nlopt_func_old,
        fc_data: *mut ::std::os::raw::c_void,
        fc_datum_size: isize,
        lb: *const f64,
        ub: *const f64,
        x: *mut f64,
        minf: *mut f64,
        minf_max: f64,
        ftol_rel: f64,
        ftol_abs: f64,
        xtol_rel: f64,
        xtol_abs: *const f64,
        maxeval: ::std::os::raw::c_int,
        maxtime: f64,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_minimize_econstrained(
        algorithm: nlopt_algorithm,
        n: ::std::os::raw::c_int,
        f: nlopt_func_old,
        f_data: *mut ::std::os::raw::c_void,
        m: ::std::os::raw::c_int,
        fc: nlopt_func_old,
        fc_data: *mut ::std::os::raw::c_void,
        fc_datum_size: isize,
        p: ::std::os::raw::c_int,
        h: nlopt_func_old,
        h_data: *mut ::std::os::raw::c_void,
        h_datum_size: isize,
        lb: *const f64,
        ub: *const f64,
        x: *mut f64,
        minf: *mut f64,
        minf_max: f64,
        ftol_rel: f64,
        ftol_abs: f64,
        xtol_rel: f64,
        xtol_abs: *const f64,
        htol_rel: f64,
        htol_abs: f64,
        maxeval: ::std::os::raw::c_int,
        maxtime: f64,
    ) -> nlopt_result;
}
extern "C" {
    pub fn nlopt_get_local_search_algorithm(
        deriv: *mut nlopt_algorithm,
        nonderiv: *mut nlopt_algorithm,
        maxeval: *mut ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn nlopt_set_local_search_algorithm(
        deriv: nlopt_algorithm,
        nonderiv: nlopt_algorithm,
        maxeval: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn nlopt_get_stochastic_population() -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn nlopt_set_stochastic_population(pop: ::std::os::raw::c_int);
}
