Loading...
Searching...
No Matches
dec_consclass.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 */
129 if( partialdecdetectiondata->detprobdata->getNConss() + partialdecdetectiondata->detprobdata->getNVars() >= 50000 )
130 SCIPgetIntParam(origprob, "detection/classification/maxnclassesperpartitionforlargeprobs", &maximumnclasses);
132 SCIPgetIntParam(origprob, "detection/classification/maxnclassesperpartition", &maximumnclasses);
134 SCIPverbMessage(origprob, SCIP_VERBLEVEL_HIGH, NULL, " in dec_consclass: there are %d different constraint classes \n ",
138 for( int classifierIndex = 0; classifierIndex < partialdecdetectiondata->detprobdata->getNConsPartitions(); ++classifierIndex )
140 gcg::ConsPartition* classifier = partialdecdetectiondata->detprobdata->getConsPartition(classifierIndex);
146 " the current consclass distribution includes %d classes but only %d are allowed for propagatePartialdec() of cons class detector\n",
151 SCIPverbMessage(origprob, SCIP_VERBLEVEL_HIGH, NULL, " the current constraint classifier \"%s\" consists of %d different classes \n ", classifier->getName(), classifier->getNClasses() );
161 std::vector< std::vector<int> > subsetsOfConsclasses = classifier->getAllSubsets( true, false, false );
170 /* fix open conss that have a) type of the current subset or b) decomp info ONLY_MASTER as master conss */
205 /* set decinfo to: consclass_<classfier_name>:<master_class_name#1>-...-<master_class_name#n> */
234 partialdec->setConsPartitionStatistics(partialdec->getNDetectors(), classifier, curmasterclasses);
246 SCIP_CALL( SCIPallocMemoryArray(origprob, &(partialdecdetectiondata->newpartialdecs), foundpartialdecs.size()) );
249 SCIPverbMessage(origprob, SCIP_VERBLEVEL_HIGH, NULL, "dec_consclass found %d new partialdecs \n", partialdecdetectiondata->nnewpartialdecs );
289 modifier = ((SCIP_Real)SCIPgetNConss(origprob) + (SCIP_Real)SCIPgetNVars(origprob) ) / SET_MULTIPLEFORSIZETRANSF;
331 modifier = ( (SCIP_Real)SCIPgetNConss(origprob) + (SCIP_Real)SCIPgetNVars(origprob) ) / SET_MULTIPLEFORSIZETRANSF;
371 modifier = ( (SCIP_Real)SCIPgetNConss(origprob) + (SCIP_Real)SCIPgetNVars(origprob) ) / SET_MULTIPLEFORSIZETRANSF;
411 DEC_MINCALLROUND, DEC_FREQCALLROUNDORIGINAL, DEC_MAXCALLROUNDORIGINAL, DEC_MINCALLROUNDORIGINAL, DEC_PRIORITY, DEC_ENABLED, DEC_ENABLEDFINISHING, DEC_ENABLEDPOSTPROCESSING, DEC_SKIP, DEC_USEFULRECALL, detectordata,
412 freeConsclass, initConsclass, exitConsclass, propagatePartialdecConsclass, finishPartialdecConsclass, detectorPostprocessPartialdecConsclass, setParamAggressiveConsclass, setParamDefaultConsclass, setParamFastConsclass));
418 SCIP_CALL( SCIPaddIntParam(origprob, setstr, "maximum number of classes ", NULL, FALSE, DEFAULT_MAXIMUMNCLASSES, 1, INT_MAX, NULL, NULL ) );
class representing a partition of a set of constraints
class storing partialdecs and the problem matrix
class storing (potentially incomplete) decompositions
Definition class_conspartition.h:60
GCG_EXPORT int getClassOfCons(int consindex)
Definition class_conspartition.cpp:133
GCG_EXPORT CONS_DECOMPINFO getClassDecompInfo(int classindex)
Definition class_conspartition.cpp:100
GCG_EXPORT std::vector< std::vector< int > > getAllSubsets(bool both, bool only_master, bool only_pricing)
Definition class_conspartition.cpp:87
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 int getNOpenconss()
Gets size of vector containing constraints not assigned yet.
Definition class_partialdecomp.cpp:4503
GCG_EXPORT void setConsPartitionStatistics(int detectorchainindex, ConsPartition *partition, std::vector< int > &consclassesmaster)
registers statistics for a used conspartition
Definition class_partialdecomp.cpp:5186
GCG_EXPORT std::vector< int > & getOpenconss()
Gets vector containing constraints not assigned yet.
Definition class_partialdecomp.cpp:4558
GCG_EXPORT std::vector< int >::const_iterator fixConsToMaster(std::vector< int >::const_iterator itr)
fixes a constraint to the master constraints
Definition class_partialdecomp.cpp:5264
GCG_EXPORT bool sort()
sorts the vars and conss data structures by their indices
Definition class_partialdecomp.cpp:5807
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
SCIP_RETCODE GCGincludeDetectorConsclass(GCG *gcg)
Definition dec_consclass.cpp:397
#define detectorPostprocessPartialdecConsclass
Definition dec_consclass.cpp:265
consclass 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,...)
static assert(heur !=NULL)
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_VERBLEVEL_HIGH
SCIP_VERBLEVEL_NORMAL
SCIP_DIDNOTFIND
SCIP_SUCCESS
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
SCIP_STAGE_PROBLEM