misc.c
Go to the documentation of this file.
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
165 if( GCGgetDecompositionMode(scip) != DEC_DECMODE_ORIGINAL && !GCGmasterIsSolValid(masterprob, mastersol) )
180 SCIP_CALL( SCIPgetVarsData(masterprob, &mastervarsall, &nmastervarsall, NULL, NULL, NULL, NULL) );
243 SCIP_CALL( SCIPgetVarsData(masterprob, &mastervarsall, &nmastervarsall, NULL, NULL, NULL, NULL) );
330 /* we also want to take into account variables representing rays, that have a small value (between normal and feas eps),
342 /* the original variable is a linking variable: just transfer the solution value of the direct copy (this is done later) */
346 SCIPdebugMessage("Increasing value of %s by %f because of %s\n", SCIPvarGetName(origvars[j]), origvals[j] * mastervals[i], SCIPvarGetName(mastervars[i]));
355 /* variable was directly transferred to the master problem (only in linking conss or linking variable) */
364 SCIPdebugMessage("Increasing value of %s by %f because of %s\n", SCIPvarGetName(origvars[0]), origvals[0] * mastervals[i], SCIPvarGetName(mastervars[i]));
391 /* the original variable is a linking variable: just transfer the solution value of the direct copy (this is done above) */
404 SCIPdebugMessage("Increasing value of %s by %f because of %s\n", SCIPvarGetName(origpricingvars[norigpricingvars-1]), mastervals[i] * origvals[j], SCIPvarGetName(mastervars[i]));
406 SCIP_CALL( SCIPincSolVal(scip, *origsol, origpricingvars[norigpricingvars-1], mastervals[i] * origvals[j]) );
412 SCIPdebugMessage("Increasing value of %s by %f because of %s\n", SCIPvarGetName(origpricingvars[blocknrs[blocknr]]), origvals[j], SCIPvarGetName(mastervars[i]) );
442 assert(SCIPisFeasGE(masterprob, mastervals[i], 0.0) && SCIPisFeasLT(masterprob, mastervals[i], 1.0));
461 /* the original variable is a linking variable: just transfer the solution value of the direct copy (this is done above) */
475 SCIPdebugMessage("Increasing value of %s by %f because of %s\n", SCIPvarGetName(origpricingvars[norigpricingvars-1]), origvals[j] * increaseval, SCIPvarGetName(mastervars[i]) );
477 SCIP_CALL( SCIPincSolVal(scip, *origsol, origpricingvars[norigpricingvars-1], origvals[j] * increaseval) );
482 SCIPdebugMessage("Increasing value of %s by %f because of %s\n", SCIPvarGetName(origpricingvars[blocknrs[blocknr]]), origvals[j] * increaseval, SCIPvarGetName(mastervars[i]) );
483 SCIP_CALL( SCIPincSolVal(scip, *origsol, origpricingvars[blocknrs[blocknr]], origvals[j] * increaseval) );
494 /* if the value assigned to the block is equal to 1, this block is full and we take the next block */
543 /* transforms given values of the given original variables into values of the given master variables
585 /* variable belongs to no block (or is a linking variable), so it was transferred directly to the master problem,
606 if ( SCIPisFeasEQ(scip, SCIPvarGetLbGlobal(varmastervars[0]), SCIPvarGetUbGlobal(varmastervars[0])) )
617 SCIPdebugMessage("OrigVar %s [%f,%f]\n", SCIPvarGetName(origvars[i]), SCIPvarGetLbGlobal(origvars[i]),
626 /* variable belongs to exactly one block, so we have to look at all master variables and increase their values
692 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(GCGgetMasterprob(scip)), file, "\nMaster Program statistics:\n");
710 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), file, "\nOriginal Program Solution statistics:\n");
764 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), file, "\nDetection did not take place so far\n");
GCG interface methods.
SCIP_RETCODE GCGprintDecompInformation(SCIP *scip, FILE *file)
Definition: cons_decomp.cpp:2499
SCIP_RETCODE GCGprintDecompStatistics(SCIP *scip, FILE *file, DEC_DECOMP *decomp)
Definition: decomp.c:3778
Definition: struct_decomp.h:51
SCIP_RETCODE GCGconshdlrDecompPrintDetectorStatistics(SCIP *scip, FILE *file)
display statistics about detectors
Definition: cons_decomp.cpp:5711
SCIP_VAR ** GCGoriginalVarGetMastervars(SCIP_VAR *var)
Definition: gcgvar.c:587
SCIP_Bool GCGmasterIsSolValid(SCIP *scip, SCIP_SOL *mastersol)
Definition: pricer_gcg.cpp:5173
SCIP_RETCODE GCGprintPartitionInformation(SCIP *scip, FILE *file)
Definition: cons_decomp.cpp:2481
SCIP_HASHMAP * GCGmasterVarGetOrigvalmap(SCIP_VAR *var)
Definition: gcgvar.c:979
constraint handler for structure detection
SCIP_RETCODE GCGprintCompleteDetectionStatistics(SCIP *scip, FILE *file)
Definition: misc.c:755
SCIP_RETCODE GCGtransformMastersolToOrigsol(SCIP *scip, SCIP_SOL *mastersol, SCIP_SOL **origsol)
Definition: misc.c:120
SCIP_Real * GCGoriginalVarGetMastervals(SCIP_VAR *var)
Definition: gcgvar.c:605
SCIP_VAR * GCGoriginalVarGetPricingVar(SCIP_VAR *var)
Definition: gcgvar.c:216
GCG Benders' decomposition.
GCG variable pricer.
SCIP_Real GCGtransformOrigvalsToMastervals(SCIP *scip, SCIP_VAR **origvars, SCIP_Real *origvals, int norigvars, SCIP_VAR **mastervars, SCIP_Real *mastervals, int nmastervars)
Definition: misc.c:545
SCIP_VAR * GCGpricingVarGetOriginalVar(SCIP_VAR *var)
Definition: gcgvar.c:511
static SCIP_Real getGeneratorEntry(SCIP_VAR *mastervar, SCIP_VAR *origvar)
Definition: misc.c:50
void GCGpricerPrintPricingStatistics(SCIP *scip, FILE *file)
Definition: pricer_gcg.cpp:4500
GCG relaxator.
Prints information about the best decomposition.
SCIP_VAR ** GCGpricingVarGetOrigvars(SCIP_VAR *var)
Definition: gcgvar.c:1015
SCIP_SOL * GCGgetBendersRelaxationSol(SCIP *scip)
Definition: relax_gcg.c:5100
SCIP_RETCODE GCGprintCompleteDetectionTime(SCIP *givenscip, FILE *file)
Definition: cons_decomp.cpp:2468
SCIP_RETCODE GCGprintBlockcandidateInformation(SCIP *scip, FILE *file)
Definition: cons_decomp.cpp:2447
SCIP_EXPORT void GCGsortPtrPtr(void **ptrarray1, void **ptrarray2, GCG_DECL_SORTPTRCOMP((*ptrcomp)), void *userdata, int len)
public methods for GCG variables
sorting functions, adapted from SCIP's sorttpl to include userdata
SCIP_RETCODE GCGmasterPrintSimplexIters(SCIP *scip, FILE *file)
Definition: pricer_gcg.cpp:5229
SCIP_Bool GCGdetectionTookPlace(SCIP *scip, SCIP_Bool original)
Definition: cons_decomp.cpp:5897