Commits

Chris_T committed 17e54e8

Do not parametrize type t by the layout.

Comments (0)

Files changed (1)

-open Bigarray
 
-type 'a vec = (float, float64_elt, 'a) Array1.t
+type vec = $VECTOR
 
 type 'a algorithm
 (** Represent an algorithm, the parameter giving some properties of
 val mlsl_lds : [`Subsidiary | `Global] algorithm
 val slsqp : [`Local | `Grad | `Ineq | `Eq] algorithm
 
-type ('a, 'b) t
+type 'a t
 (** A value containing the information about the optimization problem. *)
 
-val create : 'a algorithm -> int -> 'b layout -> ('a, 'b) t
-val copy : ('a, 'b) t -> ('a, 'b) t
+val create : 'a algorithm -> int -> 'a t
+val copy : 'a t -> 'a t
 
-val dim : ('a, 'b) t -> int
-val algorithm : ('a, 'b) t -> 'a algorithm
+val dim : 'a t -> int
+val algorithm : 'a t -> 'a algorithm
 
-val set_min_objective : ('a, 'b) t -> ?pre:('b vec -> 'b vec -> 'b vec -> unit) ->
-                        ('b vec -> 'b vec -> float) -> unit
-
+val set_min_objective : 'a t -> ?pre:(vec -> vec -> vec -> unit) ->
+                        (vec -> vec -> float) -> unit
 (** [set_min_objective opt f]
 
     @param pre use a preconditionner with approximate Hessians.  The
     This is currently only supported by {!ccsaq} which requires that H
     is positive semidefinite.  *)
 
-val set_max_objective : ('a, 'b) t -> ?pre:('b vec -> 'b vec -> 'b vec -> unit) ->
-                        ('b vec -> 'b vec -> float) -> unit
+val set_max_objective : 'a t -> ?pre:(vec -> vec -> vec -> unit) ->
+                        (vec -> vec -> float) -> unit
 (** See {!set_min_objective}. *)
 
 type result =
   | Maxeval_reached
   | Maxtime_reached
 
-val optimize : ('a, 'b) t -> 'b vec -> result * float
+
+val optimize : 'a t -> vec -> result * float
 (** [optimize opt x] performs the optimization using [x] as an initial
     guess (it must be of size {!dim opt}).  On return, [x] is updated
     with the optimized values of the parameters and the second
     @raise Invalid_argument
     @raise Out_of_memory
     @raise Failure (not sure about reusing that one)
+    @raise Roundoff_limited
  *)
 
 (** {2 Bound constraints} *)
 
-val set_lower_bounds : ('a, 'b) t -> 'b vec -> unit
-val get_lower_bounds : ?y: 'b vec -> ('a, 'b) t -> 'b vec
-val set_upper_bounds : ('a, 'b) t -> 'b vec -> unit
-val get_upper_bounds : ?y: 'b vec -> ('a, 'b) t -> 'b vec
+val set_lower_bounds : 'a t -> vec -> unit
+val get_lower_bounds : ?y: vec -> 'a t -> vec
+val set_upper_bounds : 'a t -> vec -> unit
+val get_upper_bounds : ?y: vec -> 'a t -> vec
 
 (** {2 Nonlinear constraints} *)
 
 val add_inequality_constraint :
-  ([> `Ineq], 'b) t -> ?tol:float -> ('b vec -> 'b vec -> float) -> unit
+  [> `Ineq] t -> ?tol:float -> (vec -> vec -> float) -> unit
 val add_equality_constraint :
-  ([> `Eq], 'b) t -> ?tol:float -> ('b vec -> 'b vec -> float) -> unit
+  [> `Eq] t -> ?tol:float -> (vec -> vec -> float) -> unit
 
 val add_inequality_mconstraint :
-  ([> `Ineq], 'b) t -> tol: 'b vec -> ('b vec -> 'b vec -> 'b vec) -> unit
+  [> `Ineq] t -> tol: vec -> (vec -> vec -> vec) -> unit
 
 val add_equality_mconstraint :
-  ([> `Eq], 'b) t -> tol: 'b vec -> ('b vec -> 'b vec -> 'b vec) -> unit
+  [> `Eq] t -> tol: vec -> (vec -> vec -> vec) -> unit
 
 (** {2 Stopping criteria} *)
 
-val set_stopval: ('a, 'b) ('a, 'b) t -> float -> unit
-val get_stopval: ('a, 'b) ('a, 'b) t -> float
+val set_stopval: 'a t -> float -> unit
+val get_stopval: 'a t -> float
 
-val set_ftol_rel: ('a, 'b) t -> float -> unit
-val get_ftol_rel: ('a, 'b) t -> float
+val set_ftol_rel: 'a t -> float -> unit
+val get_ftol_rel: 'a t -> float
 
-val set_ftol_abs: ('a, 'b) t -> float -> unit
-val get_ftol_abs: ('a, 'b) t -> float
+val set_ftol_abs: 'a t -> float -> unit
+val get_ftol_abs: 'a t -> float
 
-val set_xtol_rel: ('a, 'b) t -> float -> unit
-val get_xtol_rel: ('a, 'b) t -> float
+val set_xtol_rel: 'a t -> float -> unit
+val get_xtol_rel: 'a t -> float
 
-val set_xtol_abs: ('a, 'b) t -> float array -> unit
-val get_xtol_abs: ('a, 'b) t -> float array
+val set_xtol_abs: 'a t -> vec -> unit
+val get_xtol_abs: 'a t -> vec
 
-val set_maxeval: ('a, 'b) t -> int -> unit
-val get_maxeval: ('a, 'b) t -> int
+val set_maxeval: 'a t -> int -> unit
+val get_maxeval: 'a t -> int
 
-val set_maxtime: ('a, 'b) t -> float -> unit
-val get_maxtime: ('a, 'b) t -> float
+val set_maxtime: 'a t -> float -> unit
+val get_maxtime: 'a t -> float
 
 val force_stop: t -> unit
 (* This should not be exported.  Use it to deal with exceptions raised
 
 (** {2 Local/subsidiary optimization algorithm} *)
 
-val set_local_optimizer :
-  ([> `Subsidiary], 'b) t -> ([> `Local | `Global], 'c) t -> unit
+val set_local_optimizer : [> `Subsidiary] t -> [> `Local | `Global] t -> unit
 
 (** {2 Initial step size} *)
 
-val set_initial_step: ('a, 'b) t -> dx: 'b vec -> unit
-val set_initial_step_heuristics: ('a, 'b) t -> unit
-val get_initial_step: ('a, 'b) t -> 'b vec -> 'b vec
+val set_initial_step: 'a t -> dx: vec -> unit
+val set_initial_step_heuristics: 'a t -> unit
+val get_initial_step: 'a t -> vec -> vec
 
 (** {2 Stochastic population} *)
 
-val set_population: ('a, 'b) t -> int -> unit
+val set_population: 'a t -> int -> unit
 
 (** {2 Pseudorandom numbers} *)
 
 
 (** {2 Vector storage for limited-memory quasi-Newton algorithms} *)
 
-val set_vector_storage: ('a, 'b) t -> int -> unit
-val get_vector_storage: ('a, 'b) t -> int
+val set_vector_storage: 'a t -> int -> unit
+val get_vector_storage: 'a t -> int
 
 
 (** {2 Version number} *)
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.