Loading...
Searching...
No Matches
CglTwomir.hpp
Go to the documentation of this file.
// $Id$
// Copyright (C) 2002, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
#ifndef CglTwomir_H
#define CglTwomir_H
#include <string>
#include "CglCutGenerator.hpp"
#include "CoinFactorization.hpp"
typedef struct
{
int nz; /* current length of arrays index[] and coeff[] */
int max_nz; /* max length of arrays index[] and coeff[] */
double *coeff; /* coefficient of each variable in the constraint */
int *index; /* index of the variable (value in 0 ... nrow+ncol) */
double rhs; /* rhs of the constraint */
char sense; /* ?? is it necessary */
} DGG_constraint_t;
typedef struct{
int n;
DGG_constraint_t **c;
int *ctype;
double *alpha;
} DGG_list_t;
/******************** BASIS INFORMATION ADTs **********************************/
typedef struct{
int q_min;
int q_max;
int t_min;
int t_max;
int a_max;
int max_elements;
} cutParams;
typedef struct
{
double gomory_threshold; /* factional variable must be this away from int */
int ncol, /* number of columns in LP */
nrow, /* number of constaints in LP */
ninteger; /* number of integer variables in LP */
int nbasic_col, /* number of basic columns in the LP */
nbasic_row; /* number of basic rows in the LP */
/* the following arrays are all of size (ncol+nrow) */
int *info; /* description of each variable (see below) */
double *lb; /* specifies the lower bound (if any) of each variable */
double *ub; /* specifies the upper bound (if any) of each variable */
double *x; /* current solution */
double *rc; /* current reduced cost */
double *opt_x;
cutParams cparams;
} DGG_data_t;
/* the following macros allow us to decode the info of the DGG_data
type. The encoding is as follows,
bit 1 : if the variable is basic or not (non-basic).
bit 2 : if the variable is integer or or not (rational).
bit 3 : if the variable is structural or not (artifical).
bit 4 : if the variable is non-basic and at its upper bound
(else if non-basic at lower bound). */
#define DGG_isBasic(data,idx) ((data->info[idx])&1)
#define DGG_isInteger(data,idx) ((data->info[idx] >> 1)&1)
#define DGG_isStructural(data,idx) ((data->info[idx] >> 2)&1)
#define DGG_isEqualityConstraint(data,idx) ((data->info[idx] >> 3)&1)
#define DGG_isNonBasicAtUB(data,idx) ((data->info[idx] >> 4)&1)
#define DGG_isNonBasicAtLB(data,idx) ((data->info[idx] >> 5)&1)
#define DGG_isConstraintBoundedAbove(data,idx) ((data->info[idx] >> 6)&1)
#define DGG_isConstraintBoundedBelow(data,idx) ((data->info[idx] >> 7)&1)
#define DGG_setIsBasic(data,idx) ((data->info[idx]) |= 1)
#define DGG_setIsInteger(data,idx) ((data->info[idx]) |= (1<<1))
#define DGG_setIsStructural(data,idx) ((data->info[idx]) |= (1<<2))
#define DGG_setEqualityConstraint(data,idx) ((data->info[idx]) |= (1<<3))
#define DGG_setIsNonBasicAtUB(data,idx) ((data->info[idx]) |= (1<<4))
#define DGG_setIsNonBasicAtLB(data,idx) ((data->info[idx]) |= (1<<5))
#define DGG_setIsConstraintBoundedAbove(data,idx) ((data->info[idx]) |= (1<<6))
#define DGG_setIsConstraintBoundedBelow(data,idx) ((data->info[idx]) |= (1<<7))
class CoinWarmStartBasis;
class CglTwomir : public CglCutGenerator {
friend void CglTwomirUnitTest(const OsiSolverInterface * siP,
const std::string mpdDir );
public:
std::string probname_;
virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
const CglTreeInfo info = CglTreeInfo());
virtual bool needsOptimalBasis() const;
void setMirScale (int tmin, int tmax) {t_min_ = tmin; t_max_ = tmax;}
void setTwomirScale (int qmin, int qmax) {q_min_ = qmin; q_max_ = qmax;}
void setAMax (int a) {a_max_ = a;}
void setMaxElements (int n) {max_elements_ = n;}
void setMaxElementsRoot (int n) {max_elements_root_ = n;}
void setCutTypes (bool mir, bool twomir, bool tab, bool form)
{ do_mir_ = mir; do_2mir_ = twomir; do_tab_ = tab; do_form_ = form;}
void setFormulationRows (int n) {form_nrows_ = n;}
int getTmin() const {return t_min_;}
int getTmax() const {return t_max_;}
int getQmin() const {return q_min_;}
int getQmax() const {return q_max_;}
int getAmax() const {return a_max_;}
int getMaxElements() const {return max_elements_;}
int getMaxElementsRoot() const {return max_elements_root_;}
int getIfMir() const { return do_mir_;}
int getIfTwomir() const { return do_2mir_;}
int getIfTableau() const { return do_tab_;}
int getIfFormulation() const { return do_form_;}
void setAway(double value);
double getAway() const;
void setAwayAtRoot(double value);
double getAwayAtRoot() const;
virtual int maximumLengthOfCutInTree() const
{ return max_elements_;}
void passInOriginalSolver(OsiSolverInterface * solver);
inline OsiSolverInterface * originalSolver() const
{ return originalSolver_;}
inline void setTwomirType(int type)
{ twomirType_=type;}
inline int twomirType() const
{ return twomirType_;}
CglTwomir ();
CglTwomir (const CglTwomir &);
virtual CglCutGenerator * clone() const;
CglTwomir & operator=(const CglTwomir& rhs);
virtual ~CglTwomir ();
virtual std::string generateCpp( FILE * fp);
virtual void refreshSolver(OsiSolverInterface * solver);
private:
// Private member data
CoinThreadRandom randomNumberGenerator_;
OsiSolverInterface * originalSolver_;
double away_;
double awayAtRoot_;
int twomirType_;
bool do_mir_;
bool do_2mir_;
bool do_tab_;
bool do_form_;
int t_min_;
int t_max_;
int q_min_;
int q_max_;
int a_max_;
int max_elements_;
int max_elements_root_;
int form_nrows_; //number of rows on which formulation cuts will be generated
};
//#############################################################################
/*
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <math.h>
#include <float.h>
#include <cassert>
#include <iostream.h>
*/
/******************** DEBUG DEFINITIONS ***************************************/
#define DGG_DEBUG_DGG 1
#define DGG_TRACE_ERRORS 0
#define DGG_DISPLAY 0
#define DGG_AUTO_CHECK_CUT_OFF_OPTIMAL 1
/******************** CONFIGURATION DEFAULTS **********************************/
#define DGG_DEFAULT_METHOD 2
#define DGG_DEFAULT_TMIN 1
#define DGG_DEFAULT_TMAX 1
#define DGG_DEFAULT_TAUMIN 2
#define DGG_DEFAULT_TAUMAX 6
#define DGG_DEFAULT_MAX_CUTS 500
#define DGG_DEFAULT_IMPROVEMENT_THRESH 0.001
#define DGG_DEFAULT_NBELOW_THRESH INT_MAX
#define DGG_DEFAULT_NROOT_ROUNDS 2
#define DGG_DEFAULT_NEGATIVE_SCALED_TWOSTEPS 0
#define DGG_DEFAULT_ALPHA_RULE 0
#define DGG_DEFAULT_CUT_INC 250
#define DGG_DEFAULT_CUT_FORM 0
#define DGG_DEFAULT_NICEFY 0
#define DGG_DEFAULT_ONLY_DELAYED 0
#define DGG_DEFAULT_DELAYED_FREQ 9999999
#define DGG_DEFAULT_LPROWS_FREQ 9999999
#define DGG_DEFAULT_WHICH_FORMULATION_CUTS 2
/******************** SOLVER CONFIGURATION DEFINITIONS ************************/
#define DGG_OSI 0
#define DGG_CPX 1
#define DGG_QSO 2
/* determines the solver to be used */
#define DGG_SOLVER DGG_OSI
/* adds checking routines to make sure solver works as expected */
#define DGG_DEBUG_SOLVER 0
/* turn off screen output from solver */
#define DGG_SOLVER_SCREEN_FLAG 0
/******************** CUT DEFINITIONS *****************************************/
/* internal names for cut types */
#define DGG_TMIR_CUT 1
#define DGG_2STEP_CUT 2
/* internal names for alpha-selection rules */
#define DGG_ALPHA_MIN_SUM 0
#define DGG_ALPHA_RANDOM_01 1
#define DGG_ALPHA_RANDOM_COEFF 2
#define DGG_ALPHA_ALL 3
#define DGG_ALPHA_MAX_STEEP 5
/******************** PRECISION & NUMERICAL ISSUES DEFINITIONS ****************/
/* how steep a cut must be before adding it to the lp */
#define DGG_MIN_STEEPNESS 1.0e-4
#define DGG_MAX_L2NORM 1.0e7
/* 0 = min steepness, 1 = max norm */
#define DGG_NORM_CRITERIA 1
/* used to define how fractional a basic-integer variable must be
before choosing to use it to generate a TMIR cut on.
OSI's default is 1.0e-7 */
#define DGG_GOMORY_THRESH 0.005
#define DGG_RHS_THRESH 0.005
/* used for comparing variables to their upper bounds.
OSI's default is 1.0e-7.
We set it to 1.0e6 because e-7 seems too sensitive.
In fact, with e-7 the problem dsbmip.mps complains. */
#define DGG_BOUND_THRESH 1.0e-6
/* used for comparing the lhs (activity) value of a tableau row
with the rhs. This is only used for debugging purposes. */
#define DGG_EQUALITY_THRESH 1.0e-5
/* used for comparing a variable's lower bound to 0.0
and determining if we need to shift the variable */
#define DGG_SHIFT_THRESH 1.0e-6
/* used for determing how far from an integer is still an integer.
This value is used for comparing coefficients to integers.
OSI's default is 1.0e-10. */
#define DGG_INTEGRALITY_THRESH 1.0e-10
/* the min value that a coeff can have in the tableau row
before being set to zero. */
#define CBC_CHECK_CUT
#ifndef CBC_CHECK_CUT
#define DGG_MIN_TABLEAU_COEFFICIENT 1.0e-8
#else
#define DGG_MIN_TABLEAU_COEFFICIENT 1.0e-12
#endif
/* smallest value rho is allowed to have for a simple 2-step MIR
(ie: not an extended two-step MIR) */
#define DGG_MIN_RHO 1.0e-7
#define DGG_MIN_ALPHA 1.0e-7
/* when a slack is null: used to check if a cut is satisfied or not. */
#define DGG_NULL_SLACK 1.0e-5
/* nicefy constants */
#define DGG_NICEFY_MIN_ABSVALUE 1.0e-13
#define DGG_NICEFY_MIN_FIX 1.0e-7
#define DGG_NICEFY_MAX_PADDING 1.0e-6
#define DGG_NICEFY_MAX_RATIO 1.0e9
/******************** ERROR-CATCHING MACROS ***********************************/
#if DGG_TRACE_ERRORS > 0
#define __DGG_PRINT_LOC__(F) fprintf(((F==0)?stdout:F), " in %s (%s:%d)\n", __func__, __FILE__, __LINE__)
#define DGG_THROW(A,REST...) {\
fprintf(stdout, ##REST); \
__DGG_PRINT_LOC__(stdout); \
return (A);}
#define DGG_IF_EXIT(A,B,REST...) {\
if(A) {\
fprintf(stdout, ##REST); \
__DGG_PRINT_LOC__(stdout); \
exit(B);}}
#define DGG_CHECKRVAL(A,B) {\
if(A) {\
__DGG_PRINT_LOC__(stdout); \
return B; } }
#define DGG_CHECKRVAL1(A,B) {\
if(A) {\
__DGG_PRINT_LOC__(stdout); \
rval = B; goto CLEANUP; } }
#define DGG_WARNING(A, REST...) {\
if(A) {\
fprintf(stdout, ##REST); \
__DGG_PRINT_LOC__(stdout); \
}}
#define DGG_TEST(A,B,REST...) {\
if(A) DGG_THROW(B,##REST) }
#define DGG_TEST2(A,B,C,REST) {DGG_TEST(A,B,C,REST) }
#define DGG_TEST3(A,B,C,D,REST) {DGG_TEST(A,B,C,D,REST) }
#else
#define DGG_IF_EXIT(A,B,REST) {if(A) {fprintf(stdout, REST);exit(B);}}
#define DGG_THROW(A,B) return(A)
#define DGG_CHECKRVAL(A,B) { if(A) return(B); }
#define DGG_CHECKRVAL1(A,B){ if(A) { rval = B; goto CLEANUP; } }
#define DGG_TEST(A,B,REST) { if(A) return(B);}
#define DGG_TEST2(A,B,REST,C) { DGG_TEST(A,B,REST) }
#define DGG_TEST3(A,B,REST,C,D) { DGG_TEST(A,B,REST) }
#endif
/******************** SIMPLE MACROS AND FUNCTIONS *****************************/
#define DGG_MIN(a,b) ( (a<b)?a:b )
#define DGG_MAX(a,b) ( (a>b)?a:b )
#define KREM(vht,alpha,tau) (DGG_MIN( ceil(vht / alpha), tau ) - 1)
#define LMIN(vht, d, bht) (DGG_MIN( floor(d*bht/bht), d))
#define ABOV(v) (v - floor(v))
#define QINT(vht,bht,tau) ( (int)floor( (vht*(tau-1))/bht ) )
#define V2I(bht,tau,i) ( ((i+1)*bht / tau) )
int DGG_is_even(double vht, double bht, int tau, int q);
double frac_part(double value);
int DGG_is_a_multiple_of_b(double a, double b);
/* free function for DGG_data_t. Frees internal arrays and data structure */
int DGG_freeData( DGG_data_t *data );
/******************** CONSTRAINT ADTs *****************************************/
DGG_constraint_t* DGG_newConstraint(int max_arrays);
void DGG_freeConstraint(DGG_constraint_t *c);
DGG_constraint_t *DGG_copyConstraint(DGG_constraint_t *c);
void DGG_scaleConstraint(DGG_constraint_t *c, int t);
/******************** CONFIGURATION *******************************************/
void DGG_list_init (DGG_list_t *l);
int DGG_list_addcut (DGG_list_t *l, DGG_constraint_t *cut, int ctype, double alpha);
void DGG_list_delcut (DGG_list_t *l, int i);
void DGG_list_free(DGG_list_t *l);
/******************* SOLVER SPECIFIC METHODS **********************************/
DGG_data_t *DGG_getData(const void *solver_ptr);
/******************* CONSTRAINT MANIPULATION **********************************/
/* DGG_transformConstraint: manipulates a constraint in the following way:
packs everything in output
1 - variables at their upper bounds are substituted for their
complements. This is done by adjusting the coefficients and
the right hand side (simple substitution).
2 - variables with non-zero lower bounds are shifted. */
int DGG_transformConstraint( DGG_data_t *data,
double **x_out,
double **rc_out,
char **isint_out,
DGG_constraint_t *constraint );
/* DGG_unTransformConstraint :
1 - Undoes step (1) of DGG_transformConstraint
2 - Undoes step (2) of DGG_transformConstraint */
int DGG_unTransformConstraint( DGG_data_t *data,
DGG_constraint_t *constraint );
/* substitutes each slack variable by the structural variables which
define it. This function, hence, changes the constraint 'cut'. */
int DGG_substituteSlacks( const void *solver_ptr,
DGG_data_t *data,
DGG_constraint_t *cut );
int DGG_nicefyConstraint( const void *solver_ptr,
DGG_data_t *data,
DGG_constraint_t *cut);
/******************* CUT GENERATION *******************************************/
int DGG_getFormulaConstraint( int row_idx,
const void *solver_ptr,
DGG_data_t *data,
DGG_constraint_t* row );
int DGG_getTableauConstraint( int index,
const void *solver_ptr,
DGG_data_t *data,
DGG_constraint_t* tabrow,
const int * colIsBasic,
const int * rowIsBasic,
CoinFactorization & factorization,
int mode );
DGG_constraint_t* DGG_getSlackExpression(const void *solver_ptr, DGG_data_t* data, int row_index);
int DGG_generateTabRowCuts( DGG_list_t *list,
DGG_data_t *data,
const void *solver_ptr );
int DGG_generateFormulationCuts( DGG_list_t *list,
DGG_data_t *data,
const void *solver_ptr,
int nrows,
CoinThreadRandom & generator);
int DGG_generateFormulationCutsFromBase( DGG_constraint_t *base,
double slack,
DGG_list_t *list,
DGG_data_t *data,
const void *solver_ptr,
CoinThreadRandom & generator);
int DGG_generateCutsFromBase( DGG_constraint_t *base,
DGG_list_t *list,
DGG_data_t *data,
const void *solver_ptr );
int DGG_buildMir( char *isint,
DGG_constraint_t *base,
DGG_constraint_t **cut_out );
int DGG_build2step( double alpha,
char *isint,
DGG_constraint_t *base,
DGG_constraint_t **cut_out );
int DGG_addMirToList ( DGG_constraint_t *base,
char *isint,
double *x,
DGG_list_t *list,
DGG_data_t *data,
DGG_constraint_t *orig_base );
int DGG_add2stepToList ( DGG_constraint_t *base,
char *isint,
double *x,
double *rc,
DGG_list_t *list,
DGG_data_t *data,
DGG_constraint_t *orig_base );
/******************* CUT INFORMATION ******************************************/
double DGG_cutLHS(DGG_constraint_t *c, double *x);
int DGG_isCutDesirable(DGG_constraint_t *c, DGG_data_t *d);
/******************* TEST / DEBUGGING ROUTINES ********************************/
int DGG_isConstraintViolated(DGG_data_t *d, DGG_constraint_t *c);
int DGG_isBaseTrivial(DGG_data_t *d, DGG_constraint_t* c);
int DGG_is2stepValid(double alpha, double bht);
int DGG_cutsOffPoint(double *x, DGG_constraint_t *cut);
//#############################################################################
void CglTwomirUnitTest(const OsiSolverInterface * siP,
const std::string mpdDir);
#endif
CglCutGenerator.hpp
DGG_add2stepToList
int DGG_add2stepToList(DGG_constraint_t *base, char *isint, double *x, double *rc, DGG_list_t *list, DGG_data_t *data, DGG_constraint_t *orig_base)
DGG_isBaseTrivial
int DGG_isBaseTrivial(DGG_data_t *d, DGG_constraint_t *c)
DGG_getTableauConstraint
int DGG_getTableauConstraint(int index, const void *solver_ptr, DGG_data_t *data, DGG_constraint_t *tabrow, const int *colIsBasic, const int *rowIsBasic, CoinFactorization &factorization, int mode)
DGG_is_even
int DGG_is_even(double vht, double bht, int tau, int q)
DGG_cutsOffPoint
int DGG_cutsOffPoint(double *x, DGG_constraint_t *cut)
DGG_isCutDesirable
int DGG_isCutDesirable(DGG_constraint_t *c, DGG_data_t *d)
DGG_getFormulaConstraint
int DGG_getFormulaConstraint(int row_idx, const void *solver_ptr, DGG_data_t *data, DGG_constraint_t *row)
DGG_nicefyConstraint
int DGG_nicefyConstraint(const void *solver_ptr, DGG_data_t *data, DGG_constraint_t *cut)
DGG_isConstraintViolated
int DGG_isConstraintViolated(DGG_data_t *d, DGG_constraint_t *c)
DGG_cutLHS
double DGG_cutLHS(DGG_constraint_t *c, double *x)
DGG_getSlackExpression
DGG_constraint_t * DGG_getSlackExpression(const void *solver_ptr, DGG_data_t *data, int row_index)
DGG_list_init
void DGG_list_init(DGG_list_t *l)
DGG_freeConstraint
void DGG_freeConstraint(DGG_constraint_t *c)
DGG_getData
DGG_data_t * DGG_getData(const void *solver_ptr)
DGG_copyConstraint
DGG_constraint_t * DGG_copyConstraint(DGG_constraint_t *c)
DGG_build2step
int DGG_build2step(double alpha, char *isint, DGG_constraint_t *base, DGG_constraint_t **cut_out)
DGG_newConstraint
DGG_constraint_t * DGG_newConstraint(int max_arrays)
DGG_generateFormulationCutsFromBase
int DGG_generateFormulationCutsFromBase(DGG_constraint_t *base, double slack, DGG_list_t *list, DGG_data_t *data, const void *solver_ptr, CoinThreadRandom &generator)
CglTwomirUnitTest
void CglTwomirUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglTwomir class.
DGG_unTransformConstraint
int DGG_unTransformConstraint(DGG_data_t *data, DGG_constraint_t *constraint)
DGG_addMirToList
int DGG_addMirToList(DGG_constraint_t *base, char *isint, double *x, DGG_list_t *list, DGG_data_t *data, DGG_constraint_t *orig_base)
frac_part
double frac_part(double value)
DGG_freeData
int DGG_freeData(DGG_data_t *data)
DGG_substituteSlacks
int DGG_substituteSlacks(const void *solver_ptr, DGG_data_t *data, DGG_constraint_t *cut)
DGG_list_addcut
int DGG_list_addcut(DGG_list_t *l, DGG_constraint_t *cut, int ctype, double alpha)
DGG_transformConstraint
int DGG_transformConstraint(DGG_data_t *data, double **x_out, double **rc_out, char **isint_out, DGG_constraint_t *constraint)
DGG_is2stepValid
int DGG_is2stepValid(double alpha, double bht)
DGG_generateTabRowCuts
int DGG_generateTabRowCuts(DGG_list_t *list, DGG_data_t *data, const void *solver_ptr)
DGG_list_delcut
void DGG_list_delcut(DGG_list_t *l, int i)
DGG_is_a_multiple_of_b
int DGG_is_a_multiple_of_b(double a, double b)
DGG_generateFormulationCuts
int DGG_generateFormulationCuts(DGG_list_t *list, DGG_data_t *data, const void *solver_ptr, int nrows, CoinThreadRandom &generator)
DGG_scaleConstraint
void DGG_scaleConstraint(DGG_constraint_t *c, int t)
DGG_buildMir
int DGG_buildMir(char *isint, DGG_constraint_t *base, DGG_constraint_t **cut_out)
DGG_generateCutsFromBase
int DGG_generateCutsFromBase(DGG_constraint_t *base, DGG_list_t *list, DGG_data_t *data, const void *solver_ptr)
DGG_list_free
void DGG_list_free(DGG_list_t *l)
CglCutGenerator::CglCutGenerator
CglCutGenerator()
Default constructor.
CglTreeInfo
Information about where the cut generator is invoked from.
Definition CglTreeInfo.hpp:15
CglTwomir::a_max_
int a_max_
q_max - last value of t to use for 2-Step tMIR inequalities
Definition CglTwomir.hpp:215
CglTwomir::do_2mir_
bool do_2mir_
Definition CglTwomir.hpp:207
CglTwomir::randomNumberGenerator_
CoinThreadRandom randomNumberGenerator_
Threadsafe random number generator.
Definition CglTwomir.hpp:197
CglTwomir::do_form_
bool do_form_
Definition CglTwomir.hpp:209
CglTwomir::t_min_
int t_min_
Definition CglTwomir.hpp:211
CglTwomir::maximumLengthOfCutInTree
virtual int maximumLengthOfCutInTree() const
Return maximum length of cut in tree.
Definition CglTwomir.hpp:151
CglTwomir::do_mir_
bool do_mir_
Definition CglTwomir.hpp:206
CglTwomir::generateCuts
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
Generate Two step MIR cuts either from the tableau rows or from the formulation rows.
CglTwomir::getIfFormulation
int getIfFormulation() const
Definition CglTwomir.hpp:135
CglTwomir::getAmax
int getAmax() const
Definition CglTwomir.hpp:129
CglTwomir::getQmin
int getQmin() const
Definition CglTwomir.hpp:127
CglTwomir::needsOptimalBasis
virtual bool needsOptimalBasis() const
Return true if needs optimal basis to do cuts (will return true).
CglTwomir::setCutTypes
void setCutTypes(bool mir, bool twomir, bool tab, bool form)
Definition CglTwomir.hpp:120
CglTwomir::originalSolver_
OsiSolverInterface * originalSolver_
Original solver.
Definition CglTwomir.hpp:199
CglTwomir::getIfTwomir
int getIfTwomir() const
Definition CglTwomir.hpp:133
CglTwomir::getQmax
int getQmax() const
Definition CglTwomir.hpp:128
CglTwomir::twomirType_
int twomirType_
Type - 0 normal, 1 add original matrix one, 2 replace.
Definition CglTwomir.hpp:205
CglTwomir::getIfMir
int getIfMir() const
Definition CglTwomir.hpp:132
CglTwomir::generateCpp
virtual std::string generateCpp(FILE *fp)
Create C++ lines to get to current state.
CglTwomir::setMaxElementsRoot
void setMaxElementsRoot(int n)
Definition CglTwomir.hpp:119
CglTwomir::max_elements_
int max_elements_
a_max - maximum value of bhat/alpha
Definition CglTwomir.hpp:216
CglTwomir::CglTwomir
CglTwomir(const CglTwomir &)
Copy constructor.
CglTwomir::awayAtRoot_
double awayAtRoot_
Only investigate if more than this away from integrality (at root).
Definition CglTwomir.hpp:203
CglTwomir::getMaxElementsRoot
int getMaxElementsRoot() const
Definition CglTwomir.hpp:131
CglTwomir::setTwomirType
void setTwomirType(int type)
Set type - 0 normal, 1 add original matrix one, 2 replace.
Definition CglTwomir.hpp:163
CglTwomir::getMaxElements
int getMaxElements() const
Definition CglTwomir.hpp:130
CglTwomir::getIfTableau
int getIfTableau() const
Definition CglTwomir.hpp:134
CglTwomir::max_elements_root_
int max_elements_root_
Maximum number of elements in cut.
Definition CglTwomir.hpp:217
CglTwomir::~CglTwomir
virtual ~CglTwomir()
Destructor.
CglTwomir::t_max_
int t_max_
t_min - first value of t to use for tMIR inequalities
Definition CglTwomir.hpp:212
CglTwomir::getAwayAtRoot
double getAwayAtRoot() const
Get away at root.
CglTwomir::CglTwomirUnitTest
friend void CglTwomirUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglTwomir class.
CglTwomir::setMirScale
void setMirScale(int tmin, int tmax)
Set.
Definition CglTwomir.hpp:115
CglTwomir::setAwayAtRoot
void setAwayAtRoot(double value)
Set away at root.
CglTwomir::q_max_
int q_max_
q_min - first value of t to use for 2-Step tMIR inequalities
Definition CglTwomir.hpp:214
CglTwomir::originalSolver
OsiSolverInterface * originalSolver() const
Returns original solver.
Definition CglTwomir.hpp:160
CglTwomir::getTmax
int getTmax() const
Definition CglTwomir.hpp:126
CglTwomir::do_tab_
bool do_tab_
Definition CglTwomir.hpp:208
CglTwomir::q_min_
int q_min_
t_max - last value of t to use for tMIR inequalities
Definition CglTwomir.hpp:213
CglTwomir::passInOriginalSolver
void passInOriginalSolver(OsiSolverInterface *solver)
Pass in a copy of original solver (clone it).
CglTwomir::probname_
std::string probname_
Problem name.
Definition CglTwomir.hpp:100
CglTwomir::setAway
void setAway(double value)
Set away.
CglTwomir::getTmin
int getTmin() const
Get.
Definition CglTwomir.hpp:125
CglTwomir::CglTwomir
CglTwomir()
Default constructor.
CglTwomir::form_nrows_
int form_nrows_
Maximum number of elements in cut at root.
Definition CglTwomir.hpp:218
CglTwomir::clone
virtual CglCutGenerator * clone() const
Clone.
CglTwomir::setAMax
void setAMax(int a)
Definition CglTwomir.hpp:117
CglTwomir::refreshSolver
virtual void refreshSolver(OsiSolverInterface *solver)
This can be used to refresh any inforamtion.
CglTwomir::setTwomirScale
void setTwomirScale(int qmin, int qmax)
Definition CglTwomir.hpp:116
CglTwomir::operator=
CglTwomir & operator=(const CglTwomir &rhs)
Assignment operator.
CglTwomir::twomirType
int twomirType() const
Return type.
Definition CglTwomir.hpp:166
CglTwomir::getAway
double getAway() const
Get away.
CglTwomir::setFormulationRows
void setFormulationRows(int n)
Definition CglTwomir.hpp:122
CglTwomir::away_
double away_
Only investigate if more than this away from integrality.
Definition CglTwomir.hpp:201
CglTwomir::setMaxElements
void setMaxElements(int n)
Definition CglTwomir.hpp:118
DGG_constraint_t
Definition CglTwomir.hpp:14
DGG_constraint_t::rhs
double rhs
Definition CglTwomir.hpp:20
DGG_constraint_t::max_nz
int max_nz
Definition CglTwomir.hpp:17
DGG_constraint_t::sense
char sense
Definition CglTwomir.hpp:21
DGG_constraint_t::nz
int nz
Definition CglTwomir.hpp:16
DGG_constraint_t::coeff
double * coeff
Definition CglTwomir.hpp:18
DGG_constraint_t::index
int * index
Definition CglTwomir.hpp:19
DGG_data_t
Definition CglTwomir.hpp:43
DGG_data_t::info
int * info
Definition CglTwomir.hpp:53
DGG_data_t::nbasic_row
int nbasic_row
Definition CglTwomir.hpp:50
DGG_data_t::rc
double * rc
Definition CglTwomir.hpp:57
DGG_data_t::gomory_threshold
double gomory_threshold
Definition CglTwomir.hpp:44
DGG_data_t::x
double * x
Definition CglTwomir.hpp:56
DGG_data_t::cparams
cutParams cparams
Definition CglTwomir.hpp:60
DGG_data_t::nrow
int nrow
Definition CglTwomir.hpp:46
DGG_data_t::ninteger
int ninteger
Definition CglTwomir.hpp:47
DGG_data_t::nbasic_col
int nbasic_col
Definition CglTwomir.hpp:49
DGG_data_t::ub
double * ub
Definition CglTwomir.hpp:55
DGG_data_t::opt_x
double * opt_x
Definition CglTwomir.hpp:58
DGG_data_t::ncol
int ncol
Definition CglTwomir.hpp:45
DGG_data_t::lb
double * lb
Definition CglTwomir.hpp:54
DGG_list_t
Definition CglTwomir.hpp:25
DGG_list_t::c
DGG_constraint_t ** c
Definition CglTwomir.hpp:27
DGG_list_t::ctype
int * ctype
Definition CglTwomir.hpp:28
DGG_list_t::alpha
double * alpha
Definition CglTwomir.hpp:29
DGG_list_t::n
int n
Definition CglTwomir.hpp:26
cutParams
Definition CglTwomir.hpp:33
cutParams::max_elements
int max_elements
Definition CglTwomir.hpp:39
cutParams::t_max
int t_max
Definition CglTwomir.hpp:37
cutParams::t_min
int t_min
Definition CglTwomir.hpp:36
cutParams::q_max
int q_max
Definition CglTwomir.hpp:35
cutParams::a_max
int a_max
Definition CglTwomir.hpp:38
cutParams::q_min
int q_min
Definition CglTwomir.hpp:34
cut
Definition Cgl012cut.hpp:153