From f8c60d12b07875290b763cc13c26ec66aaf5409c Mon Sep 17 00:00:00 2001 From: Alexandre Jesus Date: Wed, 10 Dec 2025 23:55:35 +0000 Subject: Day 10 (learned to use ctypes :)) --- external/glpk/function_description.ml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 external/glpk/function_description.ml (limited to 'external/glpk/function_description.ml') diff --git a/external/glpk/function_description.ml b/external/glpk/function_description.ml new file mode 100644 index 0000000..3dd469a --- /dev/null +++ b/external/glpk/function_description.ml @@ -0,0 +1,37 @@ +open Ctypes + +module Types = Types_generated + +module Functions (F : Ctypes.FOREIGN) = struct + open F + + let glp_create_prob = foreign "glp_create_prob" (void @-> returning Types.glp_prob) + + let glp_delete_prob = foreign "glp_delete_prob" (Types.glp_prob @-> returning void) + + let glp_add_rows = foreign "glp_add_rows" (Types.glp_prob @-> int @-> returning void) + + let glp_add_cols = foreign "glp_add_cols" (Types.glp_prob @-> int @-> returning void) + + let glp_set_row_bnds = foreign "glp_set_row_bnds" (Types.glp_prob @-> int @-> int @-> double @-> double @-> returning void) + + let glp_set_col_bnds = foreign "glp_set_col_bnds" (Types.glp_prob @-> int @-> int @-> double @-> double @-> returning void) + + let glp_set_col_kind = foreign "glp_set_col_kind" (Types.glp_prob @-> int @-> int @-> returning void) + + let glp_set_obj_coef = foreign "glp_set_obj_coef" (Types.glp_prob @-> int @-> double @-> returning void) + + let glp_set_obj_dir = foreign "glp_set_obj_dir" (Types.glp_prob @-> int @-> returning void) + + let glp_set_mat_col = foreign "glp_set_mat_col" (Types.glp_prob @-> int @-> int @-> ptr int @-> ptr double @-> returning void) + + let glp_simplex = foreign "glp_simplex" (Types.glp_prob @-> Types.glp_smcp_ptr @-> returning void) + + let glp_intopt = foreign "glp_intopt" (Types.glp_prob @-> Types.glp_iocp_ptr @-> returning void) + + let glp_mip_status = foreign "glp_mip_status" (Types.glp_prob @-> returning int) + + let glp_mip_obj_val = foreign "glp_mip_obj_val" (Types.glp_prob @-> returning double) + + let glp_term_out = foreign "glp_term_out" (int @-> returning int) +end -- cgit v1.2.3