public class GLPK extends Object implements GLPKConstants
Please, refer to doc/glpk-java.pdf of the GLPK for Java distribution and to doc/glpk.pdf of the GLPK source distribution for details. You can download the source distribution from ftp://ftp.gnu.org/gnu/glpk.
For handling arrays of int and double the following methods are provided:
new_doubleArray(int)
,
delete_doubleArray(SWIGTYPE_p_double)
,
doubleArray_getitem(SWIGTYPE_p_double, int)
,
doubleArray_setitem(SWIGTYPE_p_double, int, double)
,
new_intArray(int)
,
delete_intArray(SWIGTYPE_p_int)
,
intArray_getitem(SWIGTYPE_p_int, int)
,
intArray_setitem(SWIGTYPE_p_int, int, int)
GLP_ASN_MAX, GLP_ASN_MIN, GLP_ASN_MMP, GLP_BF_BG, GLP_BF_BTF, GLP_BF_FT, GLP_BF_GR, GLP_BF_LUF, GLP_BR_DTH, GLP_BR_FFV, GLP_BR_LFV, GLP_BR_MFV, GLP_BR_PCH, GLP_BS, GLP_BT_BFS, GLP_BT_BLB, GLP_BT_BPH, GLP_BT_DFS, GLP_BV, GLP_CV, GLP_DB, GLP_DN_BRNCH, GLP_DUAL, GLP_DUALP, GLP_EBADB, GLP_EBOUND, GLP_ECOND, GLP_EDATA, GLP_EFAIL, GLP_EINSTAB, GLP_EITLIM, GLP_EMIPGAP, GLP_ENOCVG, GLP_ENODFS, GLP_ENOFEAS, GLP_ENOPFS, GLP_EOBJLL, GLP_EOBJUL, GLP_ERANGE, GLP_EROOT, GLP_ESING, GLP_ESTOP, GLP_ETMLIM, GLP_FEAS, GLP_FR, GLP_FX, GLP_IBINGO, GLP_IBRANCH, GLP_ICUTGEN, GLP_IHEUR, GLP_INFEAS, GLP_IPREPRO, GLP_IPT, GLP_IROWGEN, GLP_ISELECT, GLP_IV, GLP_JAVA_A_CAP, GLP_JAVA_A_COST, GLP_JAVA_A_LOW, GLP_JAVA_A_RC, GLP_JAVA_A_SIZE, GLP_JAVA_A_X, GLP_JAVA_MSG_LVL_ALL, GLP_JAVA_MSG_LVL_OFF, GLP_JAVA_V_CUT, GLP_JAVA_V_PI, GLP_JAVA_V_RHS, GLP_JAVA_V_SET, GLP_JAVA_V_SIZE, GLP_KKT_CS, GLP_KKT_DB, GLP_KKT_DE, GLP_KKT_PB, GLP_KKT_PE, GLP_LO, GLP_MAJOR_VERSION, GLP_MAX, GLP_MIN, GLP_MINOR_VERSION, GLP_MIP, GLP_MPS_DECK, GLP_MPS_FILE, GLP_MSG_ALL, GLP_MSG_DBG, GLP_MSG_ERR, GLP_MSG_OFF, GLP_MSG_ON, GLP_NF, GLP_NL, GLP_NO_BRNCH, GLP_NOFEAS, GLP_NS, GLP_NU, GLP_OFF, GLP_ON, GLP_OPT, GLP_ORD_AMD, GLP_ORD_NONE, GLP_ORD_QMD, GLP_ORD_SYMAMD, GLP_PP_ALL, GLP_PP_NONE, GLP_PP_ROOT, GLP_PRIMAL, GLP_PT_PSE, GLP_PT_STD, GLP_RF_CLQ, GLP_RF_COV, GLP_RF_CUT, GLP_RF_GMI, GLP_RF_LAZY, GLP_RF_MIR, GLP_RF_REG, GLP_RT_FLIP, GLP_RT_HAR, GLP_RT_STD, GLP_SF_2N, GLP_SF_AUTO, GLP_SF_EQ, GLP_SF_GM, GLP_SF_SKIP, GLP_SOL, GLP_UNBND, GLP_UNDEF, GLP_UP, GLP_UP_BRNCH, GLP_USE_AT, GLP_USE_NT
Constructor and Description |
---|
GLPK() |
Modifier and Type | Method and Description |
---|---|
static void |
delete_doubleArray(SWIGTYPE_p_double ary)
Deletes an array of double.
|
static void |
delete_intArray(SWIGTYPE_p_int ary)
Deletes an array of int.
|
static double |
doubleArray_getitem(SWIGTYPE_p_double ary,
int index)
Retrieves an element of an array of double.
|
static void |
doubleArray_setitem(SWIGTYPE_p_double ary,
int index,
double value)
Sets the value of an element of an array of double.
|
static glp_arc |
glp_add_arc(glp_graph G,
int i,
int j)
glp_add_arc - add new arc to graph .
|
static int |
glp_add_cols(glp_prob P,
int ncs)
glp_add_cols - add new columns to problem object .
|
static int |
glp_add_rows(glp_prob P,
int nrs)
glp_add_rows - add new rows to problem object .
|
static int |
glp_add_vertices(glp_graph G,
int nadd)
glp_add_vertices - add new vertices to graph .
|
static void |
glp_adv_basis(glp_prob P,
int flags) |
static SWIGTYPE_p_void |
glp_alloc(int n,
int size)
glp_alloc - allocate memory block .
|
static void |
glp_analyze_bound(glp_prob P,
int k,
SWIGTYPE_p_double value1,
SWIGTYPE_p_int var1,
SWIGTYPE_p_double value2,
SWIGTYPE_p_int var2)
glp_analyze_bound - analyze active bound of non-basic variable .
|
static void |
glp_analyze_coef(glp_prob P,
int k,
SWIGTYPE_p_double coef1,
SWIGTYPE_p_int var1,
SWIGTYPE_p_double value1,
SWIGTYPE_p_double coef2,
SWIGTYPE_p_int var2,
SWIGTYPE_p_double value2)
glp_analyze_coef - analyze objective coefficient at basic variable .
|
static int |
glp_asnprob_hall(glp_graph G,
int v_set,
int a_x)
glp_asnprob_hall - find bipartite matching of maximum cardinality .
|
static int |
glp_asnprob_lp(glp_prob P,
int form,
glp_graph G,
int names,
int v_set,
int a_cost)
glp_asnprob_lp - convert assignment problem to LP .
|
static int |
glp_asnprob_okalg(int form,
glp_graph G,
int v_set,
int a_cost,
SWIGTYPE_p_double sol,
int a_x) |
static void |
glp_assert_(String expr,
String file,
int line)
glp_assert - check for logical condition .
|
static int |
glp_at_error()
glp_at_error - check for error state .
|
static int |
glp_bf_exists(glp_prob P)
glp_bf_exists - check if the basis factorization exists .
|
static int |
glp_bf_updated(glp_prob P)
glp_bf_updated - check if the basis factorization has been updated .
|
static void |
glp_btran(glp_prob P,
SWIGTYPE_p_double x)
glp_btran - perform backward transformation (solve system B'*x = b) .
|
static int |
glp_check_asnprob(glp_graph G,
int v_set)
glp_check_asnprob - check correctness of assignment problem data .
|
static int |
glp_check_cnfsat(glp_prob P) |
static int |
glp_check_dup(int m,
int n,
int ne,
SWIGTYPE_p_int ia,
SWIGTYPE_p_int ja)
glp_check_dup - check for duplicate elements in sparse matrix .
|
static void |
glp_check_kkt(glp_prob P,
int sol,
int cond,
SWIGTYPE_p_double ae_max,
SWIGTYPE_p_int ae_ind,
SWIGTYPE_p_double re_max,
SWIGTYPE_p_int re_ind) |
static int |
glp_close_tee()
glp_close_tee - stop copying terminal output to text file .
|
static String |
glp_config(String option) |
static void |
glp_copy_prob(glp_prob dest,
glp_prob prob,
int names)
glp_copy_prob - copy problem object content .
|
static double |
glp_cpp(glp_graph G,
int v_t,
int v_es,
int v_ls) |
static void |
glp_cpx_basis(glp_prob P)
glp_cpx_basis - construct Bixby's initial LP basis .
|
static glp_graph |
glp_create_graph(int v_size,
int a_size) |
static void |
glp_create_index(glp_prob P)
glp_create_index - create the name index .
|
static glp_prob |
glp_create_prob() |
static void |
glp_create_v_index(glp_graph G) |
static void |
glp_del_arc(glp_graph G,
glp_arc a)
glp_del_arc - delete arc from graph .
|
static void |
glp_del_cols(glp_prob P,
int ncs,
SWIGTYPE_p_int num)
glp_del_cols - delete columns from problem object .
|
static void |
glp_del_rows(glp_prob P,
int nrs,
SWIGTYPE_p_int num)
glp_del_rows - delete rows from problem object .
|
static void |
glp_del_vertices(glp_graph G,
int ndel,
SWIGTYPE_p_int num)
glp_del_vertices - delete vertices from graph .
|
static void |
glp_delete_graph(glp_graph G)
glp_delete_graph - delete graph .
|
static void |
glp_delete_index(glp_prob P)
glp_delete_index - delete the name index .
|
static void |
glp_delete_prob(glp_prob P) |
static void |
glp_delete_v_index(glp_graph G) |
static double |
glp_difftime(double t1,
double t0)
glp_difftime - compute difference between two time values .
|
static int |
glp_dual_rtest(glp_prob P,
int len,
SWIGTYPE_p_int ind,
SWIGTYPE_p_double val,
int dir,
double eps)
glp_dual_rtest - perform dual ratio test .
|
static void |
glp_erase_graph(glp_graph G,
int v_size,
int a_size) |
static void |
glp_erase_prob(glp_prob P) |
static SWIGTYPE_p_f_p_q_const__char_v_______void |
glp_error_(String file,
int line) |
static void |
glp_error_hook(SWIGTYPE_p_f_p_void__void func,
SWIGTYPE_p_void info)
glp_error_hook - install hook to intercept abnormal termination .
|
static int |
glp_eval_tab_col(glp_prob P,
int k,
SWIGTYPE_p_int ind,
SWIGTYPE_p_double val)
glp_eval_tab_col - compute column of the simplex tableau .
|
static int |
glp_eval_tab_row(glp_prob P,
int k,
SWIGTYPE_p_int ind,
SWIGTYPE_p_double val)
glp_eval_tab_row - compute row of the simplex tableau .
|
static int |
glp_exact(glp_prob P,
glp_smcp parm) |
static int |
glp_factorize(glp_prob P) |
static int |
glp_find_col(glp_prob P,
String name)
glp_find_col - find column by its name .
|
static int |
glp_find_row(glp_prob P,
String name)
glp_find_row - find row by its name .
|
static int |
glp_find_vertex(glp_graph G,
String name) |
static int |
glp_free_env()
glp_free_env - free GLPK environment .
|
static void |
glp_free(SWIGTYPE_p_void ptr)
glp_free - free (deallocate) memory block .
|
static void |
glp_ftran(glp_prob P,
SWIGTYPE_p_double x)
glp_ftran - perform forward transformation (solve system B*x = b) .
|
static void |
glp_get_bfcp(glp_prob P,
glp_bfcp parm)
glp_get_bfcp - retrieve basis factorization control parameters .
|
static int |
glp_get_bhead(glp_prob P,
int k)
glp_get_bhead - retrieve the basis header information .
|
static int |
glp_get_col_bind(glp_prob P,
int j)
glp_get_col_bind - retrieve column index in the basis header .
|
static double |
glp_get_col_dual(glp_prob P,
int j)
glp_get_col_dual - retrieve column dual value (basic solution) .
|
static int |
glp_get_col_kind(glp_prob P,
int j)
glp_get_col_kind - retrieve column kind .
|
static double |
glp_get_col_lb(glp_prob P,
int j)
glp_get_col_lb - retrieve column lower bound .
|
static String |
glp_get_col_name(glp_prob P,
int j)
glp_get_col_name - retrieve column name .
|
static double |
glp_get_col_prim(glp_prob P,
int j)
glp_get_col_prim - retrieve column primal value (basic solution) .
|
static int |
glp_get_col_stat(glp_prob P,
int j)
glp_get_col_stat - retrieve column status .
|
static int |
glp_get_col_type(glp_prob P,
int j)
glp_get_col_type - retrieve column type .
|
static double |
glp_get_col_ub(glp_prob P,
int j)
glp_get_col_ub - retrieve column upper bound .
|
static int |
glp_get_dual_stat(glp_prob P)
glp_get_dual_stat - retrieve status of dual basic solution .
|
static int |
glp_get_it_cnt(glp_prob P) |
static int |
glp_get_mat_col(glp_prob P,
int j,
SWIGTYPE_p_int ind,
SWIGTYPE_p_double val)
glp_get_mat_col - retrieve column of the constraint matrix .
|
static int |
glp_get_mat_row(glp_prob P,
int i,
SWIGTYPE_p_int ind,
SWIGTYPE_p_double val)
glp_get_mat_row - retrieve row of the constraint matrix .
|
static int |
glp_get_num_bin(glp_prob P)
glp_get_num_bin - retrieve number of binary columns .
|
static int |
glp_get_num_cols(glp_prob P)
glp_get_num_cols - retrieve number of columns .
|
static int |
glp_get_num_int(glp_prob P)
glp_get_num_int - retrieve number of integer columns .
|
static int |
glp_get_num_nz(glp_prob P)
glp_get_num_nz - retrieve number of constraint coefficients .
|
static int |
glp_get_num_rows(glp_prob P)
glp_get_num_rows - retrieve number of rows .
|
static double |
glp_get_obj_coef(glp_prob P,
int j)
glp_get_obj_coef - retrieve obj.
|
static int |
glp_get_obj_dir(glp_prob P)
glp_get_obj_dir - retrieve optimization direction flag .
|
static String |
glp_get_obj_name(glp_prob P)
glp_get_obj_name - retrieve objective function name .
|
static double |
glp_get_obj_val(glp_prob P)
glp_get_obj_val - retrieve objective value (basic solution) .
|
static int |
glp_get_prim_stat(glp_prob P)
glp_get_prim_stat - retrieve status of primal basic solution .
|
static String |
glp_get_prob_name(glp_prob P)
glp_get_prob_name - retrieve problem name .
|
static double |
glp_get_rii(glp_prob P,
int i)
glp_get_rii - retrieve row scale factor .
|
static int |
glp_get_row_bind(glp_prob P,
int i)
glp_get_row_bind - retrieve row index in the basis header .
|
static double |
glp_get_row_dual(glp_prob P,
int i)
glp_get_row_dual - retrieve row dual value (basic solution) .
|
static double |
glp_get_row_lb(glp_prob P,
int i)
glp_get_row_lb - retrieve row lower bound .
|
static String |
glp_get_row_name(glp_prob P,
int i)
glp_get_row_name - retrieve row name .
|
static double |
glp_get_row_prim(glp_prob P,
int i)
glp_get_row_prim - retrieve row primal value (basic solution) .
|
static int |
glp_get_row_stat(glp_prob P,
int i)
glp_get_row_stat - retrieve row status .
|
static int |
glp_get_row_type(glp_prob P,
int i)
glp_get_row_type - retrieve row type .
|
static double |
glp_get_row_ub(glp_prob P,
int i)
glp_get_row_ub - retrieve row upper bound .
|
static double |
glp_get_sjj(glp_prob P,
int j)
glp_get_sjj - retrieve column scale factor .
|
static int |
glp_get_status(glp_prob P)
glp_get_status - retrieve generic status of basic solution .
|
static int |
glp_get_unbnd_ray(glp_prob P)
glp_get_unbnd_ray - determine variable causing unboundedness .
|
static int |
glp_gridgen(glp_graph G,
int v_rhs,
int a_cap,
int a_cost,
SWIGTYPE_p_int parm) |
static void |
glp_init_cpxcp(glp_cpxcp parm)
glp_init_cpxcp - initialize CPLEX LP format control parameters .
|
static int |
glp_init_env()
glp_init_env - initialize GLPK environment .
|
static void |
glp_init_iocp(glp_iocp parm)
glp_init_iocp - initialize integer optimizer control parameters .
|
static void |
glp_init_iptcp(glp_iptcp parm)
glp_init_iptcp - initialize interior-point solver control parameters .
|
static void |
glp_init_mpscp(glp_mpscp parm)
glp_init_mpscp - initialize MPS format control parameters .
|
static void |
glp_init_smcp(glp_smcp parm)
glp_init_smcp - initialize simplex method control parameters .
|
static int |
glp_interior(glp_prob P,
glp_iptcp parm) |
static int |
glp_intfeas1(glp_prob P,
int use_bound,
int obj_bound) |
static int |
glp_intopt(glp_prob P,
glp_iocp parm) |
static int |
glp_ios_add_row(glp_tree T,
String name,
int klass,
int flags,
int len,
SWIGTYPE_p_int ind,
SWIGTYPE_p_double val,
int type,
double rhs) |
static int |
glp_ios_best_node(glp_tree T)
glp_ios_best_node - find active subproblem with best local bound .
|
static void |
glp_ios_branch_upon(glp_tree T,
int j,
int sel)
glp_ios_branch_upon - choose variable to branch upon .
|
static int |
glp_ios_can_branch(glp_tree T,
int j)
glp_ios_can_branch - check if can branch upon specified variable .
|
static void |
glp_ios_clear_pool(glp_tree T) |
static int |
glp_ios_curr_node(glp_tree T)
glp_ios_curr_node - determine current active subproblem .
|
static void |
glp_ios_del_row(glp_tree T,
int i) |
static glp_prob |
glp_ios_get_prob(glp_tree T)
glp_ios_get_prob - access the problem object .
|
static int |
glp_ios_heur_sol(glp_tree T,
SWIGTYPE_p_double x)
glp_ios_heur_sol - provide solution found by heuristic .
|
static double |
glp_ios_mip_gap(glp_tree T)
glp_ios_mip_gap - compute relative MIP gap .
|
static int |
glp_ios_next_node(glp_tree T,
int p)
glp_ios_next_node - determine next active subproblem .
|
static double |
glp_ios_node_bound(glp_tree T,
int p)
glp_ios_node_bound - determine subproblem local bound .
|
static SWIGTYPE_p_void |
glp_ios_node_data(glp_tree T,
int p)
glp_ios_node_data - access subproblem application-specific data .
|
static int |
glp_ios_node_level(glp_tree T,
int p)
glp_ios_node_level - determine subproblem level .
|
static int |
glp_ios_pool_size(glp_tree T) |
static int |
glp_ios_prev_node(glp_tree T,
int p)
glp_ios_prev_node - determine previous active subproblem .
|
static int |
glp_ios_reason(glp_tree T)
glp_ios_reason - determine reason for calling the callback routine .
|
static void |
glp_ios_row_attr(glp_tree T,
int i,
glp_attr attr)
glp_ios_row_attr - retrieve additional row attributes .
|
static void |
glp_ios_select_node(glp_tree T,
int p)
glp_ios_select_node - select subproblem to continue the search .
|
static void |
glp_ios_terminate(glp_tree T)
glp_ios_terminate - terminate the solution process.
|
static void |
glp_ios_tree_size(glp_tree T,
SWIGTYPE_p_int a_cnt,
SWIGTYPE_p_int n_cnt,
SWIGTYPE_p_int t_cnt)
glp_ios_tree_size - determine size of the branch-and-bound tree .
|
static int |
glp_ios_up_node(glp_tree T,
int p)
glp_ios_up_node - determine parent subproblem .
|
static double |
glp_ipt_col_dual(glp_prob P,
int j)
glp_ipt_col_dual - retrieve column dual value (interior point) .
|
static double |
glp_ipt_col_prim(glp_prob P,
int j)
glp_ipt_col_prim - retrieve column primal value (interior point) .
|
static double |
glp_ipt_obj_val(glp_prob P)
glp_ipt_obj_val - retrieve objective value (interior point) .
|
static double |
glp_ipt_row_dual(glp_prob P,
int i)
glp_ipt_row_dual - retrieve row dual value (interior point) .
|
static double |
glp_ipt_row_prim(glp_prob P,
int i)
glp_ipt_row_prim - retrieve row primal value (interior point) .
|
static int |
glp_ipt_status(glp_prob P)
glp_ipt_status - retrieve status of interior-point solution .
|
static glp_java_arc_data |
glp_java_arc_get_data(glp_arc arc)
Get arc data.
|
static void |
glp_java_error(String message)
Abort GLPK library with error message.
|
static void |
glp_java_set_msg_lvl(int msg_lvl)
Sets the message level.
|
static void |
glp_java_set_numeric_locale(String locale) |
static glp_java_vertex_data |
glp_java_vertex_data_get(glp_graph G,
int i)
Get vertex data.
|
static glp_java_vertex_data |
glp_java_vertex_get_data(glp_vertex v)
Get vertex data.
|
static glp_vertex |
glp_java_vertex_get(glp_graph G,
int i)
Get vertex.
|
static void |
glp_load_matrix(glp_prob P,
int ne,
SWIGTYPE_p_int ia,
SWIGTYPE_p_int ja,
SWIGTYPE_p_double ar)
glp_load_matrix - load (replace) the whole constraint matrix .
|
static int |
glp_maxflow_ffalg(glp_graph G,
int s,
int t,
int a_cap,
SWIGTYPE_p_double sol,
int a_x,
int v_cut) |
static void |
glp_maxflow_lp(glp_prob P,
glp_graph G,
int names,
int s,
int t,
int a_cap)
glp_maxflow_lp - convert maximum flow problem to LP .
|
static void |
glp_mem_limit(int limit)
glp_mem_limit - set memory usage limit .
|
static void |
glp_mem_usage(SWIGTYPE_p_int count,
SWIGTYPE_p_int cpeak,
SWIGTYPE_p_size_t total,
SWIGTYPE_p_size_t tpeak)
glp_mem_usage - get memory usage information .
|
static void |
glp_mincost_lp(glp_prob P,
glp_graph G,
int names,
int v_rhs,
int a_low,
int a_cap,
int a_cost)
glp_mincost_lp - convert minimum cost flow problem to LP .
|
static int |
glp_mincost_okalg(glp_graph G,
int v_rhs,
int a_low,
int a_cap,
int a_cost,
SWIGTYPE_p_double sol,
int a_x,
int v_pi) |
static int |
glp_mincost_relax4(glp_graph G,
int v_rhs,
int a_low,
int a_cap,
int a_cost,
int crash,
SWIGTYPE_p_double sol,
int a_x,
int a_rc) |
static int |
glp_minisat1(glp_prob P) |
static double |
glp_mip_col_val(glp_prob P,
int j)
glp_mip_col_val - retrieve column value (MIP solution) .
|
static double |
glp_mip_obj_val(glp_prob P)
glp_mip_obj_val - retrieve objective value (MIP solution) .
|
static double |
glp_mip_row_val(glp_prob P,
int i)
glp_mip_row_val - retrieve row value (MIP solution) .
|
static int |
glp_mip_status(glp_prob P)
glp_mip_status - retrieve status of MIP solution .
|
static glp_tran |
glp_mpl_alloc_wksp() |
static void |
glp_mpl_build_prob(glp_tran tran,
glp_prob prob) |
static void |
glp_mpl_free_wksp(glp_tran tran) |
static int |
glp_mpl_generate(glp_tran tran,
String fname) |
static void |
glp_mpl_init_rand(glp_tran tran,
int seed) |
static int |
glp_mpl_postsolve(glp_tran tran,
glp_prob prob,
int sol) |
static int |
glp_mpl_read_data(glp_tran tran,
String fname) |
static int |
glp_mpl_read_model(glp_tran tran,
String fname,
int skip) |
static void |
glp_netgen_prob(int nprob,
SWIGTYPE_p_int parm) |
static int |
glp_netgen(glp_graph G,
int v_rhs,
int a_cap,
int a_cost,
SWIGTYPE_p_int parm) |
static SWIGTYPE_p_glp_prep |
glp_npp_alloc_wksp() |
static void |
glp_npp_build_prob(SWIGTYPE_p_glp_prep prep,
glp_prob Q) |
static void |
glp_npp_free_wksp(SWIGTYPE_p_glp_prep prep) |
static void |
glp_npp_load_prob(SWIGTYPE_p_glp_prep prep,
glp_prob P,
int sol,
int names) |
static void |
glp_npp_obtain_sol(SWIGTYPE_p_glp_prep prep,
glp_prob P) |
static void |
glp_npp_postprocess(SWIGTYPE_p_glp_prep prep,
glp_prob Q) |
static int |
glp_npp_preprocess1(SWIGTYPE_p_glp_prep prep,
int hard) |
static int |
glp_open_tee(String name)
glp_open_tee - start copying terminal output to text file .
|
static int |
glp_prim_rtest(glp_prob P,
int len,
SWIGTYPE_p_int ind,
SWIGTYPE_p_double val,
int dir,
double eps)
glp_prim_rtest - perform primal ratio test .
|
static int |
glp_print_ipt(glp_prob P,
String fname) |
static int |
glp_print_mip(glp_prob P,
String fname) |
static int |
glp_print_ranges(glp_prob P,
int len,
SWIGTYPE_p_int list,
int flags,
String fname) |
static int |
glp_print_sol(glp_prob P,
String fname) |
static void |
glp_printf(String fmt)
glp_printf - write formatted output on terminal .
|
static void |
glp_puts(String s)
glp_puts - write string on terminal .
|
static int |
glp_read_asnprob(glp_graph G,
int v_set,
int a_cost,
String fname)
glp_read_asnprob - read assignment problem data in DIMACS format .
|
static int |
glp_read_ccdata(glp_graph G,
int v_wgt,
String fname)
glp_read_ccdata - read graph in DIMACS clique/coloring format .
|
static int |
glp_read_cnfsat(glp_prob P,
String fname) |
static int |
glp_read_graph(glp_graph G,
String fname)
glp_read_graph - read graph from plain text file .
|
static int |
glp_read_ipt(glp_prob P,
String fname)
glp_read_ipt - read interior-point solution from text file .
|
static int |
glp_read_lp(glp_prob P,
glp_cpxcp parm,
String fname) |
static int |
glp_read_maxflow(glp_graph G,
SWIGTYPE_p_int s,
SWIGTYPE_p_int t,
int a_cap,
String fname)
glp_read_maxflow - read maximum flow problem data in DIMACS format .
|
static int |
glp_read_mincost(glp_graph G,
int v_rhs,
int a_low,
int a_cap,
int a_cost,
String fname)
glp_read_mincost - read min-cost flow problem data in DIMACS format .
|
static int |
glp_read_mip(glp_prob P,
String fname)
glp_read_mip - read MIP solution from text file .
|
static int |
glp_read_mps(glp_prob P,
int fmt,
glp_mpscp parm,
String fname) |
static int |
glp_read_prob(glp_prob P,
int flags,
String fname)
glp_read_prob - read problem data in GLPK format .
|
static int |
glp_read_sol(glp_prob P,
String fname)
glp_read_sol - read basic solution from text file .
|
static SWIGTYPE_p_void |
glp_realloc(SWIGTYPE_p_void ptr,
int n,
int size) |
static int |
glp_rmfgen(glp_graph G,
SWIGTYPE_p_int s,
SWIGTYPE_p_int t,
int a_cap,
SWIGTYPE_p_int parm) |
static void |
glp_scale_prob(glp_prob P,
int flags)
glp_scale_prob - scale problem data .
|
static void |
glp_set_bfcp(glp_prob P,
glp_bfcp parm)
glp_set_bfcp - change basis factorization control parameters .
|
static void |
glp_set_col_bnds(glp_prob P,
int j,
int type,
double lb,
double ub)
glp_set_col_bnds - set (change) column bounds .
|
static void |
glp_set_col_kind(glp_prob P,
int j,
int kind)
glp_set_col_kind - set (change) column kind .
|
static void |
glp_set_col_name(glp_prob P,
int j,
String name)
glp_set_col_name - assign (change) column name .
|
static void |
glp_set_col_stat(glp_prob P,
int j,
int stat)
glp_set_col_stat - set (change) column status .
|
static void |
glp_set_graph_name(glp_graph G,
String name)
glp_set_graph_name - assign (change) graph name .
|
static void |
glp_set_it_cnt(glp_prob P,
int it_cnt) |
static void |
glp_set_mat_col(glp_prob P,
int j,
int len,
SWIGTYPE_p_int ind,
SWIGTYPE_p_double val)
glp_set_mat_col - set (replace) column of the constraint matrix .
|
static void |
glp_set_mat_row(glp_prob P,
int i,
int len,
SWIGTYPE_p_int ind,
SWIGTYPE_p_double val)
glp_set_mat_row - set (replace) row of the constraint matrix .
|
static void |
glp_set_obj_coef(glp_prob P,
int j,
double coef)
glp_set_obj_coef - set (change) obj.
|
static void |
glp_set_obj_dir(glp_prob P,
int dir)
glp_set_obj_dir - set (change) optimization direction flag .
|
static void |
glp_set_obj_name(glp_prob P,
String name)
glp_set_obj_name - assign (change) objective function name .
|
static void |
glp_set_prob_name(glp_prob P,
String name)
glp_set_prob_name - assign (change) problem name .
|
static void |
glp_set_rii(glp_prob P,
int i,
double rii)
glp_set_rii - set (change) row scale factor .
|
static void |
glp_set_row_bnds(glp_prob P,
int i,
int type,
double lb,
double ub)
glp_set_row_bnds - set (change) row bounds .
|
static void |
glp_set_row_name(glp_prob P,
int i,
String name)
glp_set_row_name - assign (change) row name .
|
static void |
glp_set_row_stat(glp_prob P,
int i,
int stat)
glp_set_row_stat - set (change) row status .
|
static void |
glp_set_sjj(glp_prob P,
int j,
double sjj)
glp_set sjj - set (change) column scale factor .
|
static void |
glp_set_vertex_name(glp_graph G,
int i,
String name) |
static int |
glp_simplex(glp_prob P,
glp_smcp parm) |
static void |
glp_sort_matrix(glp_prob P)
glp_sort_matrix - sort elements of the constraint matrix .
|
static void |
glp_std_basis(glp_prob P)
glp_std_basis - construct standard initial LP basis .
|
static int |
glp_strong_comp(glp_graph G,
int v_num)
glp_strong_comp - find all strongly connected components of graph .
|
static void |
glp_term_hook(SWIGTYPE_p_f_p_void_p_q_const__char__int func,
SWIGTYPE_p_void info)
glp_term_hook - install hook to intercept terminal output .
|
static int |
glp_term_out(int flag)
glp_term_out - enable/disable terminal output .
|
static double |
glp_time() |
static int |
glp_top_sort(glp_graph G,
int v_num) |
static int |
glp_transform_col(glp_prob P,
int len,
SWIGTYPE_p_int ind,
SWIGTYPE_p_double val)
glp_transform_col - transform explicitly specified column .
|
static int |
glp_transform_row(glp_prob P,
int len,
SWIGTYPE_p_int ind,
SWIGTYPE_p_double val)
glp_transform_row - transform explicitly specified row .
|
static void |
glp_unscale_prob(glp_prob P)
glp_unscale_prob - unscale problem data .
|
static String |
glp_version()
glp_version - determine library version .
|
static void |
glp_vprintf(String fmt,
SWIGTYPE_p_va_list arg)
glp_vprintf - write formatted output on terminal .
|
static int |
glp_warm_up(glp_prob P)
glp_warm_up - "warm up" LP basis .
|
static int |
glp_wclique_exact(glp_graph G,
int v_wgt,
SWIGTYPE_p_double sol,
int v_set) |
static int |
glp_weak_comp(glp_graph G,
int v_num)
glp_weak_comp - find all weakly connected components of graph .
|
static int |
glp_write_asnprob(glp_graph G,
int v_set,
int a_cost,
String fname)
glp_write_asnprob - write assignment problem data in DIMACS format .
|
static int |
glp_write_ccdata(glp_graph G,
int v_wgt,
String fname)
glp_write_ccdata - write graph in DIMACS clique/coloring format .
|
static int |
glp_write_cnfsat(glp_prob P,
String fname) |
static int |
glp_write_graph(glp_graph G,
String fname)
glp_write_graph - write graph to plain text file .
|
static int |
glp_write_ipt(glp_prob P,
String fname)
glp_write_ipt - write interior-point solution to text file .
|
static int |
glp_write_lp(glp_prob P,
glp_cpxcp parm,
String fname) |
static int |
glp_write_maxflow(glp_graph G,
int s,
int t,
int a_cap,
String fname)
glp_write_maxflow - write maximum flow problem data in DIMACS format .
|
static int |
glp_write_mincost(glp_graph G,
int v_rhs,
int a_low,
int a_cap,
int a_cost,
String fname)
glp_write_mincost - write min-cost flow problem data in DIMACS format .
|
static int |
glp_write_mip(glp_prob P,
String fname)
glp_write_mip - write MIP solution to text file .
|
static int |
glp_write_mps(glp_prob P,
int fmt,
glp_mpscp parm,
String fname) |
static int |
glp_write_prob(glp_prob P,
int flags,
String fname)
glp_write_prob - write problem data in GLPK format .
|
static int |
glp_write_sol(glp_prob P,
String fname)
glp_write_sol - write basic solution to text file .
|
static int |
intArray_getitem(SWIGTYPE_p_int ary,
int index)
Retrieves an element of an array of int.
|
static void |
intArray_setitem(SWIGTYPE_p_int ary,
int index,
int value)
Sets the value of an element of an array of int.
|
static SWIGTYPE_p_double |
new_doubleArray(int nelements)
Creates a new array of double.
|
static SWIGTYPE_p_int |
new_intArray(int nelements)
Creates a new array of int.
|
public static SWIGTYPE_p_int new_intArray(int nelements)
The memory is allocated with calloc(). To free the memory you will have to call delete_intArray. An OutOfMemoryError error indicates that the C-runtime heap of the process (not the Java object heap) is full.
nelements
- number of elementspublic static void delete_intArray(SWIGTYPE_p_int ary)
The memory is deallocated with free().
ary
- arraypublic static int intArray_getitem(SWIGTYPE_p_int ary, int index)
BEWARE: The validity of the index is not checked.
ary
- arrayindex
- index of the elementpublic static void intArray_setitem(SWIGTYPE_p_int ary, int index, int value)
BEWARE: The validity of the index is not checked.
ary
- arrayindex
- index of the elementvalue
- new valuepublic static SWIGTYPE_p_double new_doubleArray(int nelements)
The memory is allocated with calloc(). To free the memory you will have to call delete_doubleArray. An OutOfMemoryError error indicates that the C-runtime heap of the process (not the Java object heap) is full.
nelements
- number of elementspublic static void delete_doubleArray(SWIGTYPE_p_double ary)
The memory is deallocated with free().
ary
- arraypublic static double doubleArray_getitem(SWIGTYPE_p_double ary, int index)
BEWARE: The validity of the index is not checked.
ary
- arrayindex
- index of the elementpublic static void doubleArray_setitem(SWIGTYPE_p_double ary, int index, double value)
BEWARE: The validity of the index is not checked.
ary
- arrayindex
- index of the elementvalue
- new valuepublic static void glp_java_error(String message)
message
- messagepublic static void glp_java_set_msg_lvl(int msg_lvl)
msg_lvl
- message levelGLPKConstants.GLP_JAVA_MSG_LVL_OFF
,
GLPKConstants.GLP_JAVA_MSG_LVL_ALL
public static void glp_java_set_numeric_locale(String locale)
public static glp_java_arc_data glp_java_arc_get_data(glp_arc arc)
arc
- arcpublic static glp_java_vertex_data glp_java_vertex_data_get(glp_graph G, int i)
G
- graphi
- index to vertexpublic static glp_java_vertex_data glp_java_vertex_get_data(glp_vertex v)
v
- vertexpublic static glp_vertex glp_java_vertex_get(glp_graph G, int i)
G
- graphi
- indexpublic static glp_prob glp_create_prob()
public static void glp_set_prob_name(glp_prob P, String name)
SYNOPSIS
void glp_set_prob_name(glp_prob *lp, const char *name);
DESCRIPTION
The routine glp_set_prob_name assigns a given symbolic name (1 up to 255 characters) to the specified problem object.
If the parameter name is NULL or empty string, the routine erases an existing symbolic name of the problem object.
public static void glp_set_obj_name(glp_prob P, String name)
SYNOPSIS
void glp_set_obj_name(glp_prob *lp, const char *name);
DESCRIPTION
The routine glp_set_obj_name assigns a given symbolic name (1 up to 255 characters) to the objective function of the specified problem object.
If the parameter name is NULL or empty string, the routine erases an existing name of the objective function.
public static void glp_set_obj_dir(glp_prob P, int dir)
SYNOPSIS
void glp_set_obj_dir(glp_prob *lp, int dir);
DESCRIPTION
The routine glp_set_obj_dir sets (changes) optimization direction flag (i.e. "sense" of the objective function) as specified by the parameter dir:
GLP_MIN - minimization; GLP_MAX - maximization.
public static int glp_add_rows(glp_prob P, int nrs)
SYNOPSIS
int glp_add_rows(glp_prob *lp, int nrs);
DESCRIPTION
The routine glp_add_rows adds nrs rows (constraints) to the specified problem object. New rows are always added to the end of the row list, so the ordinal numbers of existing rows remain unchanged.
Being added each new row is initially free (unbounded) and has empty list of the constraint coefficients.
RETURNS
The routine glp_add_rows returns the ordinal number of the first new row added to the problem object.
public static int glp_add_cols(glp_prob P, int ncs)
SYNOPSIS
int glp_add_cols(glp_prob *lp, int ncs);
DESCRIPTION
The routine glp_add_cols adds ncs columns (structural variables) to the specified problem object. New columns are always added to the end of the column list, so the ordinal numbers of existing columns remain unchanged.
Being added each new column is initially fixed at zero and has empty list of the constraint coefficients.
RETURNS
The routine glp_add_cols returns the ordinal number of the first new column added to the problem object.
public static void glp_set_row_name(glp_prob P, int i, String name)
SYNOPSIS
void glp_set_row_name(glp_prob *lp, int i, const char *name);
DESCRIPTION
The routine glp_set_row_name assigns a given symbolic name (1 up to 255 characters) to i-th row (auxiliary variable) of the specified problem object.
If the parameter name is NULL or empty string, the routine erases an existing name of i-th row.
public static void glp_set_col_name(glp_prob P, int j, String name)
SYNOPSIS
void glp_set_col_name(glp_prob *lp, int j, const char *name);
DESCRIPTION
The routine glp_set_col_name assigns a given symbolic name (1 up to 255 characters) to j-th column (structural variable) of the specified problem object.
If the parameter name is NULL or empty string, the routine erases an existing name of j-th column.
public static void glp_set_row_bnds(glp_prob P, int i, int type, double lb, double ub)
SYNOPSIS
void glp_set_row_bnds(glp_prob *lp, int i, int type, double lb, double ub);
DESCRIPTION
The routine glp_set_row_bnds sets (changes) the type and bounds of i-th row (auxiliary variable) of the specified problem object.
Parameters type, lb, and ub specify the type, lower bound, and upper bound, respectively, as follows:
Type Bounds Comments
GLP_FR -inf < x < +inf Free variable GLP_LO lb <= x < +inf Variable with lower bound GLP_UP -inf < x <= ub Variable with upper bound GLP_DB lb <= x <= ub Double-bounded variable GLP_FX x = lb Fixed variable
where x is the auxiliary variable associated with i-th row.
If the row has no lower bound, the parameter lb is ignored. If the row has no upper bound, the parameter ub is ignored. If the row is an equality constraint (i.e. the corresponding auxiliary variable is of fixed type), only the parameter lb is used while the parameter ub is ignored.
public static void glp_set_col_bnds(glp_prob P, int j, int type, double lb, double ub)
SYNOPSIS
void glp_set_col_bnds(glp_prob *lp, int j, int type, double lb, double ub);
DESCRIPTION
The routine glp_set_col_bnds sets (changes) the type and bounds of j-th column (structural variable) of the specified problem object.
Parameters type, lb, and ub specify the type, lower bound, and upper bound, respectively, as follows:
Type Bounds Comments
GLP_FR -inf < x < +inf Free variable GLP_LO lb <= x < +inf Variable with lower bound GLP_UP -inf < x <= ub Variable with upper bound GLP_DB lb <= x <= ub Double-bounded variable GLP_FX x = lb Fixed variable
where x is the structural variable associated with j-th column.
If the column has no lower bound, the parameter lb is ignored. If the column has no upper bound, the parameter ub is ignored. If the column is of fixed type, only the parameter lb is used while the parameter ub is ignored.
public static void glp_set_obj_coef(glp_prob P, int j, double coef)
coefficient or constant term
SYNOPSIS
void glp_set_obj_coef(glp_prob *lp, int j, double coef);
DESCRIPTION
The routine glp_set_obj_coef sets (changes) objective coefficient at j-th column (structural variable) of the specified problem object.
If the parameter j is 0, the routine sets (changes) the constant term ("shift") of the objective function.
public static void glp_set_mat_row(glp_prob P, int i, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val)
SYNOPSIS
void glp_set_mat_row(glp_prob *lp, int i, int len, const int ind[], const double val[]);
DESCRIPTION
The routine glp_set_mat_row stores (replaces) the contents of i-th row of the constraint matrix of the specified problem object.
Column indices and numeric values of new row elements must be placed in locations ind[1], ..., ind[len] and val[1], ..., val[len], where 0 <= len <= n is the new length of i-th row, n is the current number of columns in the problem object. Elements with identical column indices are not allowed. Zero elements are allowed, but they are not stored in the constraint matrix.
If the parameter len is zero, the parameters ind and/or val can be specified as NULL.
public static void glp_set_mat_col(glp_prob P, int j, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val)
SYNOPSIS
void glp_set_mat_col(glp_prob *lp, int j, int len, const int ind[], const double val[]);
DESCRIPTION
The routine glp_set_mat_col stores (replaces) the contents of j-th column of the constraint matrix of the specified problem object.
Row indices and numeric values of new column elements must be placed in locations ind[1], ..., ind[len] and val[1], ..., val[len], where 0 <= len <= m is the new length of j-th column, m is the current number of rows in the problem object. Elements with identical column indices are not allowed. Zero elements are allowed, but they are not stored in the constraint matrix.
If the parameter len is zero, the parameters ind and/or val can be specified as NULL.
public static void glp_load_matrix(glp_prob P, int ne, SWIGTYPE_p_int ia, SWIGTYPE_p_int ja, SWIGTYPE_p_double ar)
SYNOPSIS
void glp_load_matrix(glp_prob *lp, int ne, const int ia[], const int ja[], const double ar[]);
DESCRIPTION
The routine glp_load_matrix loads the constraint matrix passed in the arrays ia, ja, and ar into the specified problem object. Before loading the current contents of the constraint matrix is destroyed.
Constraint coefficients (elements of the constraint matrix) must be specified as triplets (ia[k], ja[k], ar[k]) for k = 1, ..., ne, where ia[k] is the row index, ja[k] is the column index, ar[k] is a numeric value of corresponding constraint coefficient. The parameter ne specifies the total number of (non-zero) elements in the matrix to be loaded. Coefficients with identical indices are not allowed. Zero coefficients are allowed, however, they are not stored in the constraint matrix.
If the parameter ne is zero, the parameters ia, ja, and ar can be specified as NULL.
public static int glp_check_dup(int m, int n, int ne, SWIGTYPE_p_int ia, SWIGTYPE_p_int ja)
SYNOPSIS
int glp_check_dup(int m, int n, int ne, const int ia[], const int ja[]);
DESCRIPTION
The routine glp_check_dup checks for duplicate elements (that is, elements with identical indices) in a sparse matrix specified in the coordinate format.
The parameters m and n specifies, respectively, the number of rows and columns in the matrix, m >= 0, n >= 0.
The parameter ne specifies the number of (structurally) non-zero elements in the matrix, ne >= 0.
Elements of the matrix are specified as doublets (ia[k],ja[k]) for k = 1,...,ne, where ia[k] is a row index, ja[k] is a column index.
The routine glp_check_dup can be used prior to a call to the routine glp_load_matrix to check that the constraint matrix to be loaded has no duplicate elements.
RETURNS
The routine glp_check_dup returns one of the following values:
0 - the matrix has no duplicate elements;
-k - indices ia[k] or/and ja[k] are out of range;
+k - element (ia[k],ja[k]) is duplicate.
public static void glp_sort_matrix(glp_prob P)
SYNOPSIS
void glp_sort_matrix(glp_prob *P);
DESCRIPTION
The routine glp_sort_matrix sorts elements of the constraint matrix rebuilding its row and column linked lists. On exit from the routine the constraint matrix is not changed, however, elements in the row linked lists become ordered by ascending column indices, and the elements in the column linked lists become ordered by ascending row indices.
public static void glp_del_rows(glp_prob P, int nrs, SWIGTYPE_p_int num)
SYNOPSIS
void glp_del_rows(glp_prob *lp, int nrs, const int num[]);
DESCRIPTION
The routine glp_del_rows deletes rows from the specified problem object. Ordinal numbers of rows to be deleted should be placed in locations num[1], ..., num[nrs], where nrs > 0.
Note that deleting rows involves changing ordinal numbers of other rows remaining in the problem object. New ordinal numbers of the remaining rows are assigned under the assumption that the original order of rows is not changed.
public static void glp_del_cols(glp_prob P, int ncs, SWIGTYPE_p_int num)
SYNOPSIS
void glp_del_cols(glp_prob *lp, int ncs, const int num[]);
DESCRIPTION
The routine glp_del_cols deletes columns from the specified problem object. Ordinal numbers of columns to be deleted should be placed in locations num[1], ..., num[ncs], where ncs > 0.
Note that deleting columns involves changing ordinal numbers of other columns remaining in the problem object. New ordinal numbers of the remaining columns are assigned under the assumption that the original order of columns is not changed.
public static void glp_copy_prob(glp_prob dest, glp_prob prob, int names)
SYNOPSIS
void glp_copy_prob(glp_prob *dest, glp_prob *prob, int names);
DESCRIPTION
The routine glp_copy_prob copies the content of the problem object prob to the problem object dest.
The parameter names is a flag. If it is non-zero, the routine also copies all symbolic names; otherwise, if it is zero, symbolic names are not copied.
public static void glp_erase_prob(glp_prob P)
public static void glp_delete_prob(glp_prob P)
public static String glp_get_prob_name(glp_prob P)
SYNOPSIS
const char *glp_get_prob_name(glp_prob *lp);
RETURNS
The routine glp_get_prob_name returns a pointer to an internal buffer, which contains symbolic name of the problem. However, if the problem has no assigned name, the routine returns NULL.
public static String glp_get_obj_name(glp_prob P)
SYNOPSIS
const char *glp_get_obj_name(glp_prob *lp);
RETURNS
The routine glp_get_obj_name returns a pointer to an internal buffer, which contains a symbolic name of the objective function. However, if the objective function has no assigned name, the routine returns NULL.
public static int glp_get_obj_dir(glp_prob P)
SYNOPSIS
int glp_get_obj_dir(glp_prob *lp);
RETURNS
The routine glp_get_obj_dir returns the optimization direction flag (i.e. "sense" of the objective function):
GLP_MIN - minimization; GLP_MAX - maximization.
public static int glp_get_num_rows(glp_prob P)
SYNOPSIS
int glp_get_num_rows(glp_prob *lp);
RETURNS
The routine glp_get_num_rows returns the current number of rows in the specified problem object.
public static int glp_get_num_cols(glp_prob P)
SYNOPSIS
int glp_get_num_cols(glp_prob *lp);
RETURNS
The routine glp_get_num_cols returns the current number of columns in the specified problem object.
public static String glp_get_row_name(glp_prob P, int i)
SYNOPSIS
const char *glp_get_row_name(glp_prob *lp, int i);
RETURNS
The routine glp_get_row_name returns a pointer to an internal buffer, which contains symbolic name of i-th row. However, if i-th row has no assigned name, the routine returns NULL.
public static String glp_get_col_name(glp_prob P, int j)
SYNOPSIS
const char *glp_get_col_name(glp_prob *lp, int j);
RETURNS
The routine glp_get_col_name returns a pointer to an internal buffer, which contains symbolic name of j-th column. However, if j-th column has no assigned name, the routine returns NULL.
public static int glp_get_row_type(glp_prob P, int i)
SYNOPSIS
int glp_get_row_type(glp_prob *lp, int i);
RETURNS
The routine glp_get_row_type returns the type of i-th row, i.e. the type of corresponding auxiliary variable, as follows:
GLP_FR - free (unbounded) variable; GLP_LO - variable with lower bound; GLP_UP - variable with upper bound; GLP_DB - double-bounded variable; GLP_FX - fixed variable.
public static double glp_get_row_lb(glp_prob P, int i)
SYNOPSIS
double glp_get_row_lb(glp_prob *lp, int i);
RETURNS
The routine glp_get_row_lb returns the lower bound of i-th row, i.e. the lower bound of corresponding auxiliary variable. However, if the row has no lower bound, the routine returns -DBL_MAX.
public static double glp_get_row_ub(glp_prob P, int i)
SYNOPSIS
double glp_get_row_ub(glp_prob *lp, int i);
RETURNS
The routine glp_get_row_ub returns the upper bound of i-th row, i.e. the upper bound of corresponding auxiliary variable. However, if the row has no upper bound, the routine returns +DBL_MAX.
public static int glp_get_col_type(glp_prob P, int j)
SYNOPSIS
int glp_get_col_type(glp_prob *lp, int j);
RETURNS
The routine glp_get_col_type returns the type of j-th column, i.e. the type of corresponding structural variable, as follows:
GLP_FR - free (unbounded) variable; GLP_LO - variable with lower bound; GLP_UP - variable with upper bound; GLP_DB - double-bounded variable; GLP_FX - fixed variable.
public static double glp_get_col_lb(glp_prob P, int j)
SYNOPSIS
double glp_get_col_lb(glp_prob *lp, int j);
RETURNS
The routine glp_get_col_lb returns the lower bound of j-th column, i.e. the lower bound of corresponding structural variable. However, if the column has no lower bound, the routine returns -DBL_MAX.
public static double glp_get_col_ub(glp_prob P, int j)
SYNOPSIS
double glp_get_col_ub(glp_prob *lp, int j);
RETURNS
The routine glp_get_col_ub returns the upper bound of j-th column, i.e. the upper bound of corresponding structural variable. However, if the column has no upper bound, the routine returns +DBL_MAX.
public static double glp_get_obj_coef(glp_prob P, int j)
coefficient or constant term
SYNOPSIS
double glp_get_obj_coef(glp_prob *lp, int j);
RETURNS
The routine glp_get_obj_coef returns the objective coefficient at j-th structural variable (column) of the specified problem object.
If the parameter j is zero, the routine returns the constant term ("shift") of the objective function.
public static int glp_get_num_nz(glp_prob P)
SYNOPSIS
int glp_get_num_nz(glp_prob *lp);
RETURNS
The routine glp_get_num_nz returns the number of (non-zero) elements in the constraint matrix of the specified problem object.
public static int glp_get_mat_row(glp_prob P, int i, SWIGTYPE_p_int ind, SWIGTYPE_p_double val)
SYNOPSIS
int glp_get_mat_row(glp_prob *lp, int i, int ind[], double val[]);
DESCRIPTION
The routine glp_get_mat_row scans (non-zero) elements of i-th row of the constraint matrix of the specified problem object and stores their column indices and numeric values to locations ind[1], ..., ind[len] and val[1], ..., val[len], respectively, where 0 <= len <= n is the number of elements in i-th row, n is the number of columns.
The parameter ind and/or val can be specified as NULL, in which case corresponding information is not stored.
RETURNS
The routine glp_get_mat_row returns the length len, i.e. the number of (non-zero) elements in i-th row.
public static int glp_get_mat_col(glp_prob P, int j, SWIGTYPE_p_int ind, SWIGTYPE_p_double val)
SYNOPSIS
int glp_get_mat_col(glp_prob *lp, int j, int ind[], double val[]);
DESCRIPTION
The routine glp_get_mat_col scans (non-zero) elements of j-th column of the constraint matrix of the specified problem object and stores their row indices and numeric values to locations ind[1], ..., ind[len] and val[1], ..., val[len], respectively, where 0 <= len <= m is the number of elements in j-th column, m is the number of rows.
The parameter ind or/and val can be specified as NULL, in which case corresponding information is not stored.
RETURNS
The routine glp_get_mat_col returns the length len, i.e. the number of (non-zero) elements in j-th column.
public static void glp_create_index(glp_prob P)
SYNOPSIS
void glp_create_index(glp_prob *lp);
DESCRIPTION
The routine glp_create_index creates the name index for the specified problem object. The name index is an auxiliary data structure, which is intended to quickly (i.e. for logarithmic time) find rows and columns by their names.
This routine can be called at any time. If the name index already exists, the routine does nothing.
public static int glp_find_row(glp_prob P, String name)
SYNOPSIS
int glp_find_row(glp_prob *lp, const char *name);
RETURNS
The routine glp_find_row returns the ordinal number of a row, which is assigned (by the routine glp_set_row_name) the specified symbolic name. If no such row exists, the routine returns 0.
public static int glp_find_col(glp_prob P, String name)
SYNOPSIS
int glp_find_col(glp_prob *lp, const char *name);
RETURNS
The routine glp_find_col returns the ordinal number of a column, which is assigned (by the routine glp_set_col_name) the specified symbolic name. If no such column exists, the routine returns 0.
public static void glp_delete_index(glp_prob P)
SYNOPSIS
void glp_delete_index(glp_prob *lp);
DESCRIPTION
The routine glp_delete_index deletes the name index previously created by the routine glp_create_index and frees the memory allocated to this auxiliary data structure.
This routine can be called at any time. If the name index does not exist, the routine does nothing.
public static void glp_set_rii(glp_prob P, int i, double rii)
SYNOPSIS
void glp_set_rii(glp_prob *lp, int i, double rii);
DESCRIPTION
The routine glp_set_rii sets (changes) the scale factor r[i,i] for i-th row of the specified problem object.
public static void glp_set_sjj(glp_prob P, int j, double sjj)
SYNOPSIS
void glp_set_sjj(glp_prob *lp, int j, double sjj);
DESCRIPTION
The routine glp_set_sjj sets (changes) the scale factor s[j,j] for j-th column of the specified problem object.
public static double glp_get_rii(glp_prob P, int i)
SYNOPSIS
double glp_get_rii(glp_prob *lp, int i);
RETURNS
The routine glp_get_rii returns current scale factor r[i,i] for i-th row of the specified problem object.
public static double glp_get_sjj(glp_prob P, int j)
SYNOPSIS
double glp_get_sjj(glp_prob *lp, int j);
RETURNS
The routine glp_get_sjj returns current scale factor s[j,j] for j-th column of the specified problem object.
public static void glp_scale_prob(glp_prob P, int flags)
SYNOPSIS
void glp_scale_prob(glp_prob *lp, int flags);
DESCRIPTION
The routine glp_scale_prob performs automatic scaling of problem data for the specified problem object.
The parameter flags specifies scaling options used by the routine. Options can be combined with the bitwise OR operator and may be the following:
GLP_SF_GM perform geometric mean scaling; GLP_SF_EQ perform equilibration scaling; GLP_SF_2N round scale factors to nearest power of two; GLP_SF_SKIP skip scaling, if the problem is well scaled.
The parameter flags may be specified as GLP_SF_AUTO, in which case the routine chooses scaling options automatically.
public static void glp_unscale_prob(glp_prob P)
SYNOPSIS
void glp_unscale_prob(glp_prob *lp);
DESCRIPTION
The routine glp_unscale_prob performs unscaling of problem data for the specified problem object.
"Unscaling" means replacing the current scaling matrices R and S by unity matrices that cancels the scaling effect.
public static void glp_set_row_stat(glp_prob P, int i, int stat)
SYNOPSIS
void glp_set_row_stat(glp_prob *lp, int i, int stat);
DESCRIPTION
The routine glp_set_row_stat sets (changes) status of the auxiliary variable associated with i-th row.
The new status of the auxiliary variable should be specified by the parameter stat as follows:
GLP_BS - basic variable; GLP_NL - non-basic variable; GLP_NU - non-basic variable on its upper bound; if the variable is not double-bounded, this means the same as GLP_NL (only in case of this routine); GLP_NF - the same as GLP_NL (only in case of this routine); GLP_NS - the same as GLP_NL (only in case of this routine).
public static void glp_set_col_stat(glp_prob P, int j, int stat)
SYNOPSIS
void glp_set_col_stat(glp_prob *lp, int j, int stat);
DESCRIPTION
The routine glp_set_col_stat sets (changes) status of the structural variable associated with j-th column.
The new status of the structural variable should be specified by the parameter stat as follows:
GLP_BS - basic variable; GLP_NL - non-basic variable; GLP_NU - non-basic variable on its upper bound; if the variable is not double-bounded, this means the same as GLP_NL (only in case of this routine); GLP_NF - the same as GLP_NL (only in case of this routine); GLP_NS - the same as GLP_NL (only in case of this routine).
public static void glp_std_basis(glp_prob P)
SYNOPSIS
void glp_std_basis(glp_prob *lp);
DESCRIPTION
The routine glp_std_basis builds the "standard" (trivial) initial basis for the specified problem object.
In the "standard" basis all auxiliary variables are basic, and all structural variables are non-basic.
public static void glp_adv_basis(glp_prob P, int flags)
public static void glp_cpx_basis(glp_prob P)
SYNOPSIS
void glp_cpx_basis(glp_prob *lp);
DESCRIPTION
The routine glp_cpx_basis constructs an advanced initial basis for the specified problem object.
The routine is based on Bixby's algorithm described in the paper:
Robert E. Bixby. Implementing the Simplex Method: The Initial Basis. ORSA Journal on Computing, Vol. 4, No. 3, 1992, pp. 267-84.
public static void glp_init_smcp(glp_smcp parm)
SYNOPSIS
void glp_init_smcp(glp_smcp *parm);
DESCRIPTION
The routine glp_init_smcp initializes control parameters, which are used by the simplex solver, with default values.
Default values of the control parameters are stored in a glp_smcp structure, which the parameter parm points to.
public static int glp_get_status(glp_prob P)
SYNOPSIS
int glp_get_status(glp_prob *lp);
RETURNS
The routine glp_get_status reports the generic status of the basic solution for the specified problem object as follows:
GLP_OPT - solution is optimal; GLP_FEAS - solution is feasible; GLP_INFEAS - solution is infeasible; GLP_NOFEAS - problem has no feasible solution; GLP_UNBND - problem has unbounded solution; GLP_UNDEF - solution is undefined.
public static int glp_get_prim_stat(glp_prob P)
SYNOPSIS
int glp_get_prim_stat(glp_prob *lp);
RETURNS
The routine glp_get_prim_stat reports the status of the primal basic solution for the specified problem object as follows:
GLP_UNDEF - primal solution is undefined; GLP_FEAS - primal solution is feasible; GLP_INFEAS - primal solution is infeasible; GLP_NOFEAS - no primal feasible solution exists.
public static int glp_get_dual_stat(glp_prob P)
SYNOPSIS
int glp_get_dual_stat(glp_prob *lp);
RETURNS
The routine glp_get_dual_stat reports the status of the dual basic solution for the specified problem object as follows:
GLP_UNDEF - dual solution is undefined; GLP_FEAS - dual solution is feasible; GLP_INFEAS - dual solution is infeasible; GLP_NOFEAS - no dual feasible solution exists.
public static double glp_get_obj_val(glp_prob P)
SYNOPSIS
double glp_get_obj_val(glp_prob *lp);
RETURNS
The routine glp_get_obj_val returns value of the objective function for basic solution.
public static int glp_get_row_stat(glp_prob P, int i)
SYNOPSIS
int glp_get_row_stat(glp_prob *lp, int i);
RETURNS
The routine glp_get_row_stat returns current status assigned to the auxiliary variable associated with i-th row as follows:
GLP_BS - basic variable; GLP_NL - non-basic variable on its lower bound; GLP_NU - non-basic variable on its upper bound; GLP_NF - non-basic free (unbounded) variable; GLP_NS - non-basic fixed variable.
public static double glp_get_row_prim(glp_prob P, int i)
SYNOPSIS
double glp_get_row_prim(glp_prob *lp, int i);
RETURNS
The routine glp_get_row_prim returns primal value of the auxiliary variable associated with i-th row.
public static double glp_get_row_dual(glp_prob P, int i)
SYNOPSIS
double glp_get_row_dual(glp_prob *lp, int i);
RETURNS
The routine glp_get_row_dual returns dual value (i.e. reduced cost) of the auxiliary variable associated with i-th row.
public static int glp_get_col_stat(glp_prob P, int j)
SYNOPSIS
int glp_get_col_stat(glp_prob *lp, int j);
RETURNS
The routine glp_get_col_stat returns current status assigned to the structural variable associated with j-th column as follows:
GLP_BS - basic variable; GLP_NL - non-basic variable on its lower bound; GLP_NU - non-basic variable on its upper bound; GLP_NF - non-basic free (unbounded) variable; GLP_NS - non-basic fixed variable.
public static double glp_get_col_prim(glp_prob P, int j)
SYNOPSIS
double glp_get_col_prim(glp_prob *lp, int j);
RETURNS
The routine glp_get_col_prim returns primal value of the structural variable associated with j-th column.
public static double glp_get_col_dual(glp_prob P, int j)
SYNOPSIS
double glp_get_col_dual(glp_prob *lp, int j);
RETURNS
The routine glp_get_col_dual returns dual value (i.e. reduced cost) of the structural variable associated with j-th column.
public static int glp_get_unbnd_ray(glp_prob P)
SYNOPSIS
int glp_get_unbnd_ray(glp_prob *lp);
RETURNS
The routine glp_get_unbnd_ray returns the number k of a variable, which causes primal or dual unboundedness. If 1 <= k <= m, it is k-th auxiliary variable, and if m+1 <= k <= m+n, it is (k-m)-th structural variable, where m is the number of rows, n is the number of columns in the problem object. If such variable is not defined, the routine returns 0.
COMMENTS
If it is not exactly known which version of the simplex solver detected unboundedness, i.e. whether the unboundedness is primal or dual, it is sufficient to check the status of the variable reported with the routine glp_get_row_stat or glp_get_col_stat. If the variable is non-basic, the unboundedness is primal, otherwise, if the variable is basic, the unboundedness is dual (the latter case means that the problem has no primal feasible dolution).
public static int glp_get_it_cnt(glp_prob P)
public static void glp_set_it_cnt(glp_prob P, int it_cnt)
public static void glp_init_iptcp(glp_iptcp parm)
SYNOPSIS
void glp_init_iptcp(glp_iptcp *parm);
DESCRIPTION
The routine glp_init_iptcp initializes control parameters, which are used by the interior-point solver, with default values.
Default values of the control parameters are stored in the glp_iptcp structure, which the parameter parm points to.
public static int glp_ipt_status(glp_prob P)
SYNOPSIS
int glp_ipt_status(glp_prob *lp);
RETURNS
The routine glp_ipt_status reports the status of solution found by the interior-point solver as follows:
GLP_UNDEF - interior-point solution is undefined; GLP_OPT - interior-point solution is optimal; GLP_INFEAS - interior-point solution is infeasible; GLP_NOFEAS - no feasible solution exists.
public static double glp_ipt_obj_val(glp_prob P)
SYNOPSIS
double glp_ipt_obj_val(glp_prob *lp);
RETURNS
The routine glp_ipt_obj_val returns value of the objective function for interior-point solution.
public static double glp_ipt_row_prim(glp_prob P, int i)
SYNOPSIS
double glp_ipt_row_prim(glp_prob *lp, int i);
RETURNS
The routine glp_ipt_row_prim returns primal value of the auxiliary variable associated with i-th row.
public static double glp_ipt_row_dual(glp_prob P, int i)
SYNOPSIS
double glp_ipt_row_dual(glp_prob *lp, int i);
RETURNS
The routine glp_ipt_row_dual returns dual value (i.e. reduced cost) of the auxiliary variable associated with i-th row.
public static double glp_ipt_col_prim(glp_prob P, int j)
SYNOPSIS
double glp_ipt_col_prim(glp_prob *lp, int j);
RETURNS
The routine glp_ipt_col_prim returns primal value of the structural variable associated with j-th column.
public static double glp_ipt_col_dual(glp_prob P, int j)
SYNOPSIS
double glp_ipt_col_dual(glp_prob *lp, int j);
RETURNS
The routine glp_ipt_col_dual returns dual value (i.e. reduced cost) of the structural variable associated with j-th column.
public static void glp_set_col_kind(glp_prob P, int j, int kind)
SYNOPSIS
void glp_set_col_kind(glp_prob *mip, int j, int kind);
DESCRIPTION
The routine glp_set_col_kind sets (changes) the kind of j-th column (structural variable) as specified by the parameter kind:
GLP_CV - continuous variable; GLP_IV - integer variable; GLP_BV - binary variable.
public static int glp_get_col_kind(glp_prob P, int j)
SYNOPSIS
int glp_get_col_kind(glp_prob *mip, int j);
RETURNS
The routine glp_get_col_kind returns the kind of j-th column, i.e. the kind of corresponding structural variable, as follows:
GLP_CV - continuous variable; GLP_IV - integer variable; GLP_BV - binary variable
public static int glp_get_num_int(glp_prob P)
SYNOPSIS
int glp_get_num_int(glp_prob *mip);
RETURNS
The routine glp_get_num_int returns the current number of columns, which are marked as integer.
public static int glp_get_num_bin(glp_prob P)
SYNOPSIS
int glp_get_num_bin(glp_prob *mip);
RETURNS
The routine glp_get_num_bin returns the current number of columns, which are marked as binary.
public static void glp_init_iocp(glp_iocp parm)
SYNOPSIS
void glp_init_iocp(glp_iocp *parm);
DESCRIPTION
The routine glp_init_iocp initializes control parameters, which are used by the integer optimizer, with default values.
Default values of the control parameters are stored in a glp_iocp structure, which the parameter parm points to.
public static int glp_mip_status(glp_prob P)
SYNOPSIS
int glp_mip_status(glp_prob *mip);
RETURNS
The routine lpx_mip_status reports the status of MIP solution found by the branch-and-bound solver as follows:
GLP_UNDEF - MIP solution is undefined; GLP_OPT - MIP solution is integer optimal; GLP_FEAS - MIP solution is integer feasible but its optimality (or non-optimality) has not been proven, perhaps due to premature termination of the search; GLP_NOFEAS - problem has no integer feasible solution (proven by the solver).
public static double glp_mip_obj_val(glp_prob P)
SYNOPSIS
double glp_mip_obj_val(glp_prob *mip);
RETURNS
The routine glp_mip_obj_val returns value of the objective function for MIP solution.
public static double glp_mip_row_val(glp_prob P, int i)
SYNOPSIS
double glp_mip_row_val(glp_prob *mip, int i);
RETURNS
The routine glp_mip_row_val returns value of the auxiliary variable associated with i-th row.
public static double glp_mip_col_val(glp_prob P, int j)
SYNOPSIS
double glp_mip_col_val(glp_prob *mip, int j);
RETURNS
The routine glp_mip_col_val returns value of the structural variable associated with j-th column.
public static void glp_check_kkt(glp_prob P, int sol, int cond, SWIGTYPE_p_double ae_max, SWIGTYPE_p_int ae_ind, SWIGTYPE_p_double re_max, SWIGTYPE_p_int re_ind)
public static int glp_read_sol(glp_prob P, String fname)
SYNOPSIS
int glp_read_sol(glp_prob *lp, const char *fname);
DESCRIPTION
The routine glp_read_sol reads basic solution from a text file whose name is specified by the parameter fname into the problem object.
For the file format see description of the routine glp_write_sol.
RETURNS
On success the routine returns zero, otherwise non-zero.
public static int glp_write_sol(glp_prob P, String fname)
SYNOPSIS
int glp_write_sol(glp_prob *lp, const char *fname);
DESCRIPTION
The routine glp_write_sol writes the current basic solution to a text file whose name is specified by the parameter fname. This file can be read back with the routine glp_read_sol.
RETURNS
On success the routine returns zero, otherwise non-zero.
FILE FORMAT
The file created by the routine glp_write_sol is a plain text file, which contains the following information:
m n p_stat d_stat obj_val r_stat[1] r_prim[1] r_dual[1] . . . r_stat[m] r_prim[m] r_dual[m] c_stat[1] c_prim[1] c_dual[1] . . . c_stat[n] c_prim[n] c_dual[n]
where: m is the number of rows (auxiliary variables); n is the number of columns (structural variables); p_stat is the primal status of the basic solution (GLP_UNDEF = 1, GLP_FEAS = 2, GLP_INFEAS = 3, or GLP_NOFEAS = 4); d_stat is the dual status of the basic solution (GLP_UNDEF = 1, GLP_FEAS = 2, GLP_INFEAS = 3, or GLP_NOFEAS = 4); obj_val is the objective value; r_stat[i], i = 1,...,m, is the status of i-th row (GLP_BS = 1, GLP_NL = 2, GLP_NU = 3, GLP_NF = 4, or GLP_NS = 5); r_prim[i], i = 1,...,m, is the primal value of i-th row; r_dual[i], i = 1,...,m, is the dual value of i-th row; c_stat[j], j = 1,...,n, is the status of j-th column (GLP_BS = 1, GLP_NL = 2, GLP_NU = 3, GLP_NF = 4, or GLP_NS = 5); c_prim[j], j = 1,...,n, is the primal value of j-th column; c_dual[j], j = 1,...,n, is the dual value of j-th column.
public static int glp_print_ranges(glp_prob P, int len, SWIGTYPE_p_int list, int flags, String fname)
public static int glp_read_ipt(glp_prob P, String fname)
SYNOPSIS
int glp_read_ipt(glp_prob *lp, const char *fname);
DESCRIPTION
The routine glp_read_ipt reads interior-point solution from a text file whose name is specified by the parameter fname into the problem object.
For the file format see description of the routine glp_write_ipt.
RETURNS
On success the routine returns zero, otherwise non-zero.
public static int glp_write_ipt(glp_prob P, String fname)
SYNOPSIS
int glp_write_ipt(glp_prob *lp, const char *fname);
DESCRIPTION
The routine glp_write_ipt writes the current interior-point solution to a text file whose name is specified by the parameter fname. This file can be read back with the routine glp_read_ipt.
RETURNS
On success the routine returns zero, otherwise non-zero.
FILE FORMAT
The file created by the routine glp_write_ipt is a plain text file, which contains the following information:
m n stat obj_val r_prim[1] r_dual[1] . . . r_prim[m] r_dual[m] c_prim[1] c_dual[1] . . . c_prim[n] c_dual[n]
where: m is the number of rows (auxiliary variables); n is the number of columns (structural variables); stat is the solution status (GLP_UNDEF = 1 or GLP_OPT = 5); obj_val is the objective value; r_prim[i], i = 1,...,m, is the primal value of i-th row; r_dual[i], i = 1,...,m, is the dual value of i-th row; c_prim[j], j = 1,...,n, is the primal value of j-th column; c_dual[j], j = 1,...,n, is the dual value of j-th column.
public static int glp_read_mip(glp_prob P, String fname)
SYNOPSIS
int glp_read_mip(glp_prob *mip, const char *fname);
DESCRIPTION
The routine glp_read_mip reads MIP solution from a text file whose name is specified by the parameter fname into the problem object.
For the file format see description of the routine glp_write_mip.
RETURNS
On success the routine returns zero, otherwise non-zero.
public static int glp_write_mip(glp_prob P, String fname)
SYNOPSIS
int glp_write_mip(glp_prob *mip, const char *fname);
DESCRIPTION
The routine glp_write_mip writes the current MIP solution to a text file whose name is specified by the parameter fname. This file can be read back with the routine glp_read_mip.
RETURNS
On success the routine returns zero, otherwise non-zero.
FILE FORMAT
The file created by the routine glp_write_sol is a plain text file, which contains the following information:
m n stat obj_val r_val[1] . . . r_val[m] c_val[1] . . . c_val[n]
where: m is the number of rows (auxiliary variables); n is the number of columns (structural variables); stat is the solution status (GLP_UNDEF = 1, GLP_FEAS = 2, GLP_NOFEAS = 4, or GLP_OPT = 5); obj_val is the objective value; r_val[i], i = 1,...,m, is the value of i-th row; c_val[j], j = 1,...,n, is the value of j-th column.
public static int glp_bf_exists(glp_prob P)
SYNOPSIS
int glp_bf_exists(glp_prob *lp);
RETURNS
If the basis factorization for the current basis associated with the specified problem object exists and therefore is available for computations, the routine glp_bf_exists returns non-zero. Otherwise the routine returns zero.
public static int glp_factorize(glp_prob P)
public static int glp_bf_updated(glp_prob P)
SYNOPSIS
int glp_bf_updated(glp_prob *lp);
RETURNS
If the basis factorization has been just computed from scratch, the routine glp_bf_updated returns zero. Otherwise, if the factorization has been updated one or more times, the routine returns non-zero.
public static void glp_get_bfcp(glp_prob P, glp_bfcp parm)
SYNOPSIS
void glp_get_bfcp(glp_prob *lp, glp_bfcp *parm);
DESCRIPTION
The routine glp_get_bfcp retrieves control parameters, which are used on computing and updating the basis factorization associated with the specified problem object.
Current values of control parameters are stored by the routine in a glp_bfcp structure, which the parameter parm points to.
public static void glp_set_bfcp(glp_prob P, glp_bfcp parm)
SYNOPSIS
void glp_set_bfcp(glp_prob *lp, const glp_bfcp *parm);
DESCRIPTION
The routine glp_set_bfcp changes control parameters, which are used by internal GLPK routines in computing and updating the basis factorization associated with the specified problem object.
New values of the control parameters should be passed in a structure glp_bfcp, which the parameter parm points to.
The parameter parm can be specified as NULL, in which case all control parameters are reset to their default values.
public static int glp_get_bhead(glp_prob P, int k)
SYNOPSIS
int glp_get_bhead(glp_prob *lp, int k);
DESCRIPTION
The routine glp_get_bhead returns the basis header information for the current basis associated with the specified problem object.
RETURNS
If xB[k], 1 <= k <= m, is i-th auxiliary variable (1 <= i <= m), the routine returns i. Otherwise, if xB[k] is j-th structural variable (1 <= j <= n), the routine returns m+j. Here m is the number of rows and n is the number of columns in the problem object.
public static int glp_get_row_bind(glp_prob P, int i)
SYNOPSIS
int glp_get_row_bind(glp_prob *lp, int i);
RETURNS
The routine glp_get_row_bind returns the index k of basic variable xB[k], 1 <= k <= m, which is i-th auxiliary variable, 1 <= i <= m, in the current basis associated with the specified problem object, where m is the number of rows. However, if i-th auxiliary variable is non-basic, the routine returns zero.
public static int glp_get_col_bind(glp_prob P, int j)
SYNOPSIS
int glp_get_col_bind(glp_prob *lp, int j);
RETURNS
The routine glp_get_col_bind returns the index k of basic variable xB[k], 1 <= k <= m, which is j-th structural variable, 1 <= j <= n, in the current basis associated with the specified problem object, where m is the number of rows, n is the number of columns. However, if j-th structural variable is non-basic, the routine returns zero.
public static void glp_ftran(glp_prob P, SWIGTYPE_p_double x)
SYNOPSIS
void glp_ftran(glp_prob *lp, double x[]);
DESCRIPTION
The routine glp_ftran performs forward transformation, i.e. solves the system B*x = b, where B is the basis matrix corresponding to the current basis for the specified problem object, x is the vector of unknowns to be computed, b is the vector of right-hand sides.
On entry elements of the vector b should be stored in dense format in locations x[1], ..., x[m], where m is the number of rows. On exit the routine stores elements of the vector x in the same locations.
SCALING/UNSCALING
Let A~ = (I | -A) is the augmented constraint matrix of the original (unscaled) problem. In the scaled LP problem instead the matrix A the scaled matrix A" = R*A*S is actually used, so
A~" = (I | A") = (I | R*A*S) = (R*I*inv(R) | R*A*S) = (1) = R*(I | A)*S~ = R*A~*S~,
is the scaled augmented constraint matrix, where R and S are diagonal scaling matrices used to scale rows and columns of the matrix A, and
S~ = diag(inv(R) | S) (2)
is an augmented diagonal scaling matrix.
By definition:
A~ = (B | N), (3)
where B is the basic matrix, which consists of basic columns of the augmented constraint matrix A~, and N is a matrix, which consists of non-basic columns of A~. From (1) it follows that:
A~" = (B" | N") = (R*B*SB | R*N*SN), (4)
where SB and SN are parts of the augmented scaling matrix S~, which correspond to basic and non-basic variables, respectively. Therefore
B" = R*B*SB, (5)
which is the scaled basis matrix.
public static void glp_btran(glp_prob P, SWIGTYPE_p_double x)
SYNOPSIS
void glp_btran(glp_prob *lp, double x[]);
DESCRIPTION
The routine glp_btran performs backward transformation, i.e. solves the system B'*x = b, where B' is a matrix transposed to the basis matrix corresponding to the current basis for the specified problem problem object, x is the vector of unknowns to be computed, b is the vector of right-hand sides.
On entry elements of the vector b should be stored in dense format in locations x[1], ..., x[m], where m is the number of rows. On exit the routine stores elements of the vector x in the same locations.
SCALING/UNSCALING
See comments to the routine glp_ftran.
public static int glp_warm_up(glp_prob P)
SYNOPSIS
int glp_warm_up(glp_prob *P);
DESCRIPTION
The routine glp_warm_up "warms up" the LP basis for the specified problem object using current statuses assigned to rows and columns (that is, to auxiliary and structural variables).
This operation includes computing factorization of the basis matrix (if it does not exist), computing primal and dual components of basic solution, and determining the solution status.
RETURNS
0 The operation has been successfully performed.
GLP_EBADB The basis matrix is invalid, i.e. the number of basic (auxiliary and structural) variables differs from the number of rows in the problem object.
GLP_ESING The basis matrix is singular within the working precision.
GLP_ECOND The basis matrix is ill-conditioned.
public static int glp_eval_tab_row(glp_prob P, int k, SWIGTYPE_p_int ind, SWIGTYPE_p_double val)
SYNOPSIS
int glp_eval_tab_row(glp_prob *lp, int k, int ind[], double val[]);
DESCRIPTION
The routine glp_eval_tab_row computes a row of the current simplex tableau for the basic variable, which is specified by the number k: if 1 <= k <= m, x[k] is k-th auxiliary variable; if m+1 <= k <= m+n, x[k] is (k-m)-th structural variable, where m is number of rows, and n is number of columns. The current basis must be available.
The routine stores column indices and numerical values of non-zero elements of the computed row using sparse format to the locations ind[1], ..., ind[len] and val[1], ..., val[len], respectively, where 0 <= len <= n is number of non-zeros returned on exit.
Element indices stored in the array ind have the same sense as the index k, i.e. indices 1 to m denote auxiliary variables and indices m+1 to m+n denote structural ones (all these variables are obviously non-basic by definition).
The computed row shows how the specified basic variable x[k] = xB[i] depends on non-basic variables:
xB[i] = alfa[i,1]*xN[1] + alfa[i,2]*xN[2] + ... + alfa[i,n]*xN[n],
where alfa[i,j] are elements of the simplex table row, xN[j] are non-basic (auxiliary and structural) variables.
RETURNS
The routine returns number of non-zero elements in the simplex table row stored in the arrays ind and val.
BACKGROUND
The system of equality constraints of the LP problem is:
xR = A * xS, (1)
where xR is the vector of auxliary variables, xS is the vector of structural variables, A is the matrix of constraint coefficients.
The system (1) can be written in homogenous form as follows:
A~ * x = 0, (2)
where A~ = (I | -A) is the augmented constraint matrix (has m rows and m+n columns), x = (xR | xS) is the vector of all (auxiliary and structural) variables.
By definition for the current basis we have:
A~ = (B | N), (3)
where B is the basis matrix. Thus, the system (2) can be written as:
B * xB + N * xN = 0. (4)
From (4) it follows that:
xB = A^ * xN, (5)
where the matrix
A^ = - inv(B) * N (6)
is called the simplex table.
It is understood that i-th row of the simplex table is:
e * A^ = - e * inv(B) * N, (7)
where e is a unity vector with e[i] = 1.
To compute i-th row of the simplex table the routine first computes i-th row of the inverse:
rho = inv(B') * e, (8)
where B' is a matrix transposed to B, and then computes elements of i-th row of the simplex table as scalar products:
alfa[i,j] = - rho * N[j] for all j, (9)
where N[j] is a column of the augmented constraint matrix A~, which corresponds to some non-basic auxiliary or structural variable.
public static int glp_eval_tab_col(glp_prob P, int k, SWIGTYPE_p_int ind, SWIGTYPE_p_double val)
SYNOPSIS
int glp_eval_tab_col(glp_prob *lp, int k, int ind[], double val[]);
DESCRIPTION
The routine glp_eval_tab_col computes a column of the current simplex table for the non-basic variable, which is specified by the number k: if 1 <= k <= m, x[k] is k-th auxiliary variable; if m+1 <= k <= m+n, x[k] is (k-m)-th structural variable, where m is number of rows, and n is number of columns. The current basis must be available.
The routine stores row indices and numerical values of non-zero elements of the computed column using sparse format to the locations ind[1], ..., ind[len] and val[1], ..., val[len] respectively, where 0 <= len <= m is number of non-zeros returned on exit.
Element indices stored in the array ind have the same sense as the index k, i.e. indices 1 to m denote auxiliary variables and indices m+1 to m+n denote structural ones (all these variables are obviously basic by the definition).
The computed column shows how basic variables depend on the specified non-basic variable x[k] = xN[j]:
xB[1] = ... + alfa[1,j]*xN[j] + ... xB[2] = ... + alfa[2,j]*xN[j] + ... . . . . . . xB[m] = ... + alfa[m,j]*xN[j] + ...
where alfa[i,j] are elements of the simplex table column, xB[i] are basic (auxiliary and structural) variables.
RETURNS
The routine returns number of non-zero elements in the simplex table column stored in the arrays ind and val.
BACKGROUND
As it was explained in comments to the routine glp_eval_tab_row (see above) the simplex table is the following matrix:
A^ = - inv(B) * N. (1)
Therefore j-th column of the simplex table is:
A^ * e = - inv(B) * N * e = - inv(B) * N[j], (2)
where e is a unity vector with e[j] = 1, B is the basis matrix, N[j] is a column of the augmented constraint matrix A~, which corresponds to the given non-basic auxiliary or structural variable.
public static int glp_transform_row(glp_prob P, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val)
SYNOPSIS
int glp_transform_row(glp_prob *P, int len, int ind[], double val[]);
DESCRIPTION
The routine glp_transform_row performs the same operation as the routine glp_eval_tab_row with exception that the row to be transformed is specified explicitly as a sparse vector.
The explicitly specified row may be thought as a linear form:
x = a[1]*x[m+1] + a[2]*x[m+2] + ... + a[n]*x[m+n], (1)
where x is an auxiliary variable for this row, a[j] are coefficients of the linear form, x[m+j] are structural variables.
On entry column indices and numerical values of non-zero elements of the row should be stored in locations ind[1], ..., ind[len] and val[1], ..., val[len], where len is the number of non-zero elements.
This routine uses the system of equality constraints and the current basis in order to express the auxiliary variable x in (1) through the current non-basic variables (as if the transformed row were added to the problem object and its auxiliary variable were basic), i.e. the resultant row has the form:
x = alfa[1]*xN[1] + alfa[2]*xN[2] + ... + alfa[n]*xN[n], (2)
where xN[j] are non-basic (auxiliary or structural) variables, n is the number of columns in the LP problem object.
On exit the routine stores indices and numerical values of non-zero elements of the resultant row (2) in locations ind[1], ..., ind[len'] and val[1], ..., val[len'], where 0 <= len' <= n is the number of non-zero elements in the resultant row returned by the routine. Note that indices (numbers) of non-basic variables stored in the array ind correspond to original ordinal numbers of variables: indices 1 to m mean auxiliary variables and indices m+1 to m+n mean structural ones.
RETURNS
The routine returns len', which is the number of non-zero elements in the resultant row stored in the arrays ind and val.
BACKGROUND
The explicitly specified row (1) is transformed in the same way as it were the objective function row.
From (1) it follows that:
x = aB * xB + aN * xN, (3)
where xB is the vector of basic variables, xN is the vector of non-basic variables.
The simplex table, which corresponds to the current basis, is:
xB = [-inv(B) * N] * xN. (4)
Therefore substituting xB from (4) to (3) we have:
x = aB * [-inv(B) * N] * xN + aN * xN = (5) = rho * (-N) * xN + aN * xN = alfa * xN,
where:
rho = inv(B') * aB, (6)
and
alfa = aN + rho * (-N) (7)
is the resultant row computed by the routine.
public static int glp_transform_col(glp_prob P, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val)
SYNOPSIS
int glp_transform_col(glp_prob *P, int len, int ind[], double val[]);
DESCRIPTION
The routine glp_transform_col performs the same operation as the routine glp_eval_tab_col with exception that the column to be transformed is specified explicitly as a sparse vector.
The explicitly specified column may be thought as if it were added to the original system of equality constraints:
x[1] = a[1,1]*x[m+1] + ... + a[1,n]*x[m+n] + a[1]*x x[2] = a[2,1]*x[m+1] + ... + a[2,n]*x[m+n] + a[2]*x (1) . . . . . . . . . . . . . . . x[m] = a[m,1]*x[m+1] + ... + a[m,n]*x[m+n] + a[m]*x
where x[i] are auxiliary variables, x[m+j] are structural variables, x is a structural variable for the explicitly specified column, a[i] are constraint coefficients for x.
On entry row indices and numerical values of non-zero elements of the column should be stored in locations ind[1], ..., ind[len] and val[1], ..., val[len], where len is the number of non-zero elements.
This routine uses the system of equality constraints and the current basis in order to express the current basic variables through the structural variable x in (1) (as if the transformed column were added to the problem object and the variable x were non-basic), i.e. the resultant column has the form:
xB[1] = ... + alfa[1]*x xB[2] = ... + alfa[2]*x (2) . . . . . . xB[m] = ... + alfa[m]*x
where xB are basic (auxiliary and structural) variables, m is the number of rows in the problem object.
On exit the routine stores indices and numerical values of non-zero elements of the resultant column (2) in locations ind[1], ..., ind[len'] and val[1], ..., val[len'], where 0 <= len' <= m is the number of non-zero element in the resultant column returned by the routine. Note that indices (numbers) of basic variables stored in the array ind correspond to original ordinal numbers of variables: indices 1 to m mean auxiliary variables and indices m+1 to m+n mean structural ones.
RETURNS
The routine returns len', which is the number of non-zero elements in the resultant column stored in the arrays ind and val.
BACKGROUND
The explicitly specified column (1) is transformed in the same way as any other column of the constraint matrix using the formula:
alfa = inv(B) * a, (3)
where alfa is the resultant column computed by the routine.
public static int glp_prim_rtest(glp_prob P, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val, int dir, double eps)
SYNOPSIS
int glp_prim_rtest(glp_prob *P, int len, const int ind[], const double val[], int dir, double eps);
DESCRIPTION
The routine glp_prim_rtest performs the primal ratio test using an explicitly specified column of the simplex table.
The current basic solution associated with the LP problem object must be primal feasible.
The explicitly specified column of the simplex table shows how the basic variables xB depend on some non-basic variable x (which is not necessarily presented in the problem object):
xB[1] = ... + alfa[1] * x + ... xB[2] = ... + alfa[2] * x + ... (*) . . . . . . . . xB[m] = ... + alfa[m] * x + ...
The column (*) is specifed on entry to the routine using the sparse format. Ordinal numbers of basic variables xB[i] should be placed in locations ind[1], ..., ind[len], where ordinal number 1 to m denote auxiliary variables, and ordinal numbers m+1 to m+n denote structural variables. The corresponding non-zero coefficients alfa[i] should be placed in locations val[1], ..., val[len]. The arrays ind and val are not changed on exit.
The parameter dir specifies direction in which the variable x changes on entering the basis: +1 means increasing, -1 means decreasing.
The parameter eps is an absolute tolerance (small positive number) used by the routine to skip small alfa[j] of the row (*).
The routine determines which basic variable (among specified in ind[1], ..., ind[len]) should leave the basis in order to keep primal feasibility.
RETURNS
The routine glp_prim_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 <= piv <= len. If the adjacent basic solution is primal unbounded and therefore the choice cannot be made, the routine returns zero.
COMMENTS
If the non-basic variable x is presented in the LP problem object, the column (*) can be computed with the routine glp_eval_tab_col; otherwise it can be computed with the routine glp_transform_col.
public static int glp_dual_rtest(glp_prob P, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val, int dir, double eps)
SYNOPSIS
int glp_dual_rtest(glp_prob *P, int len, const int ind[], const double val[], int dir, double eps);
DESCRIPTION
The routine glp_dual_rtest performs the dual ratio test using an explicitly specified row of the simplex table.
The current basic solution associated with the LP problem object must be dual feasible.
The explicitly specified row of the simplex table is a linear form that shows how some basic variable x (which is not necessarily presented in the problem object) depends on non-basic variables xN:
x = alfa[1] * xN[1] + alfa[2] * xN[2] + ... + alfa[n] * xN[n]. (*)
The row (*) is specified on entry to the routine using the sparse format. Ordinal numbers of non-basic variables xN[j] should be placed in locations ind[1], ..., ind[len], where ordinal numbers 1 to m denote auxiliary variables, and ordinal numbers m+1 to m+n denote structural variables. The corresponding non-zero coefficients alfa[j] should be placed in locations val[1], ..., val[len]. The arrays ind and val are not changed on exit.
The parameter dir specifies direction in which the variable x changes on leaving the basis: +1 means that x goes to its lower bound, and -1 means that x goes to its upper bound.
The parameter eps is an absolute tolerance (small positive number) used by the routine to skip small alfa[j] of the row (*).
The routine determines which non-basic variable (among specified in ind[1], ..., ind[len]) should enter the basis in order to keep dual feasibility.
RETURNS
The routine glp_dual_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 <= piv <= len. If the adjacent basic solution is dual unbounded and therefore the choice cannot be made, the routine returns zero.
COMMENTS
If the basic variable x is presented in the LP problem object, the row (*) can be computed with the routine glp_eval_tab_row; otherwise it can be computed with the routine glp_transform_row.
public static void glp_analyze_bound(glp_prob P, int k, SWIGTYPE_p_double value1, SWIGTYPE_p_int var1, SWIGTYPE_p_double value2, SWIGTYPE_p_int var2)
SYNOPSIS
void glp_analyze_bound(glp_prob *P, int k, double *limit1, int *var1, double *limit2, int *var2);
DESCRIPTION
The routine glp_analyze_bound analyzes the effect of varying the active bound of specified non-basic variable.
The non-basic variable is specified by the parameter k, where 1 <= k <= m means auxiliary variable of corresponding row while m+1 <= k <= m+n means structural variable (column).
Note that the current basic solution must be optimal, and the basis factorization must exist.
Results of the analysis have the following meaning.
value1 is the minimal value of the active bound, at which the basis still remains primal feasible and thus optimal. -DBL_MAX means that the active bound has no lower limit.
var1 is the ordinal number of an auxiliary (1 to m) or structural (m+1 to n) basic variable, which reaches its bound first and thereby limits further decreasing the active bound being analyzed. if value1 = -DBL_MAX, var1 is set to 0.
value2 is the maximal value of the active bound, at which the basis still remains primal feasible and thus optimal. +DBL_MAX means that the active bound has no upper limit.
var2 is the ordinal number of an auxiliary (1 to m) or structural (m+1 to n) basic variable, which reaches its bound first and thereby limits further increasing the active bound being analyzed. if value2 = +DBL_MAX, var2 is set to 0.
public static void glp_analyze_coef(glp_prob P, int k, SWIGTYPE_p_double coef1, SWIGTYPE_p_int var1, SWIGTYPE_p_double value1, SWIGTYPE_p_double coef2, SWIGTYPE_p_int var2, SWIGTYPE_p_double value2)
SYNOPSIS
void glp_analyze_coef(glp_prob *P, int k, double *coef1, int *var1, double *value1, double *coef2, int *var2, double *value2);
DESCRIPTION
The routine glp_analyze_coef analyzes the effect of varying the objective coefficient at specified basic variable.
The basic variable is specified by the parameter k, where 1 <= k <= m means auxiliary variable of corresponding row while m+1 <= k <= m+n means structural variable (column).
Note that the current basic solution must be optimal, and the basis factorization must exist.
Results of the analysis have the following meaning.
coef1 is the minimal value of the objective coefficient, at which the basis still remains dual feasible and thus optimal. -DBL_MAX means that the objective coefficient has no lower limit.
var1 is the ordinal number of an auxiliary (1 to m) or structural (m+1 to n) non-basic variable, whose reduced cost reaches its zero bound first and thereby limits further decreasing the objective coefficient being analyzed. If coef1 = -DBL_MAX, var1 is set to 0.
value1 is value of the basic variable being analyzed in an adjacent basis, which is defined as follows. Let the objective coefficient reaches its minimal value (coef1) and continues decreasing. Then the reduced cost of the limiting non-basic variable (var1) becomes dual infeasible and the current basis becomes non-optimal that forces the limiting non-basic variable to enter the basis replacing there some basic variable that leaves the basis to keep primal feasibility. Should note that on determining the adjacent basis current bounds of the basic variable being analyzed are ignored as if it were free (unbounded) variable, so it cannot leave the basis. It may happen that no dual feasible adjacent basis exists, in which case value1 is set to -DBL_MAX or +DBL_MAX.
coef2 is the maximal value of the objective coefficient, at which the basis still remains dual feasible and thus optimal. +DBL_MAX means that the objective coefficient has no upper limit.
var2 is the ordinal number of an auxiliary (1 to m) or structural (m+1 to n) non-basic variable, whose reduced cost reaches its zero bound first and thereby limits further increasing the objective coefficient being analyzed. If coef2 = +DBL_MAX, var2 is set to 0.
value2 is value of the basic variable being analyzed in an adjacent basis, which is defined exactly in the same way as value1 above with exception that now the objective coefficient is increasing.
public static SWIGTYPE_p_glp_prep glp_npp_alloc_wksp()
public static void glp_npp_load_prob(SWIGTYPE_p_glp_prep prep, glp_prob P, int sol, int names)
public static int glp_npp_preprocess1(SWIGTYPE_p_glp_prep prep, int hard)
public static void glp_npp_build_prob(SWIGTYPE_p_glp_prep prep, glp_prob Q)
public static void glp_npp_postprocess(SWIGTYPE_p_glp_prep prep, glp_prob Q)
public static void glp_npp_obtain_sol(SWIGTYPE_p_glp_prep prep, glp_prob P)
public static void glp_npp_free_wksp(SWIGTYPE_p_glp_prep prep)
public static int glp_ios_reason(glp_tree T)
SYNOPSIS
glp_ios_reason(glp_tree *tree);
RETURNS
The routine glp_ios_reason returns a code, which indicates why the user-defined callback routine is being called.
public static glp_prob glp_ios_get_prob(glp_tree T)
SYNOPSIS
glp_prob *glp_ios_get_prob(glp_tree *tree);
DESCRIPTION
The routine glp_ios_get_prob can be called from the user-defined callback routine to access the problem object, which is used by the MIP solver. It is the original problem object passed to the routine glp_intopt if the MIP presolver is not used; otherwise it is an internal problem object built by the presolver. If the current subproblem exists, LP segment of the problem object corresponds to its LP relaxation.
RETURNS
The routine glp_ios_get_prob returns a pointer to the problem object used by the MIP solver.
public static void glp_ios_tree_size(glp_tree T, SWIGTYPE_p_int a_cnt, SWIGTYPE_p_int n_cnt, SWIGTYPE_p_int t_cnt)
SYNOPSIS
void glp_ios_tree_size(glp_tree *tree, int *a_cnt, int *n_cnt, int *t_cnt);
DESCRIPTION
The routine glp_ios_tree_size stores the following three counts which characterize the current size of the branch-and-bound tree:
a_cnt is the current number of active nodes, i.e. the current size of the active list;
n_cnt is the current number of all (active and inactive) nodes;
t_cnt is the total number of nodes including those which have been already removed from the tree. This count is increased whenever a new node appears in the tree and never decreased.
If some of the parameters a_cnt, n_cnt, t_cnt is a null pointer, the corresponding count is not stored.
public static int glp_ios_curr_node(glp_tree T)
SYNOPSIS
int glp_ios_curr_node(glp_tree *tree);
RETURNS
The routine glp_ios_curr_node returns the reference number of the current active subproblem. However, if the current subproblem does not exist, the routine returns zero.
public static int glp_ios_next_node(glp_tree T, int p)
SYNOPSIS
int glp_ios_next_node(glp_tree *tree, int p);
RETURNS
If the parameter p is zero, the routine glp_ios_next_node returns the reference number of the first active subproblem. However, if the tree is empty, zero is returned.
If the parameter p is not zero, it must specify the reference number of some active subproblem, in which case the routine returns the reference number of the next active subproblem. However, if there is no next active subproblem in the list, zero is returned.
All subproblems in the active list are ordered chronologically, i.e. subproblem A precedes subproblem B if A was created before B.
public static int glp_ios_prev_node(glp_tree T, int p)
SYNOPSIS
int glp_ios_prev_node(glp_tree *tree, int p);
RETURNS
If the parameter p is zero, the routine glp_ios_prev_node returns the reference number of the last active subproblem. However, if the tree is empty, zero is returned.
If the parameter p is not zero, it must specify the reference number of some active subproblem, in which case the routine returns the reference number of the previous active subproblem. However, if there is no previous active subproblem in the list, zero is returned.
All subproblems in the active list are ordered chronologically, i.e. subproblem A precedes subproblem B if A was created before B.
public static int glp_ios_up_node(glp_tree T, int p)
SYNOPSIS
int glp_ios_up_node(glp_tree *tree, int p);
RETURNS
The parameter p must specify the reference number of some (active or inactive) subproblem, in which case the routine iet_get_up_node returns the reference number of its parent subproblem. However, if the specified subproblem is the root of the tree and, therefore, has no parent, the routine returns zero.
public static int glp_ios_node_level(glp_tree T, int p)
SYNOPSIS
int glp_ios_node_level(glp_tree *tree, int p);
RETURNS
The routine glp_ios_node_level returns the level of the subproblem, whose reference number is p, in the branch-and-bound tree. (The root subproblem has level 0, and the level of any other subproblem is the level of its parent plus one.)
public static double glp_ios_node_bound(glp_tree T, int p)
SYNOPSIS
double glp_ios_node_bound(glp_tree *tree, int p);
RETURNS
The routine glp_ios_node_bound returns the local bound for (active or inactive) subproblem, whose reference number is p.
COMMENTS
The local bound for subproblem p is an lower (minimization) or upper (maximization) bound for integer optimal solution to this subproblem (not to the original problem). This bound is local in the sense that only subproblems in the subtree rooted at node p cannot have better integer feasible solutions.
On creating a subproblem (due to the branching step) its local bound is inherited from its parent and then may get only stronger (never weaker). For the root subproblem its local bound is initially set to -DBL_MAX (minimization) or +DBL_MAX (maximization) and then improved as the root LP relaxation has been solved.
Note that the local bound is not necessarily the optimal objective value to corresponding LP relaxation; it may be stronger.
public static int glp_ios_best_node(glp_tree T)
SYNOPSIS
int glp_ios_best_node(glp_tree *tree);
RETURNS
The routine glp_ios_best_node returns the reference number of the active subproblem, whose local bound is best (i.e. smallest in case of minimization or largest in case of maximization). However, if the tree is empty, the routine returns zero.
COMMENTS
The best local bound is an lower (minimization) or upper (maximization) bound for integer optimal solution to the original MIP problem.
public static double glp_ios_mip_gap(glp_tree T)
SYNOPSIS
double glp_ios_mip_gap(glp_tree *tree);
DESCRIPTION
The routine glp_ios_mip_gap computes the relative MIP gap with the following formula:
gap = |best_mip - best_bnd| / (|best_mip| + DBL_EPSILON),
where best_mip is the best integer feasible solution found so far, best_bnd is the best (global) bound. If no integer feasible solution has been found yet, gap is set to DBL_MAX.
RETURNS
The routine glp_ios_mip_gap returns the relative MIP gap.
public static SWIGTYPE_p_void glp_ios_node_data(glp_tree T, int p)
SYNOPSIS
void *glp_ios_node_data(glp_tree *tree, int p);
DESCRIPTION
The routine glp_ios_node_data allows the application accessing a memory block allocated for the subproblem (which may be active or inactive), whose reference number is p.
The size of the block is defined by the control parameter cb_size passed to the routine glp_intopt. The block is initialized by binary zeros on creating corresponding subproblem, and its contents is kept until the subproblem will be removed from the tree.
The application may use these memory blocks to store specific data for each subproblem.
RETURNS
The routine glp_ios_node_data returns a pointer to the memory block for the specified subproblem. Note that if cb_size = 0, the routine returns a null pointer.
public static void glp_ios_row_attr(glp_tree T, int i, glp_attr attr)
SYNOPSIS
void glp_ios_row_attr(glp_tree *tree, int i, glp_attr *attr);
DESCRIPTION
The routine glp_ios_row_attr retrieves additional attributes of row i and stores them in the structure glp_attr.
public static int glp_ios_pool_size(glp_tree T)
public static int glp_ios_add_row(glp_tree T, String name, int klass, int flags, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val, int type, double rhs)
public static void glp_ios_del_row(glp_tree T, int i)
public static void glp_ios_clear_pool(glp_tree T)
public static int glp_ios_can_branch(glp_tree T, int j)
SYNOPSIS
int glp_ios_can_branch(glp_tree *tree, int j);
RETURNS
If j-th variable (column) can be used to branch upon, the routine glp_ios_can_branch returns non-zero, otherwise zero.
public static void glp_ios_branch_upon(glp_tree T, int j, int sel)
SYNOPSIS
void glp_ios_branch_upon(glp_tree *tree, int j, int sel);
DESCRIPTION
The routine glp_ios_branch_upon can be called from the user-defined callback routine in response to the reason GLP_IBRANCH to choose a branching variable, whose ordinal number is j. Should note that only variables, for which the routine glp_ios_can_branch returns non-zero, can be used to branch upon.
The parameter sel is a flag that indicates which branch (subproblem) should be selected next to continue the search:
GLP_DN_BRNCH - select down-branch; GLP_UP_BRNCH - select up-branch; GLP_NO_BRNCH - use general selection technique.
public static void glp_ios_select_node(glp_tree T, int p)
SYNOPSIS
void glp_ios_select_node(glp_tree *tree, int p);
DESCRIPTION
The routine glp_ios_select_node can be called from the user-defined callback routine in response to the reason GLP_ISELECT to select an active subproblem, whose reference number is p. The search will be continued from the subproblem selected.
public static int glp_ios_heur_sol(glp_tree T, SWIGTYPE_p_double x)
SYNOPSIS
int glp_ios_heur_sol(glp_tree *tree, const double x[]);
DESCRIPTION
The routine glp_ios_heur_sol can be called from the user-defined callback routine in response to the reason GLP_IHEUR to provide an integer feasible solution found by a primal heuristic.
Primal values of all variables (columns) found by the heuristic should be placed in locations x[1], ..., x[n], where n is the number of columns in the original problem object. Note that the routine glp_ios_heur_sol does not check primal feasibility of the solution provided.
Using the solution passed in the array x the routine computes value of the objective function. If the objective value is better than the best known integer feasible solution, the routine computes values of auxiliary variables (rows) and stores all solution components in the problem object.
RETURNS
If the provided solution is accepted, the routine glp_ios_heur_sol returns zero. Otherwise, if the provided solution is rejected, the routine returns non-zero.
public static void glp_ios_terminate(glp_tree T)
SYNOPSIS
void glp_ios_terminate(glp_tree *tree);
DESCRIPTION
The routine glp_ios_terminate sets a flag indicating that the MIP solver should prematurely terminate the search.
public static void glp_init_mpscp(glp_mpscp parm)
SYNOPSIS
void glp_init_mpscp(glp_mpscp *parm);
DESCRIPTION
The routine glp_init_mpscp initializes control parameters, which are used by the MPS input/output routines glp_read_mps and glp_write_mps, with default values.
Default values of the control parameters are stored in the glp_mpscp structure, which the parameter parm points to.
public static void glp_init_cpxcp(glp_cpxcp parm)
SYNOPSIS
void glp_init_cpxcp(glp_cpxcp *parm):
The routine glp_init_cpxcp initializes control parameters used by the CPLEX LP input/output routines glp_read_lp and glp_write_lp with default values.
Default values of the control parameters are stored in the glp_cpxcp structure, which the parameter parm points to.
public static int glp_read_prob(glp_prob P, int flags, String fname)
SYNOPSIS
int glp_read_prob(glp_prob *P, int flags, const char *fname);
The routine glp_read_prob reads problem data in GLPK LP/MIP format from a text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static int glp_write_prob(glp_prob P, int flags, String fname)
SYNOPSIS
int glp_write_prob(glp_prob *P, int flags, const char *fname);
The routine glp_write_prob writes problem data in GLPK LP/MIP format to a text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static glp_tran glp_mpl_alloc_wksp()
public static void glp_mpl_init_rand(glp_tran tran, int seed)
public static void glp_mpl_free_wksp(glp_tran tran)
public static int glp_check_cnfsat(glp_prob P)
public static int glp_minisat1(glp_prob P)
public static int glp_intfeas1(glp_prob P, int use_bound, int obj_bound)
public static int glp_init_env()
SYNOPSIS
int glp_init_env(void);
DESCRIPTION
The routine glp_init_env initializes the GLPK environment. Normally the application program does not need to call this routine, because it is called automatically on the first call to any API routine.
RETURNS
The routine glp_init_env returns one of the following codes:
0 - initialization successful; 1 - environment has been already initialized; 2 - initialization failed (insufficient memory); 3 - initialization failed (unsupported programming model).
public static String glp_version()
SYNOPSIS
const char *glp_version(void);
RETURNS
The routine glp_version returns a pointer to a null-terminated character string, which specifies the version of the GLPK library in the form "X.Y", where X is the major version number, and Y is the minor version number, for example, "4.16".
public static int glp_free_env()
SYNOPSIS
int glp_free_env(void);
DESCRIPTION
The routine glp_free_env frees all resources used by GLPK routines (memory blocks, etc.) which are currently still in use.
Normally the application program does not need to call this routine, because GLPK routines always free all unused resources. However, if the application program even has deleted all problem objects, there will be several memory blocks still allocated for the library needs. For some reasons the application program may want GLPK to free this memory, in which case it should call glp_free_env.
Note that a call to glp_free_env invalidates all problem objects as if no GLPK routine were called.
RETURNS
0 - termination successful; 1 - environment is inactive (was not initialized).
public static void glp_puts(String s)
SYNOPSIS
void glp_puts(const char *s);
The routine glp_puts writes the string s on the terminal.
public static void glp_printf(String fmt)
SYNOPSIS
void glp_printf(const char *fmt, ...);
DESCRIPTION
The routine glp_printf uses the format control string fmt to format its parameters and writes the formatted output on the terminal.
public static void glp_vprintf(String fmt, SWIGTYPE_p_va_list arg)
SYNOPSIS
void glp_vprintf(const char *fmt, va_list arg);
DESCRIPTION
The routine glp_vprintf uses the format control string fmt to format its parameters specified by the list arg and writes the formatted output on the terminal.
public static int glp_term_out(int flag)
SYNOPSIS
int glp_term_out(int flag);
DESCRIPTION
Depending on the parameter flag the routine glp_term_out enables or disables terminal output performed by glpk routines:
GLP_ON - enable terminal output; GLP_OFF - disable terminal output.
RETURNS
The routine glp_term_out returns the previous value of the terminal output flag.
public static void glp_term_hook(SWIGTYPE_p_f_p_void_p_q_const__char__int func, SWIGTYPE_p_void info)
SYNOPSIS
void glp_term_hook(int (*func)(void *info, const char *s), void *info);
DESCRIPTION
The routine glp_term_hook installs a user-defined hook routine to intercept all terminal output performed by glpk routines.
This feature can be used to redirect the terminal output to other destination, for example to a file or a text window.
The parameter func specifies the user-defined hook routine. It is called from an internal printing routine, which passes to it two parameters: info and s. The parameter info is a transit pointer, specified in the corresponding call to the routine glp_term_hook; it may be used to pass some information to the hook routine. The parameter s is a pointer to the null terminated character string, which is intended to be written to the terminal. If the hook routine returns zero, the printing routine writes the string s to the terminal in a usual way; otherwise, if the hook routine returns non-zero, no terminal output is performed.
To uninstall the hook routine the parameters func and info should be specified as NULL.
public static int glp_open_tee(String name)
SYNOPSIS
int glp_open_tee(const char *name);
DESCRIPTION
The routine glp_open_tee starts copying all the terminal output to an output text file, whose name is specified by the character string name.
RETURNS
0 - operation successful 1 - copying terminal output is already active 2 - unable to create output file
public static int glp_close_tee()
SYNOPSIS
int glp_close_tee(void);
DESCRIPTION
The routine glp_close_tee stops copying the terminal output to the output text file previously open by the routine glp_open_tee closing that file.
RETURNS
0 - operation successful 1 - copying terminal output was not started
public static SWIGTYPE_p_f_p_q_const__char_v_______void glp_error_(String file, int line)
public static int glp_at_error()
SYNOPSIS
int glp_at_error(void);
DESCRIPTION
The routine glp_at_error checks if the GLPK environment is at error state, i.e. if the call to the routine is (indirectly) made from the glp_error routine via an user-defined hook routine.
RETURNS
If the GLPK environment is at error state, the routine glp_at_error returns non-zero, otherwise zero.
public static void glp_assert_(String expr, String file, int line)
SYNOPSIS
void glp_assert(int expr);
DESCRIPTION
The routine glp_assert (implemented as a macro) checks for a logical condition specified by the parameter expr. If the condition is false (i.e. the value of expr is zero), the routine writes a message on the terminal and abnormally terminates the program.
public static void glp_error_hook(SWIGTYPE_p_f_p_void__void func, SWIGTYPE_p_void info)
SYNOPSIS
void glp_error_hook(void (*func)(void *info), void *info);
DESCRIPTION
The routine glp_error_hook installs a user-defined hook routine to intercept abnormal termination.
The parameter func specifies the user-defined hook routine. It is called from the routine glp_error before the latter calls the abort function to abnormally terminate the application program because of fatal error. The parameter info is a transit pointer, specified in the corresponding call to the routine glp_error_hook; it may be used to pass some information to the hook routine.
To uninstall the hook routine the parameters func and info should be both specified as NULL.
public static SWIGTYPE_p_void glp_alloc(int n, int size)
SYNOPSIS
void *glp_alloc(int n, int size);
DESCRIPTION
The routine glp_alloc allocates a memory block of n * size bytes long.
Note that being allocated the memory block contains arbitrary data (not binary zeros!).
RETURNS
The routine glp_alloc returns a pointer to the block allocated. To free this block the routine glp_free (not free!) must be used.
public static SWIGTYPE_p_void glp_realloc(SWIGTYPE_p_void ptr, int n, int size)
public static void glp_free(SWIGTYPE_p_void ptr)
SYNOPSIS
void glp_free(void *ptr);
DESCRIPTION
The routine glp_free frees (deallocates) a memory block pointed to by ptr, which was previuosly allocated by the routine glp_alloc or reallocated by the routine glp_realloc.
public static void glp_mem_limit(int limit)
SYNOPSIS
void glp_mem_limit(int limit);
DESCRIPTION
The routine glp_mem_limit limits the amount of memory available for dynamic allocation (in GLPK routines) to limit megabytes.
public static void glp_mem_usage(SWIGTYPE_p_int count, SWIGTYPE_p_int cpeak, SWIGTYPE_p_size_t total, SWIGTYPE_p_size_t tpeak)
SYNOPSIS
void glp_mem_usage(int *count, int *cpeak, size_t *total, size_t *tpeak);
DESCRIPTION
The routine glp_mem_usage reports some information about utilization of the memory by GLPK routines. Information is stored to locations specified by corresponding parameters (see below). Any parameter can be specified as NULL, in which case its value is not stored.
*count is the number of the memory blocks currently allocated by the routines glp_malloc and glp_calloc (one call to glp_malloc or glp_calloc results in allocating one memory block).
*cpeak is the peak value of *count reached since the initialization of the GLPK library environment.
*total is the total amount, in bytes, of the memory blocks currently allocated by the routines glp_malloc and glp_calloc.
*tpeak is the peak value of *total reached since the initialization of the GLPK library envirionment.
public static double glp_time()
public static double glp_difftime(double t1, double t0)
SYNOPSIS
double glp_difftime(double t1, double t0);
RETURNS
The routine glp_difftime returns the difference between two time values t1 and t0, expressed in seconds.
public static glp_graph glp_create_graph(int v_size, int a_size)
public static void glp_set_graph_name(glp_graph G, String name)
SYNOPSIS
void glp_set_graph_name(glp_graph *G, const char *name);
DESCRIPTION
The routine glp_set_graph_name assigns a symbolic name specified by the character string name (1 to 255 chars) to the graph.
If the parameter name is NULL or an empty string, the routine erases the existing symbolic name of the graph.
public static int glp_add_vertices(glp_graph G, int nadd)
SYNOPSIS
int glp_add_vertices(glp_graph *G, int nadd);
DESCRIPTION
The routine glp_add_vertices adds nadd vertices to the specified graph. New vertices are always added to the end of the vertex list, so ordinal numbers of existing vertices remain unchanged.
Being added each new vertex is isolated (has no incident arcs).
RETURNS
The routine glp_add_vertices returns an ordinal number of the first new vertex added to the graph.
public static glp_arc glp_add_arc(glp_graph G, int i, int j)
SYNOPSIS
glp_arc *glp_add_arc(glp_graph *G, int i, int j);
DESCRIPTION
The routine glp_add_arc adds a new arc to the specified graph.
The parameters i and j specify the ordinal numbers of, resp., tail and head vertices of the arc. Note that self-loops and multiple arcs are allowed.
RETURNS
The routine glp_add_arc returns a pointer to the arc added.
public static void glp_del_vertices(glp_graph G, int ndel, SWIGTYPE_p_int num)
SYNOPSIS
void glp_del_vertices(glp_graph *G, int ndel, const int num[]);
DESCRIPTION
The routine glp_del_vertices deletes vertices along with all incident arcs from the specified graph. Ordinal numbers of vertices to be deleted should be placed in locations num[1], ..., num[ndel], ndel > 0.
Note that deleting vertices involves changing ordinal numbers of other vertices remaining in the graph. New ordinal numbers of the remaining vertices are assigned under the assumption that the original order of vertices is not changed.
public static void glp_del_arc(glp_graph G, glp_arc a)
SYNOPSIS
void glp_del_arc(glp_graph *G, glp_arc *a);
DESCRIPTION
The routine glp_del_arc deletes an arc from the specified graph. The arc to be deleted must exist.
public static void glp_erase_graph(glp_graph G, int v_size, int a_size)
public static void glp_delete_graph(glp_graph G)
SYNOPSIS
void glp_delete_graph(glp_graph *G);
DESCRIPTION
The routine glp_delete_graph deletes the specified graph and frees all the memory allocated to this program object.
public static void glp_create_v_index(glp_graph G)
public static void glp_delete_v_index(glp_graph G)
public static int glp_read_graph(glp_graph G, String fname)
SYNOPSIS
int glp_read_graph(glp_graph *G, const char *fname);
DESCRIPTION
The routine glp_read_graph reads a graph from a plain text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static int glp_write_graph(glp_graph G, String fname)
SYNOPSIS
int glp_write_graph(glp_graph *G, const char *fname).
DESCRIPTION
The routine glp_write_graph writes the specified graph to a plain text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static void glp_mincost_lp(glp_prob P, glp_graph G, int names, int v_rhs, int a_low, int a_cap, int a_cost)
SYNOPSIS
void glp_mincost_lp(glp_prob *lp, glp_graph *G, int names, int v_rhs, int a_low, int a_cap, int a_cost);
DESCRIPTION
The routine glp_mincost_lp builds an LP problem, which corresponds to the minimum cost flow problem on the specified network G.
public static int glp_mincost_okalg(glp_graph G, int v_rhs, int a_low, int a_cap, int a_cost, SWIGTYPE_p_double sol, int a_x, int v_pi)
public static int glp_mincost_relax4(glp_graph G, int v_rhs, int a_low, int a_cap, int a_cost, int crash, SWIGTYPE_p_double sol, int a_x, int a_rc)
public static void glp_maxflow_lp(glp_prob P, glp_graph G, int names, int s, int t, int a_cap)
SYNOPSIS
void glp_maxflow_lp(glp_prob *lp, glp_graph *G, int names, int s, int t, int a_cap);
DESCRIPTION
The routine glp_maxflow_lp builds an LP problem, which corresponds to the maximum flow problem on the specified network G.
public static int glp_maxflow_ffalg(glp_graph G, int s, int t, int a_cap, SWIGTYPE_p_double sol, int a_x, int v_cut)
public static int glp_check_asnprob(glp_graph G, int v_set)
SYNOPSIS
int glp_check_asnprob(glp_graph *G, int v_set);
RETURNS
If the specified assignment problem data are correct, the routine glp_check_asnprob returns zero, otherwise, non-zero.
public static int glp_asnprob_lp(glp_prob P, int form, glp_graph G, int names, int v_set, int a_cost)
SYNOPSIS
int glp_asnprob_lp(glp_prob *P, int form, glp_graph *G, int names, int v_set, int a_cost);
DESCRIPTION
The routine glp_asnprob_lp builds an LP problem, which corresponds to the assignment problem on the specified graph G.
RETURNS
If the LP problem has been successfully built, the routine returns zero, otherwise, non-zero.
public static int glp_asnprob_okalg(int form, glp_graph G, int v_set, int a_cost, SWIGTYPE_p_double sol, int a_x)
public static int glp_asnprob_hall(glp_graph G, int v_set, int a_x)
SYNOPSIS
int glp_asnprob_hall(glp_graph *G, int v_set, int a_x);
DESCRIPTION
The routine glp_asnprob_hall finds a matching of maximal cardinality in the specified bipartite graph G. It uses a version of the Fortran routine MC21A developed by I.S.Duff [1], which implements Hall's algorithm [2].
RETURNS
The routine glp_asnprob_hall returns the cardinality of the matching found. However, if the specified graph is incorrect (as detected by the routine glp_check_asnprob), the routine returns negative value.
REFERENCES
I.S.Duff, Algorithm 575: Permutations for zero-free diagonal, ACM Trans. on Math. Softw. 7 (1981), 387-390.M.Hall, "An Algorithm for distinct representatives," Amer. Math. Monthly 63 (1956), 716-717.
public static double glp_cpp(glp_graph G, int v_t, int v_es, int v_ls)
public static int glp_read_mincost(glp_graph G, int v_rhs, int a_low, int a_cap, int a_cost, String fname)
SYNOPSIS
int glp_read_mincost(glp_graph *G, int v_rhs, int a_low, int a_cap, int a_cost, const char *fname);
DESCRIPTION
The routine glp_read_mincost reads minimum cost flow problem data in DIMACS format from a text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static int glp_write_mincost(glp_graph G, int v_rhs, int a_low, int a_cap, int a_cost, String fname)
SYNOPSIS
int glp_write_mincost(glp_graph *G, int v_rhs, int a_low, int a_cap, int a_cost, const char *fname);
DESCRIPTION
The routine glp_write_mincost writes minimum cost flow problem data in DIMACS format to a text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static int glp_read_maxflow(glp_graph G, SWIGTYPE_p_int s, SWIGTYPE_p_int t, int a_cap, String fname)
SYNOPSIS
int glp_read_maxflow(glp_graph *G, int *s, int *t, int a_cap, const char *fname);
DESCRIPTION
The routine glp_read_maxflow reads maximum flow problem data in DIMACS format from a text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static int glp_write_maxflow(glp_graph G, int s, int t, int a_cap, String fname)
SYNOPSIS
int glp_write_maxflow(glp_graph *G, int s, int t, int a_cap, const char *fname);
DESCRIPTION
The routine glp_write_maxflow writes maximum flow problem data in DIMACS format to a text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static int glp_read_asnprob(glp_graph G, int v_set, int a_cost, String fname)
SYNOPSIS
int glp_read_asnprob(glp_graph *G, int v_set, int a_cost, const char *fname);
DESCRIPTION
The routine glp_read_asnprob reads assignment problem data in DIMACS format from a text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static int glp_write_asnprob(glp_graph G, int v_set, int a_cost, String fname)
SYNOPSIS
int glp_write_asnprob(glp_graph *G, int v_set, int a_cost, const char *fname);
DESCRIPTION
The routine glp_write_asnprob writes assignment problem data in DIMACS format to a text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static int glp_read_ccdata(glp_graph G, int v_wgt, String fname)
SYNOPSIS
int glp_read_ccdata(glp_graph *G, int v_wgt, const char *fname);
DESCRIPTION
The routine glp_read_ccdata reads an (undirected) graph in DIMACS clique/coloring format from a text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static int glp_write_ccdata(glp_graph G, int v_wgt, String fname)
SYNOPSIS
int glp_write_ccdata(glp_graph *G, int v_wgt, const char *fname);
DESCRIPTION
The routine glp_write_ccdata writes the specified graph in DIMACS clique/coloring format to a text file.
RETURNS
If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero.
public static int glp_netgen(glp_graph G, int v_rhs, int a_cap, int a_cost, SWIGTYPE_p_int parm)
public static void glp_netgen_prob(int nprob, SWIGTYPE_p_int parm)
public static int glp_gridgen(glp_graph G, int v_rhs, int a_cap, int a_cost, SWIGTYPE_p_int parm)
public static int glp_rmfgen(glp_graph G, SWIGTYPE_p_int s, SWIGTYPE_p_int t, int a_cap, SWIGTYPE_p_int parm)
public static int glp_weak_comp(glp_graph G, int v_num)
SYNOPSIS
int glp_weak_comp(glp_graph *G, int v_num);
DESCRIPTION
The routine glp_weak_comp finds all weakly connected components of the specified graph.
The parameter v_num specifies an offset of the field of type int in the vertex data block, to which the routine stores the number of a (weakly) connected component containing that vertex. If v_num < 0, no component numbers are stored.
The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 <= nc <= |V|.
RETURNS
The routine returns nc, the total number of components found.
public static int glp_strong_comp(glp_graph G, int v_num)
SYNOPSIS
int glp_strong_comp(glp_graph *G, int v_num);
DESCRIPTION
The routine glp_strong_comp finds all strongly connected components of the specified graph.
The parameter v_num specifies an offset of the field of type int in the vertex data block, to which the routine stores the number of a strongly connected component containing that vertex. If v_num < 0, no component numbers are stored.
The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 <= nc <= |V|. However, the component numbering has the property that for every arc (i->j) in the graph the condition num(i) >= num(j) holds.
RETURNS
The routine returns nc, the total number of components found.
public static int glp_top_sort(glp_graph G, int v_num)
public static int glp_wclique_exact(glp_graph G, int v_wgt, SWIGTYPE_p_double sol, int v_set)
This documentation is part of project GLPK for Java.
Group-ID | org.gnu.glpk |
Artifact-ID | glpk-java |
Version | 1.12.0 |