Module Nlopt
OCaml interface to the NLopt optimization library
val direct : [ `Global ] algorithmval direct_l : [ `Global | `Ineq ] algorithmval direct_l_rand : [ `Global ] algorithmval direct_noscal : [ `Global ] algorithmval direct_l_noscal : [ `Global ] algorithmval direct_l_rand_noscal : [ `Global ] algorithmval orig_direct : [ `Global | `Ineq ] algorithmval orig_direct_l : [ `Global ] algorithmval stogo : [ `Global | `Grad ] algorithmval stogo_rand : [ `Global | `Grad ] algorithmval lbfgs_nocedal : [ `Local | `Grad ] algorithmval lbfgs : [ `Local | `Grad ] algorithmval praxis : [ `Local ] algorithmval var1 : [ `Local | `Grad ] algorithmval var2 : [ `Local | `Grad ] algorithmval tnewton : [ `Local | `Grad ] algorithmval tnewton_restart : [ `Local | `Grad ] algorithmval tnewton_precond : [ `Local | `Grad ] algorithmval tnewton_precond_restart : [ `Local | `Grad ] algorithmval crs2_lm : [ `Global ] algorithmval mma : [ `Local | `Grad | `Ineq ] algorithmval cobyla : [ `Local | `Ineq | `Eq ] algorithmval newuoa : [ `Local ] algorithmval newuoa_bound : [ `Local ] algorithmval neldermead : [ `Local ] algorithmval sbplx : [ `Local ] algorithmval bobyqa : [ `Local ] algorithmval isres : [ `Global | `Ineq | `Eq ] algorithmval auglag : [ `Subsidiary | `Ineq | `Eq ] algorithmval auglag_eq : [ `Subsidiary | `Ineq | `Eq ] algorithmval mlsl : [ `Subsidiary | `Global ] algorithmval mlsl_lds : [ `Subsidiary | `Global ] algorithmval slsqp : [ `Local | `Grad | `Ineq | `Eq ] algorithm
val create : 'a algorithm -> int -> 'a tval set_min_objective : 'a t -> (float array -> float array option -> float) -> unitval set_max_objective : 'a t -> (float array -> float array option -> float) -> unitval optimize : 'a t -> float array -> [> `Success | `Stopval_reached | `Stopval_reached | `Ftol_reached | `Xtol_reached | `Maxeval_reached | `Maxtime_reached ] * float array * floatoptimize opt xperforms the optimization usingxas an initial guess (it must be of size get_dimension opt). Returns a triple(result, xopt, fopt)wherexoptis the optimzed value andfoptis the function value at that optimum.- raises Invalid_argument
xdoes not match the dimension ofoptor NLopt returned NLOPT_INVALID_ARGS
- raises Out_of_memory
NLopt returned NLOPT_OUT_OF_MEMORY
- raises Failure
NLopt returned NLOPT_FAILURE
- raises Roundoff_limited
NLopt returned NLOPT_ROUNDOFF_LIMITED
val get_dimension : 'a t -> int
Bound constraints
Nonlinear constraints
Stopping criteria
val set_stopval : 'a t -> float -> unitval get_stopval : 'a t -> floatval set_ftol_rel : 'a t -> float -> unitval get_ftol_rel : 'a t -> floatval set_ftol_abs : 'a t -> float -> unitval get_ftol_abs : 'a t -> floatval set_xtol_rel : 'a t -> float -> unitval get_xtol_rel : 'a t -> floatval set_xtol_abs : 'a t -> float array -> unitval get_xtol_abs : 'a t -> float arrayval set_maxeval : 'a t -> int -> unitval get_maxeval : 'a t -> intval set_maxtime : 'a t -> float -> unitval get_maxtime : 'a t -> float
Force stop
val force_stop : 'a t -> unit
Local/subsidiary optimization algorithm
Initial step size
Stochastic population
val set_population : 'a t -> int -> unit