mkur avatar mkur committed 995d7f3

Changed definition of the optimization result type.

Comments (0)

Files changed (2)

 type 'a t
 
 type result = 
-  | NLOPT_FAILURE
-  | NLOPT_INVALID_ARGS
-  | NLOPT_OUT_OF_MEMORY
-  | NLOPT_ROUNDOFF_LIMITED
-  | NLOPT_FORCED_STOP
-  | NLOPT_SUCCESS
-  | NLOPT_STOPVAL_REACHED
-  | NLOPT_FTOL_REACHED
-  | NLOPT_XTOL_REACHED 
-  | NLOPT_MAXEVAL_REACHED 
-  | NLOPT_MAXTIME_REACHED
-      
+| 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
+    
 exception Roundoff_limited
 exception Forced_stop
 
 let check_result = function
-    NLOPT_FAILURE -> raise (Failure "NLOPT_FAILURE")
-  | NLOPT_INVALID_ARGS -> raise (Invalid_argument "NLOPT_INVALID_ARGS")
-  | NLOPT_OUT_OF_MEMORY -> raise Out_of_memory
-  | NLOPT_ROUNDOFF_LIMITED -> raise Roundoff_limited
-  | NLOPT_FORCED_STOP -> raise Forced_stop
+  | Failure_res -> raise (Failure "NLOPT_FAILURE")
+  | Invalid_args_res -> raise (Invalid_argument "NLOPT_INVALID_ARGS")
+  | Out_of_memory_res -> raise Out_of_memory
+  | Roundoff_limited_res -> raise Roundoff_limited
+  | Forced_stop_res -> raise Forced_stop
   | x -> x
 ;;
 
 let string_of_result = function 
-    NLOPT_FAILURE -> "NLOPT_FAILURE"
-  | NLOPT_INVALID_ARGS -> "NLOPT_INVALID_ARGS"
-  | NLOPT_OUT_OF_MEMORY -> "NLOPT_OUT_OF_MEMORY"
-  | NLOPT_ROUNDOFF_LIMITED -> "NLOPT_ROUNDOFF_LIMITED"
-  | NLOPT_FORCED_STOP -> "NLOPT_FORCED_STOP"
-  | NLOPT_SUCCESS -> "NLOPT_SUCCESS"
-  | NLOPT_STOPVAL_REACHED -> "NLOPT_STOPVAL_REACHED"
-  | NLOPT_FTOL_REACHED -> "NLOPT_FTOL_REACHED"
-  | NLOPT_XTOL_REACHED -> "NLOPT_XTOL_REACHED"
-  | NLOPT_MAXEVAL_REACHED -> "NLOPT_MAXEVAL_REACHED"
-  | NLOPT_MAXTIME_REACHED -> "NLOPT_MAXTIME_REACHED"
+  | 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"
 ;;
 
 external create: 'a algorithm -> int -> 'a t = "ml_nlopt_create"
 type 'a t
 
 type result =
-  NLOPT_FAILURE
-| NLOPT_INVALID_ARGS
-| NLOPT_OUT_OF_MEMORY
-| NLOPT_ROUNDOFF_LIMITED
-| NLOPT_FORCED_STOP
-| NLOPT_SUCCESS
-| NLOPT_STOPVAL_REACHED
-| NLOPT_FTOL_REACHED
-| NLOPT_XTOL_REACHED
-| NLOPT_MAXEVAL_REACHED
-| NLOPT_MAXTIME_REACHED
+| 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
 
 exception Roundoff_limited
 exception Forced_stop
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.