mkur avatar mkur committed cdb2b80

Added missing nlopt.odocl

Comments (0)

Files changed (3)

+# OASIS_START
+# DO NOT EDIT (digest: 868c6698804d46c13ff6485f7cf76070)
+src/Nlopt
+# OASIS_STOP
   | Out_of_memory_res -> raise Out_of_memory
   | Roundoff_limited_res -> raise Roundoff_limited
   | Forced_stop_res -> raise Forced_stop
-  | x -> x
+  | Success -> `Success
+  | Stopval_reached -> `Stopval_reached
+  | Ftol_reached -> `Ftol_reached
+  | Xtol_reached -> `Xtol_reached
+  | Maxeval_reached -> `Maxeval_reached
+  | Maxtime_reached -> `Maxtime_reached
 ;;
 
 let string_of_result = function 
-  | Failure_res -> "NLOPT_FAILURE"
-  | Invalid_args_res -> "NLOPT_INVALID_ARGS"
-  | Out_of_memory_res -> "NLOPT_OUT_OF_MEMORY"
-  | Roundoff_limited_res -> "NLOPT_ROUNDOFF_LIMITED"
-  | Forced_stop_res -> "NLOPT_FORCED_STOP"
-  | Success -> "NLOPT_SUCCESS"
-  | Stopval_reached -> "NLOPT_STOPVAL_REACHED"
-  | Ftol_reached -> "NLOPT_FTOL_REACHED"
-  | Xtol_reached -> "NLOPT_XTOL_REACHED"
-  | Maxeval_reached -> "NLOPT_MAXEVAL_REACHED"
-  | Maxtime_reached -> "NLOPT_MAXTIME_REACHED"
+  | `Success -> "NLOPT_SUCCESS"
+  | `Stopval_reached -> "NLOPT_STOPVAL_REACHED"
+  | `Ftol_reached -> "NLOPT_FTOL_REACHED"
+  | `Xtol_reached -> "NLOPT_XTOL_REACHED"
+  | `Maxeval_reached -> "NLOPT_MAXEVAL_REACHED"
+  | `Maxtime_reached -> "NLOPT_MAXTIME_REACHED"
 ;;
 
 external create: 'a algorithm -> int -> 'a t = "ml_nlopt_create"
+
+(** OCaml interface to the NLopt optimization library *)
 
 type 'a algorithm
+(** Represent an algorithm, the parameter giving some properties of the algorithm. *)
 
 val direct : [`Global ] algorithm
 val direct_l : [`Global | `Ineq] algorithm
 val slsqp : [`Local | `Grad | `Ineq | `Eq] algorithm
 
 type 'a t
-
-type result =
-| Failure_res
-| Invalid_args_res
-| Out_of_memory_res
-| Roundoff_limited_res
-| Forced_stop_res
-| Success
-| Stopval_reached
-| Ftol_reached
-| Xtol_reached
-| Maxeval_reached
-| Maxtime_reached
+(** A value containing the information about the optimization problem. *)
 
 exception Roundoff_limited
 exception Forced_stop
 
 val create : 'a algorithm -> int -> 'a t
-
+  
 val set_min_objective : 'a t -> (float array -> (float array option) -> float) -> unit
 val set_max_objective : 'a t -> (float array -> (float array option) -> float) -> unit
-val optimize : 'a t -> float array -> (result * float array * float) 
+
+val optimize : 'a t -> float array -> ([> `Success | `Stopval_reached | `Stopval_reached | `Ftol_reached | `Xtol_reached | `Maxeval_reached | `Maxtime_reached ] * float array * float) 
+(** [optimize opt x] performs the optimization using [x] as an initial guess (it must be of size get_dimension opt). Returns a triple [(result, xopt, fopt)] where [xopt] is the optimzed value and [fopt] is the function value at that optimum.
+
+    @raise Invalid_argument [x] does not match the dimension of [opt] or NLopt returned NLOPT_INVALID_ARGS
+    @raise Out_of_memory NLopt returned NLOPT_OUT_OF_MEMORY
+    @raise Failure NLopt returned NLOPT_FAILURE
+    @raise Roundoff_limited NLopt returned NLOPT_ROUNDOFF_LIMITED
+ *)
+
 
 val get_dimension : 'a t -> int
 
+(** {2 Bound constraints} *)
+
 val set_lower_bounds : 'a t -> float array -> unit
 val get_lower_bounds : 'a t -> float array 
 val set_upper_bounds : 'a t -> float array -> unit
 val get_upper_bounds : 'a t -> float array 
 
+(** {2 Nonlinear constraints} *)
+
 val add_inequality_constraint: [>`Ineq] t -> (float array -> (float array) option -> float) -> float -> unit
 val add_equality_constraint: [>`Eq] t -> (float array -> (float array) option -> float) -> float -> unit
+
+(** {2 Stopping criteria} *)
   
 val set_stopval: 'a t -> float -> unit
 val get_stopval: 'a t -> float 
 val set_maxtime: 'a t -> float -> unit
 val get_maxtime: 'a t -> float 
 
-val force_stop: 'a t -> unit
+(** {2 Local/subsidiary optimization algorithm} *)
 
 val set_local_optimizer: [>`Subsidiary] t -> 'a t -> unit
 
+(** {2 Initial step size} *)
+
 val set_initial_step: 'a t -> float array -> unit
 val get_initial_step: 'a t -> float array -> float array
 
+(** {2 Stochastic population} *)
+
 val set_population: 'a t -> int -> unit
 
+(** {2 Vector storage for limited-memory quasi-Newton algorithms} *)
+
 val set_vector_storage: 'a t -> int -> unit
 val get_vector_storage: 'a t -> int
 
+(** {2 Utility functions} *)
+
 val version: unit -> int * int * int
 
-val string_of_result : result -> string
+val string_of_result :  [< `Success | `Stopval_reached | `Stopval_reached | `Ftol_reached | `Xtol_reached | `Maxeval_reached | `Maxtime_reached ] -> string
+  
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.