Loading...
Searching...
No Matches
dec_varclass.cpp
Go to the documentation of this file.
35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
56#define DEC_FREQCALLROUND 1 /**< frequency the detector gets called in detection loop ,ie it is called in round r if and only if minCallRound <= r <= maxCallRound AND (r - minCallRound) mod freqCallRound == 0 */
59#define DEC_FREQCALLROUNDORIGINAL 1 /**< frequency the detector gets called in detection loop while detecting the original problem */
60#define DEC_MAXCALLROUNDORIGINAL INT_MAX /**< last round the detector gets called while detecting the original problem */
61#define DEC_MINCALLROUNDORIGINAL 0 /**< first round the detector gets called while detecting the original problem */
68#define DEC_USEFULRECALL FALSE /**< is it useful to call this detector on a descendant of the propagated partialdec */
116 if (partialdecdetectiondata->workonpartialdec->getNOpenconss() != partialdecdetectiondata->detprobdata->getNConss() || partialdecdetectiondata->workonpartialdec->getNOpenvars() != partialdecdetectiondata->detprobdata->getNVars() )
132 if( partialdecdetectiondata->detprobdata->getNConss() + partialdecdetectiondata->detprobdata->getNVars() >= 50000 )
133 SCIPgetIntParam(origprob, "detection/classification/maxnclassesperpartitionforlargeprobs", &maximumnclasses);
135 SCIPgetIntParam(origprob, "detection/classification/maxnclassesperpartition", &maximumnclasses);
137 for( int classifierIndex = 0; classifierIndex < partialdecdetectiondata->detprobdata->getNVarPartitions(); ++classifierIndex )
139 gcg::VarPartition* classifier = partialdecdetectiondata->detprobdata->getVarPartition(classifierIndex);
145 std::cout << " the current varclass distribution includes " << classifier->getNClasses() << " classes but only " << maximumnclasses << " are allowed for propagatePartialdec() of var class detector" << std::endl;
168 std::vector< std::vector<int> > subsetsOfVarclasses = classifier->getAllSubsets( true, false, false, false );
177 /* fix open vars that have a) type of the current subset or b) decomp info LINKING as linking vars */
223 /* set decinfo to: varclass_<classfier_name>:<linking_class_name#1>-...-<linking_class_name#n> */
253 partialdec->setVarPartitionStatistics(partialdec->getNDetectors(), classifier, curlinkingclasses,
263 SCIP_CALL( SCIPallocMemoryArray(origprob, &(partialdecdetectiondata->newpartialdecs), foundpartialdecs.size()) );
301 modifier = ((SCIP_Real)SCIPgetNConss(origprob) + (SCIP_Real)SCIPgetNVars(origprob) ) / SET_MULTIPLEFORSIZETRANSF;
338 modifier = ( (SCIP_Real)SCIPgetNConss(origprob) + (SCIP_Real)SCIPgetNVars(origprob) ) / SET_MULTIPLEFORSIZETRANSF;
374 modifier = ( (SCIP_Real)SCIPgetNConss(origprob) + (SCIP_Real)SCIPgetNVars(origprob) ) / SET_MULTIPLEFORSIZETRANSF;
413 DEC_MINCALLROUND, DEC_FREQCALLROUNDORIGINAL, DEC_MAXCALLROUNDORIGINAL, DEC_MINCALLROUNDORIGINAL, DEC_PRIORITY, DEC_ENABLED, DEC_ENABLEDFINISHING, DEC_ENABLEDPOSTPROCESSING, DEC_SKIP, DEC_USEFULRECALL, detectordata,
414 freeVarclass, initVarclass, exitVarclass, propagatePartialdecVarclass, finishPartialdecVarclass, detectorPostprocessPartialdecVarclass, setParamAggressiveVarclass, setParamDefaultVarclass, setParamFastVarclass));
420 SCIP_CALL( SCIPaddIntParam(origprob, setstr, "maximum number of classes ", NULL, FALSE, DEFAULT_MAXIMUMNCLASSES, 1, INT_MAX, NULL, NULL ) );
class storing partialdecs and the problem matrix
class storing (potentially incomplete) decompositions
class representing a partition of a set of variables
GCG_EXPORT const char * getClassName(int classindex)
Definition class_indexpartition.cpp:201
GCG_EXPORT const char * getName()
Definition class_indexpartition.cpp:234
GCG_EXPORT int getNDetectors()
Gets the number of detectors the partialdec is propagated by.
Definition class_partialdecomp.cpp:4447
GCG_EXPORT void addDetectorChainInfo(const char *decinfo)
add information about the detector chain
Definition class_partialdecomp.cpp:482
GCG_EXPORT void fixVarToLinking(int var)
adds a variable to the linking variables
Definition class_partialdecomp.cpp:5502
GCG_EXPORT void fixVarToMaster(int var)
adds a variable to the master variables
Definition class_partialdecomp.cpp:5566
GCG_EXPORT void setVarPartitionStatistics(int detectorchainindex, VarPartition *partition, std::vector< int > &varclasseslinking, std::vector< int > &varclassesmaster)
registers statistics for a used varpartition
Definition class_partialdecomp.cpp:5419
GCG_EXPORT bool sort()
sorts the vars and conss data structures by their indices
Definition class_partialdecomp.cpp:5807
GCG_EXPORT std::vector< int > & getOpenvars()
Gets vector containing variables not assigned yet.
Definition class_partialdecomp.cpp:4564
Definition class_varpartition.h:61
GCG_EXPORT int getClassOfVar(int varindex)
Definition class_varpartition.cpp:140
GCG_EXPORT VAR_DECOMPINFO getClassDecompInfo(int classindex)
Definition class_varpartition.cpp:103
GCG_EXPORT std::vector< std::vector< int > > getAllSubsets(bool all, bool linking, bool master, bool block)
Definition class_varpartition.cpp:87
const char * GCGdetectorGetName(GCG_DETECTOR *detector)
returns the name of the provided detector
Definition cons_decomp.cpp:2084
SCIP_RETCODE GCGincludeDetector(GCG *gcg, const char *name, const char decchar, const char *description, int freqCallRound, int maxCallRound, int minCallRound, int freqCallRoundOriginal, int maxCallRoundOriginal, int minCallRoundOriginal, int priority, SCIP_Bool enabled, SCIP_Bool enabledFinishing, SCIP_Bool enabledPostprocessing, SCIP_Bool skip, SCIP_Bool usefulRecall, GCG_DETECTORDATA *detectordata, GCG_DECL_FREEDETECTOR((*freeDetector)), GCG_DECL_INITDETECTOR((*initDetector)), GCG_DECL_EXITDETECTOR((*exitDetector)), GCG_DECL_PROPAGATEPARTIALDEC((*propagatePartialdecDetector)), GCG_DECL_FINISHPARTIALDEC((*finishPartialdecDetector)), GCG_DECL_POSTPROCESSPARTIALDEC((*postprocessPartialdecDetector)), GCG_DECL_SETPARAMAGGRESSIVE((*setParamAggressiveDetector)), GCG_DECL_SETPARAMDEFAULT((*setParamDefaultDetector)),)
includes one detector
Definition cons_decomp.cpp:2547
constraint handler for structure detection
#define detectorPostprocessPartialdecVarclass
Definition dec_varclass.cpp:280
SCIP_RETCODE GCGincludeDetectorVarclass(GCG *gcg)
Definition dec_varclass.cpp:400
varclass detector
#define SCIP_MAXSTRLEN
#define SCIP_Real
#define MAX(x, y)
#define SCIP_CALL_ABORT(x)
#define TRUE
#define FALSE
GCG interface methods.
SCIP_STAGE SCIPgetStage(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
int SCIPgetNConss(SCIP *scip)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
#define SCIPallocMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_Real SCIPgetClockTime(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
#define NULL
Definition class_conspartition.cpp:44
various SCIP helper methods
Definition dec_compgreedily.cpp:75
struct SCIP_Clock SCIP_CLOCK
SCIP_VERBLEVEL_DIALOG
SCIP_DIDNOTFIND
SCIP_SUCCESS
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
SCIP_STAGE_PROBLEM