Scippy

UG

Ubiquity Generator framework

ScipParaInstanceTh Class Reference

#include <scipParaInstanceTh.h>

Inheritance diagram for ScipParaInstanceTh:
ScipParaInstance BbParaInstance BbParaInstance ParaInstance ParaInstance

Public Member Functions

 ScipParaInstanceTh ()
 
 ScipParaInstanceTh (SCIP *inScip, int method)
 
 ~ScipParaInstanceTh ()
 
int bcast (UG::ParaComm *comm, int rank, int method)
 
void setFileName (const char *file)
 
- Public Member Functions inherited from ScipParaInstance
 ScipParaInstance ()
 
 ScipParaInstance (SCIP *scip, int method)
 
virtual ~ScipParaInstance ()
 
double convertToExternalValue (double internalValue)
 
double convertToInternalValue (double externalValue)
 
void getSolValuesForOriginalProblem (ScipParaSolution *sol, SCIP_Real *vals)
 
void createProblem (SCIP *scip, int method, bool noPreprocessingInLC, bool usetRootNodeCuts, ScipDiffParamSet *scipDiffParamSetRoot, ScipDiffParamSet *scipDiffParamSet, char *settingsNameLC, char *isolname)
 
const std::string toString ()
 
bool isOriginalIndeciesMap ()
 
bool isSolverLocalIndeciesMap ()
 
int getOrigProbIndex (int index)
 
const char * getProbName ()
 
void freeMemory ()
 
int getNVars ()
 
int getVarIndexRange ()
 
SCIP_Real getVarLb (int i)
 
SCIP_Real getVarUb (int i)
 
SCIP_Real getObjCoef (int i)
 
int getVarType (int i)
 
const char * getVarName (int i)
 
int getNConss ()
 
SCIP_Real getLhsLinear (int i)
 
SCIP_Real getRhsLinear (int i)
 
int getNVarsLinear (int i)
 
int getIdxLinearCoefVar (int i, int j)
 
SCIP_Real * getLinearCoefs (int i)
 
const char * getConsName (int i)
 
SCIP * getScip ()
 
void setUserPlugins (ScipUserPlugins *inUi)
 
void includeUserPlugins (SCIP *inScip)
 
virtual void setFileName (const char *fileName)=0
 
int * extractOrigProbIndexMap ()
 
int * extractSolverLocalIndexMap ()
 
SCIP * getParaInstanceScip ()
 
int getOrigObjSense ()
 
virtual bool isCopyIncreasedVariables ()=0
 
virtual void copyIncrasedVariables ()=0
 
 ScipParaInstance ()
 
 ScipParaInstance (SCIP *inScip)
 
virtual ~ScipParaInstance ()
 
double convertToExternalValue (double internalValue)
 
double convertToInternalValue (double externalValue)
 
void getSolValuesForOriginalProblem (ScipParaSolution *sol, SCIP_Real *vals)
 
void copyScipEnvironment (SCIP **scip)
 
SCIP * getScip ()
 
void createProblem (SCIP *scip, int method, bool noPreprocessingInLC, bool usetRootNodeCuts, ScipDiffParamSet *scipDiffParamSetRoot, ScipDiffParamSet *scipDiffParamSet, char *settingsNameLC, char *isolname)
 
const std::string toString ()
 
const char * getProbName ()
 
int getNVars ()
 
int getVarIndexRange ()
 
SCIP_Real getVarLb (int i)
 
SCIP_Real getVarUb (int i)
 
int getVarType (int i)
 
SCIP_Real getObjCoef (int i)
 
const char * getVarName (int i)
 
int getNConss ()
 
SCIP_Real getLhsLinear (int i)
 
SCIP_Real getRhsLinear (int i)
 
int getNVarsLinear (int i)
 
int getIdxLinearCoefVar (int i, int j)
 
SCIP_Real * getLinearCoefs (int i)
 
const char * getConsName (int i)
 
void setUserPlugins (ScipUserPlugins *inUi)
 
void includeUserPlugins (SCIP *inScip)
 
virtual void setFileName (const char *file)=0
 
bool isOriginalIndeciesMap ()
 
bool isSolverLocalIndeciesMap ()
 
int getOrigProbIndex (int index)
 
int * extractOrigProbIndexMap ()
 
int * extractSolverLocalIndexMap ()
 
SCIP * getParaInstanceScip ()
 
int getOrigObjSense ()
 
bool isCopyIncreasedVariables ()
 
void copyIncrasedVariables ()
 
- Public Member Functions inherited from BbParaInstance
 BbParaInstance ()
 DO NOT HAVE DATA MEMBER!! More...
 
virtual ~BbParaInstance ()
 destructor More...
 
virtual int getVarIndexRange ()=0
 get variable index range TODO: this function should be in inherited class More...
 
- Public Member Functions inherited from ParaInstance
 ParaInstance ()
 DO NOT HAVE DATA MEMBER!! More...
 
virtual ~ParaInstance ()
 destructor More...
 
virtual const char * getProbName ()=0
 get problem name More...
 
virtual int bcast (ParaComm *comm, int rank, int method)=0
 broadcast function to all solvers More...
 
virtual const std::string toString ()=0
 Stringfy this object. More...
 

Private Member Functions

const char * getFileName ()
 

Additional Inherited Members

- Protected Member Functions inherited from ScipParaInstance
void allocateMemoryForOrdinaryConstraints ()
 
void addOrdinaryConstraintName (int c, SCIP_CONS *cons)
 
void setLinearConstraint (SCIP *scip, int c, SCIP_CONS *cons)
 
void createLinearConstraintsInSCIP (SCIP *scip)
 
void setSetppcConstraint (SCIP *scip, int c, SCIP_CONS *cons)
 
void createSetppcConstraintsInSCIP (SCIP *scip)
 
void setLogicorConstraint (SCIP *scip, int c, SCIP_CONS *cons)
 
void createLogicorConstraintsInSCIP (SCIP *scip)
 
void setKnapsackConstraint (SCIP *scip, int c, SCIP_CONS *cons)
 
void createKnapsackConstraintsInSCIP (SCIP *scip)
 
void setVarboundConstraint (SCIP *scip, int c, SCIP_CONS *cons)
 
void createVarboundConstraintsInSCIP (SCIP *scip)
 
void setBoundDisjunctionConstraint (SCIP *scip, int c, SCIP_CONS *cons)
 
void createBoundDisjunctionConstraintInSCIP (SCIP *scip)
 
void setSos1Constraint (SCIP *scip, int c, SCIP_CONS *cons, SCIP_CONS **consSOS1)
 
void createSos1ConstraintsInSCIP (SCIP *scip)
 
void setSos2Constraint (SCIP *scip, int c, SCIP_CONS *cons, SCIP_CONS **consSOS2)
 
void createSos2ConstraintsInSCIP (SCIP *scip)
 
void getActiveVariables (SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed)
 
void collectAggregatedVars (SCIP *scip, int nvars, SCIP_VAR **vars, int *nAggregatedVars, SCIP_VAR ***aggregatedVars, SCIP_HASHTABLE **varAggregated)
 
void setAggregatedConstraint (SCIP *scip, int c, const char *constName, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Real lhsAndrhs)
 
void setAggregatedConstrains (SCIP *scip, int nvars, int nAggregatedVars, SCIP_VAR **aggregatedVars)
 
void createAggregatedVarsAndConstrainsInSCIP (SCIP *scip)
 
virtual const char * getFileName ()=0
 
bool addRootNodeCuts (SCIP *scip, ScipDiffParamSet *scipDiffParamSetRoot)
 
virtual const char * getFileName ()=0
 
- Protected Attributes inherited from ScipParaInstance
SCIP * orgScip
 
SCIP * paraInstanceScip
 
int lProbName
 
char * probName
 
int nCopies
 
int origObjSense
 
SCIP_Real objScale
 
SCIP_Real objOffset
 
int nVars
 
int varIndexRange
 
SCIP_Real * varLbs
 
SCIP_Real * varUbs
 
SCIP_Real * objCoefs
 
int * varTypes
 
size_t lVarNames
 
char * varNames
 
int * posVarNames
 
int * mapToOriginalIndecies
 
int * mapToSolverLocalIndecies
 
int nConss
 
int lConsNames
 
char * consNames
 
int * posConsNames
 
bool copyIncreasedVariables
 
int nLinearConss
 
int * idxLinearConsNames
 
SCIP_Real * linearLhss
 
SCIP_Real * linearRhss
 
int * nLinearCoefs
 
SCIP_Real ** linearCoefs
 
int ** idxLinearCoefsVars
 
int nSetppcConss
 
int * idxSetppcConsNames
 
int * nIdxSetppcVars
 
int * setppcTypes
 
int ** idxSetppcVars
 
int nLogicorConss
 
int * idxLogicorConsNames
 
int * nIdxLogicorVars
 
int ** idxLogicorVars
 
int nKnapsackConss
 
int * idxKnapsackConsNames
 
SCIP_Longint * capacities
 
int * nLKnapsackCoefs
 
SCIP_Longint ** knapsackCoefs
 
int ** idxKnapsackCoefsVars
 
int nVarboundConss
 
int * idxVarboundConsNames
 
SCIP_Real * varboundLhss
 
SCIP_Real * varboundRhss
 
int * idxVarboundCoefVar1s
 
SCIP_Real * varboundCoef2s
 
int * idxVarboundCoefVar2s
 
int nVarBoundDisjunctionConss
 
int * idxBoundDisjunctionConsNames
 
int * nVarsBoundDisjunction
 
int ** idxVarBoundDisjunction
 
SCIP_BOUNDTYPE ** boundTypesBoundDisjunction
 
SCIP_Real ** boundsBoundDisjunction
 
int nSos1Conss
 
int * idxSos1ConsNames
 
int * nSos1Coefs
 
SCIP_Real ** sos1Coefs
 
int ** idxSos1CoefsVars
 
int nSos2Conss
 
int * idxSos2ConsNames
 
int * nSos2Coefs
 
SCIP_Real ** sos2Coefs
 
int ** idxSos2CoefsVars
 
int nAggregatedConss
 
int lAggregatedVarNames
 
char * aggregatedVarNames
 
int * posAggregatedVarNames
 
int lAggregatedConsNames
 
char * aggregatedConsNames
 
int * posAggregatedConsNames
 
SCIP_Real * aggregatedLhsAndLhss
 
int * nAggregatedCoefs
 
SCIP_Real ** aggregatedCoefs
 
int ** idxAggregatedCoefsVars
 
ScipUserPluginsuserPlugins
 
SCIP * scip
 

Detailed Description

ScipInstanceTh

Definition at line 382 of file scipParaInstanceTh.h.

Constructor & Destructor Documentation

◆ ScipParaInstanceTh() [1/2]

constructor

Definition at line 391 of file scipParaInstanceTh.h.

◆ ScipParaInstanceTh() [2/2]

ScipParaInstanceTh ( SCIP *  inScip,
int  method 
)

constructor : only called from ScipInitiator

Definition at line 578 of file scipParaInstanceTh.cpp.

References PRESOLVED_INSTANCE, and ScipParaInstance::scip.

◆ ~ScipParaInstanceTh()

destractor

Definition at line 403 of file scipParaInstanceTh.h.

Member Function Documentation

◆ bcast()

int bcast ( UG::ParaComm comm,
int  rank,
int  method 
)
virtual

broadcasts instance to all solvers

mapToOriginalIndecies = new int[n]; mapToOriginalIndecies = new int[SCIPgetNTotalVars(tempScip)]; // need to allocate enough for SCIPvarGetIndex(copyvar) for( int i = 0; i < SCIPgetNTotalVars(tempScip); i++ ) { mapToOriginalIndecies[i] = -1; } SCIP_VAR **tempVars = SCIPgetVars(tempScip); for( int i = 0; i < n; i++ ) { mapToOriginalIndecies[i] = SCIPvarGetIndex(tempVars[i]); mapToOriginalIndecies[SCIPvarGetIndex(tempVars[i])] = i; }

SCIP_CALL_ABORT( SCIPtransformProb(scip)); orgScip = scip; nVars = n; varIndexRange = SCIPgetNTotalVars(tempScip); scip = tempScip;

if( SCIPgetNConss(scip) > 0 ) { SCIPhashmapFree(&conssmap); } if( SCIPgetNVars(scip) > 0 ) { SCIPhashmapFree(&varmap); } SCIP_CALL_ABORT( SCIPtransformProb(scip)); std::cout << "** ParaScipInstance is copied twice. **" << std::endl;

Implements ParaInstance.

Definition at line 161 of file scipParaInstanceTh.cpp.

References comm, ScipParaInstance::copyIncreasedVariables, ScipParaInstance::copyScipEnvironment(), cv, cv_m, DEF_PARA_COMM, ScipParaInstance::mapToOriginalIndecies, ScipParaInstance::mapToSolverLocalIndecies, nInitSolvers, ScipParaInstance::nVars, PARA_COMM_CALL, UG::ParaBYTE, UG::ParaInstanceType, ScipParaInstance::scip, UG::TagParaInstance, and ScipParaInstance::varIndexRange.

◆ getFileName()

const char * getFileName ( )
privatevirtual

Implements ScipParaInstance.

Definition at line 384 of file scipParaInstanceTh.h.

◆ setFileName()

void setFileName ( const char *  file)
virtual

Implements ScipParaInstance.

Definition at line 411 of file scipParaInstanceTh.h.