Definition in file mt_cplex_cbk.c.
#include <math.h>
#include "cplex.h"
#include "mt_cplex_cbk.h"
#include "mt_gomory.h"
#include "EGlib.h"
Include dependency graph for mt_cplex_cbk.c:
Go to the source code of this file.
Defines | |
#define | __MT_NS_LVL 0 |
#define | UPDATE_F_AND_VAL(__f, __cstat, __bound, __val) |
simple handler to update f according to the complementation of variables | |
Functions | |
void | MTccbk_info_display (const MTccbk_info_t *const info, FILE *out) |
display callback info | |
int | MTccbk_info_process (MTccbk_info_t *const info, CPXCENVptr env, void *cbdata, int wherefrom, int *const action) |
test if we should proceed with the cuting process, and update information | |
int | MTcheckTabrow (const MTlp_t *const lp, const double *tableau, int *const status, double *const ratio, int *const etnz) |
given a tableau in extended notation, verify that it is indeed a numerically stable and correct tableau. | |
int | MTcompressTabRow (const MTlp_t *const lp, const MTsol_t *const sol, double *rowval, int *rowind, double *const rhs, int *const nz) |
given a tableau row in extended format, store it as a compresed form, it include setting row to row - integer_part[row] and updating the rhs. | |
void | MTcompute_f (const MTlp_t *const lp, const double *const tableau, const double *const x, const double *const slack, double *const f) |
compute ax = f for a tableau | |
int | MTcompute_fractional_vars (const MTlp_t *const lp, const double *const x, int *const fracvars, int *const nfrac, const double minitgap) |
get the indices of fractional (structural) variables | |
int | MTcompute_integer_vars (const MTlp_t *const lp, const double *const x, int *const intvars, int *const nint, const double intgap) |
get the indices of (almost) integer variables | |
int | MTcplex_binv_to_tableau (const MTlp_t *const lp, const double *const binvrow, double *const tableau) |
given an LP desvription, and CPLEX binvrow, compute the actual tableau (including logicals, which are in position i+ncols of the tableau for the i-th logical/slack variable, but we force that the coefficient of equality logicals is zero) | |
void | MTcplex_display_compress_tableau (FILE *file, const MTlp_t *const lp, const double *const matval, const int *const matind, const int nz) |
display a compress tableau into the given file | |
void | MTcplex_display_tableau (FILE *file, const MTlp_t *const lp, const double *const tableau) |
display a tableau into the given file | |
int | MTcplex_test_cut (const MTcut_t *const cut, const MTlp_t *const lp) |
test if a given cut is valid to the given cplex LP | |
void | MTdisplay_lp (const MTlp_t *const lp, const MTsol_t *const sol, FILE *stream) |
display an LP to the given file | |
int | MTget_best_k_integer_tableau_rows (const MTlp_t *const lp, const MTsol_t *const sol, const int max_tableau, CPXCENVptr env, CPXLPptr CPXlp, MTrowmatrix_t *const tb, double *const f) |
Get the best K tableau (asociated to integer basic variables), note that we check for wrongly computed tableau. Note that we compute Z = f + 0.5+Ax, where A is the tableau and f the fractional value (displaced by 1/2), moreover, all basic variables have zero coefficient in the resulting tableau, and all variables are complemented to their bounds. | |
int | MTget_best_k_tableau_rows (const MTlp_t *const lp, const MTsol_t *const sol, const int max_tableau, CPXCENVptr env, CPXLPptr CPXlp, MTrowmatrix_t *const tb, double *const f) |
Get the best K tableau (asociated to fractional variables), note that we check for wrongly computed tableau. Note that we compute Z = f + 0.5+Ax, where A is the tableau and f the fractional value (displaced by 1/2), moreover, all basic variables have zero coefficient in the resulting tableau, and all variables are complemented to their bounds. | |
int | MTget_sol (const MTlp_t *const lp, CPXCENVptr env, CPXLPptr CPXlp, void *cbdata, int wherefrom, MTsol_t *const sol) |
obtain a solution to the current node LP | |
int | MTgomory_ccbk (CPXCENVptr env, void *cbdata, int wherefrom, void *cbhandle, int *useraction_p) |
Interface for the CPLEX-callback for the MTgomoryCut function. | |
void | MTlp_clear (MTlp_t *const MTlp) |
free any internally allocated memory inside an MTlp_t structure. | |
int | MTlp_load_problem (CPXCENVptr env, MTlp_t *const lp, CPXLPptr CPXlp, void *cbdata, int wherefrom) |
Given an LP problem pointer, load it into an (initialized) MTlp_t structure. | |
static void | MTlp_rsz (MTlp_t *const MTlp, const int rsz, const int csz, const int tsz) |
resize an lp structure | |
int | MTnode_solve (CPXCENVptr env, void *cbdata, int wherefrom, void *cbhandle, int *useraction_p) |
simple node solve callback, we use it to count primal degenerancy, i.e. the number of variables with zero reduced cost, this should indicate posibility of doing nested objective funcions to avoid primal degenerancy | |
int | MTraw_to_complemented_cut (const MTlp_t *const lp, const MTsol_t *const sol, double *const extended, MTcut_t *const cut) |
transform an extened non-complemented cut to a compresed and complemented form. We assume the extended cut is of the form ax >= 1. Note that we expect no coefficient for basic variables in the cut, moreover, the rhs of the inequality is assumed to be 1 (in raw format). | |
int | MTraw_to_uncomplemented_cut (const MTlp_t *const lp, const double *const extended, const int nactive, const int *const active, MTcut_t *const cut, int *const status) |
transform an extened non-complemented cut to a compresed for. We assume the extended cut is of the form ax >= 1.m Note that we expect no coefficient for basic variables in the cut. | |
int | MTread_cplex_options (CPXENVptr env, FILE *inputfile) |
read optionfile and set parameter to CPLEX | |
void | MTrowmatrix_clear (MTrowmatrix_t *const MTrm) |
free any internally allocated memory inside an MTrowmatrix_t structure. | |
void | MTrowmatrix_rsz (MTrowmatrix_t *const MTrm, const int MTrsz, const int MTnsz) |
resize a MTrowmatrix_t structure | |
void | MTsol_clear (MTsol_t *const MTsol) |
clear any internal memory asociated with an MTsol_t structure | |
void | MTsol_rsz (MTsol_t *const MTsol, const int cnz, const int rnz) |
resize a solution structure | |
int | MTuncomplemented_to_complemented_cut (const MTlp_t *const lp, const MTsol_t *const sol, MTcut_t *const cut) |
transform an uncomplemented cut to a complemented form. Note that we expect no coefficient for basic variables in the cut. | |
Variables | |
char | __mt_cplex_errbuf [4096] |
internal error string for cplex | |
double | MTccbk_discarded_ratio = DBL_MAX |
minimum ratio of discarded inequality | |
double | MTccbk_discarded_violation = 0 |
maximum violation of discarded inequality | |
int | MTccbk_fail_ratio = 0 |
Number of discarded cuts because high ratio. | |
int | MTccbk_fail_tableau_btype = 0 |
Type of basic variable for tableau is not integer. | |
int | MTccbk_fail_tableau_coeff = 0 |
Number of discarded cuts because tableaus has wrong coefficient for basic variable. | |
int | MTccbk_fail_tableau_frac = 0 |
Number of discarded cuts because fraction is too small. | |
int | MTccbk_fail_tableau_nbasic = 0 |
Number of discarded cuts because tableaus has wrong number of basic variables. | |
int | MTccbk_fail_tableau_ratio = 0 |
int | MTccbk_fail_violation = 0 |
Number of discarded cuts because low violation. |