Glpk* OCaml bindings to glpk. Please see the glpk manual for further explanations * on the semantics of functions. * * Warning: contrarily to the C version of glpk, all indexes are 0-based. * *
Type of bounds of an auxiliary variable.
type prob_class = | Linear_prog | (* linear programming *) |
| Mixed_integer_prog | (* mixed integer programming *) |
Class of a problem.
Kind of a variable.
The problem has no rows/columns, or the initial basis is invalid, or the initial basis matrix is singular or ill-conditionned.
The LP basis is invalid beacause the number of basic variables is not the same as the number of rows.
The objective function being minimized has reached its lower limit and continues decreasing.
The objective function being maximized has reached its upper limit and continues increasing.
Failure of the solver (the current basis matrix got singular or ill-conditionned).
val new_problem : unit -> lpCreate a new linear programmation problem.
val make_problem : direction -> float array -> float array array -> (float * float) array -> (float * float) array -> lpmake_problem dir zcoefs constrs pbounds xbounds creates the new linear programmation problem where Z = Sum_i zcoefs.(i) * x_ i should be optimized in the direction dir under the constraints fst pbounds.(i) <= p_i <= snd pbounds.(i) and fst xbounds.(i) <= x_i <= snd xbounds.(i) where p_i = Sum_j constrs.(i).(j) * x_j. The bounds may be + / - infinity.
val read_cplex : string -> lpRead problem data in CPLEX LP format from a file.
val write_cplex : lp -> string -> unitWrite prblem data in CPLEX LP format into a file.
val set_prob_name : lp -> string -> unitSet the problem name.
val get_prob_name : lp -> stringRetrieve the problem name.
val set_class : lp -> prob_class -> unitSet the problem class.
val get_class : lp -> prob_classRetrieve the problem class.
val set_obj_name : lp -> string -> unitSet the objective name.
val get_obj_name : lp -> stringRetrieve the objective name.
val add_rows : lp -> int -> unitAdd rows.
val get_num_rows : lp -> intRetreive the number of rows.
val set_row_name : lp -> int -> string -> unitSet the name of a row.
val get_row_name : lp -> int -> stringRetrieve the name of a row.
val set_row_bounds : lp -> int -> aux_var_type -> float -> float -> unitSet a row bound.
val add_columns : lp -> int -> unitAdd columns.
val get_num_cols : lp -> intRetreive the number of columns.
val set_col_name : lp -> int -> string -> unitSet the name of a column.
val get_col_name : lp -> int -> stringRetrieve the name of a column.
val set_col_bounds : lp -> int -> aux_var_type -> float -> float -> unitSet a column boudaries.
val set_obj_coef : lp -> int -> float -> unitSet an objective coefficient.
val load_matrix : lp -> float array array -> unitLoad a constraint matrix.
val load_sparse_matrix : lp -> ((int * int) * float) array -> unitLoad a sparse constraint matrix stored as an array whose elements are of the * form ((row, column), value) indicating non-null elements of the matrix.
val scale_problem : lp -> unitScale problem data.
val unscale_problem : lp -> unitUnscale problem data.
val warm_up : lp -> unitWarm up the LP basis for the specified problem object using current statuses assigned to rows and columns.
val simplex : lp -> unitSolve an LP problem using the simplex method. You must use builtin presolver * (see use_presolver) to get an exception if the problem has no feasible * solution.
val interior : lp -> unitSolve an LP problem using the primal-dual interior point method.
val branch_and_bound : lp -> unitSolve a MIP proble using the branch-and-bound method.
val branch_and_bound_opt : lp -> unitSolve a MIP proble using and optimized version of the branch-and-bound method.
val get_obj_val : lp -> floatRetrieve objective value.
val get_col_primal : lp -> int -> floatGet the primal value of the structural variable associated with a column.
val get_col_primals : lp -> float arrayGet the primal values of the structural variables associated with each column.
val get_row_primal : lp -> int -> floatGet the primal value of the structural variable associated with a row.
val get_row_dual : lp -> int -> floatGet the dual value of the structural variable associated with a row.
val set_message_level : lp -> int -> unitSet the level of messages output by sover routines. The second argument might be:
val use_presolver : lp -> bool -> unitUse the builtin LP-presolver in simplex?
val set_simplex_iteration_count : lp -> int -> unitInitialize the simplex iteration counter.
val reset_simplex_iteration_count : lp -> unitReset the simplex iteration counter.
val get_simplex_iteration_count : lp -> intThis number is incremented after each simplex iteration.
val set_simplex_iteration_limit : lp -> int -> unitSet the maximum number of iterations that simplex should do.
val get_simplex_iteration_limit : lp -> intRetrieve the maximum number of iterations that simplex should do.
val set_simplex_time_limit : lp -> float -> unitSet the maximum amount of time that simplex should take.
val get_simplex_time_limit : lp -> floatRetrieve the maximum amount of time that simplex should take.