Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v9-minor'
Browse files Browse the repository at this point in the history
  • Loading branch information
scip-ci committed Apr 8, 2024
2 parents e4d2ae5 + 2da8884 commit e4b587f
Show file tree
Hide file tree
Showing 25 changed files with 638 additions and 705 deletions.
2 changes: 1 addition & 1 deletion src/scip/benders.c
Original file line number Diff line number Diff line change
Expand Up @@ -4756,7 +4756,7 @@ SCIP_RETCODE resetOrigSubproblemParams(
/** returns NLP solver parameters used for solving NLP subproblems */
SCIP_NLPPARAM SCIPbendersGetNLPParam(
SCIP_BENDERS* benders /**< Benders' decomposition */
)
)
{
assert(benders != NULL);

Expand Down
17 changes: 9 additions & 8 deletions src/scip/branch_gomory.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ SCIP_Bool getGMIFromRow(
assert( SCIPisFeasZero(scip, rowact - rowlhs) );
*cutrhs -= cutelem * (rowlhs - SCIProwGetConstant(row));
}

}
}

Expand Down Expand Up @@ -406,6 +405,8 @@ SCIP_DECL_BRANCHEXECLP(branchExeclpGomory)
int lppos;
int ninds;
int bestcand;
int i;
int j;

name = (char *) "test";

Expand Down Expand Up @@ -471,12 +472,12 @@ SCIP_DECL_BRANCHEXECLP(branchExeclpGomory)
SCIP_CALL( SCIPallocBufferArray(scip, &inds, nrows) );

/* Create basis indices mapping (from the column position to LP tableau rox index) */
for( int i = 0; i < ncols; ++i )
for( i = 0; i < ncols; ++i )
{
basicvarpos2tableaurow[i] = -1;
}
SCIP_CALL( SCIPgetLPBasisInd(scip, basisind) );
for( int i = 0; i < nrows; ++i )
for( i = 0; i < nrows; ++i )
{
if( basisind[i] >= 0 )
basicvarpos2tableaurow[basisind[i]] = i;
Expand All @@ -488,8 +489,8 @@ SCIP_DECL_BRANCHEXECLP(branchExeclpGomory)
ninds = -1;

/* Iterate over candidates and get best cut score */
for( int i = 0; i < maxncands; i++ ) {

for( i = 0; i < maxncands; i++ )
{
/* Initialise the score of the cut */
score = 0;

Expand All @@ -514,7 +515,7 @@ SCIP_DECL_BRANCHEXECLP(branchExeclpGomory)
cut = NULL;
SCIP_CALL( SCIPcreateEmptyRowUnspec(scip, &cut, name, -SCIPinfinity(scip), cutrhs, TRUE,
FALSE, TRUE) );
for( int j = 0; j < ncols; ++j )
for( j = 0; j < ncols; ++j )
{
if( !SCIPisZero(scip, cutcoefs[j]) )
{
Expand Down Expand Up @@ -566,7 +567,7 @@ SCIP_DECL_BRANCHEXECLP(branchExeclpGomory)
/** creates the Gomory cut branching rule and includes it in SCIP */
SCIP_RETCODE SCIPincludeBranchruleGomory(
SCIP* scip /**< SCIP data structure */
)
)
{
SCIP_BRANCHRULEDATA* branchruledata;
SCIP_BRANCHRULE* branchrule;
Expand All @@ -576,7 +577,7 @@ SCIP_RETCODE SCIPincludeBranchruleGomory(

/* include branching rule */
SCIP_CALL( SCIPincludeBranchruleBasic(scip, &branchrule, BRANCHRULE_NAME, BRANCHRULE_DESC, BRANCHRULE_PRIORITY,
BRANCHRULE_MAXDEPTH, BRANCHRULE_MAXBOUNDDIST, branchruledata) );
BRANCHRULE_MAXDEPTH, BRANCHRULE_MAXBOUNDDIST, branchruledata) );

assert(branchrule != NULL);

Expand Down
30 changes: 15 additions & 15 deletions src/scip/cutsel_dynamic.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#define DEFAULT_MINGAIN 0.01 /**< minimal efficacy gain for a cut to enter the LP */
#define DEFAULT_MAXDEPTH (-1) /**< maximum depth at which this cutselector is used (-1 : all nodes) */
#define DEFAULT_FILTERMODE 'd' /**< filtering strategy during cut selection (
* 'd'ynamic- and 'f'ull dynamic parallelism) */
* 'd'ynamic- and 'f'ull dynamic parallelism) */


/*
Expand Down Expand Up @@ -224,7 +224,7 @@ SCIP_RETCODE computeProjectionScore(
SCIP* scip, /**< SCIP data structure */
SCIP_ROW* bestcut, /**< cut to filter orthogonality with */
SCIP_ROW* cut, /**< cut to perform scoring on */
SCIP_Real* score /**< score for cut */
SCIP_Real* score /**< score for cut */
)
{
SCIP_Real efficacy;
Expand Down Expand Up @@ -255,9 +255,9 @@ SCIP_RETCODE computeProjectionScore(
/** move the cut with the highest score to the first position in the array; there must be at least one cut */
static
void selectBestCut(
SCIP_ROW** cuts, /**< array with cuts to perform selection algorithm */
SCIP_Real* scores, /**< array with scores of cuts to perform selection algorithm */
int ncuts /**< number of cuts in given array */
SCIP_ROW** cuts, /**< array with cuts to perform selection algorithm */
SCIP_Real* scores, /**< array with scores of cuts to perform selection algorithm */
int ncuts /**< number of cuts in given array */
)
{
int i;
Expand Down Expand Up @@ -324,14 +324,14 @@ int filterWithDynamicParallelism(
cosine = SCIProwGetParallelism(bestcut, cuts[i], 's');
thisparall = cosine * bestcutefficacy / currentcutefficacy;
SCIPdebugMsg(scip, "Thisparall(%g) = cosine(%g) * (bestcutefficacy(%g)/ currentcutefficacy(%g))\n\n", thisparall,
cosine, bestcutefficacy, currentcutefficacy);
cosine, bestcutefficacy, currentcutefficacy);
}
else
{
cosine = SCIProwGetParallelism(cuts[i], bestcut, 's');
thisparall = cosine * currentcutefficacy / bestcutefficacy;
SCIPdebugMsg(scip, "Thisparall(%g) = cosine(%g) * (currentcutefficacy(%g) / bestcutefficacy(%g))\n\n", thisparall,
cosine, currentcutefficacy, bestcutefficacy);
cosine, currentcutefficacy, bestcutefficacy);
}

/* compute the max-minimum angle for given the given cuts to enforce
Expand Down Expand Up @@ -423,7 +423,8 @@ SCIP_DECL_CUTSELEXIT(cutselExitDynamic)

/** cut selection method of cut selector */
static
SCIP_DECL_CUTSELSELECT(cutselSelectDynamic) { /*lint --e{715}*/
SCIP_DECL_CUTSELSELECT(cutselSelectDynamic)
{ /*lint --e{715}*/
SCIP_CUTSELDATA *cutseldata;

assert(cutsel != NULL);
Expand All @@ -439,10 +440,10 @@ SCIP_DECL_CUTSELSELECT(cutselSelectDynamic) { /*lint --e{715}*/
return SCIP_OKAY;
}

SCIP_CALL( SCIPselectCutsDynamic( scip, cuts, forcedcuts, cutseldata->randnumgen, cutseldata->filtermode,
cutseldata->mingain, 1-cutseldata->minortho, cutseldata->dircutoffdistweight, cutseldata->efficacyweight,
cutseldata->objparalweight, cutseldata->intsupportweight, ncuts, nforcedcuts,
maxnselectedcuts, nselectedcuts) );
SCIP_CALL( SCIPselectCutsDynamic(scip, cuts, forcedcuts, cutseldata->randnumgen, cutseldata->filtermode,
cutseldata->mingain, 1-cutseldata->minortho, cutseldata->dircutoffdistweight, cutseldata->efficacyweight,
cutseldata->objparalweight, cutseldata->intsupportweight, ncuts, nforcedcuts,
maxnselectedcuts, nselectedcuts) );

return SCIP_OKAY;
}
Expand All @@ -464,8 +465,7 @@ SCIP_RETCODE SCIPincludeCutselDynamic(
SCIP_CALL( SCIPallocBlockMemory(scip, &cutseldata) );
BMSclearMemory(cutseldata);

SCIP_CALL( SCIPincludeCutselBasic(scip, &cutsel, CUTSEL_NAME, CUTSEL_DESC, CUTSEL_PRIORITY, cutselSelectDynamic,
cutseldata) );
SCIP_CALL( SCIPincludeCutselBasic(scip, &cutsel, CUTSEL_NAME, CUTSEL_DESC, CUTSEL_PRIORITY, cutselSelectDynamic, cutseldata) );

assert(cutsel != NULL);

Expand Down Expand Up @@ -552,7 +552,7 @@ SCIP_RETCODE SCIPselectCutsDynamic(
int ncuts, /**< number of cuts in cuts array */
int nforcedcuts, /**< number of forced cuts */
int maxselectedcuts, /**< maximal number of cuts from cuts array to select */
int* nselectedcuts /**< pointer to return number of selected cuts from cuts array */
int* nselectedcuts /**< pointer to return number of selected cuts from cuts array */
)
{
SCIP_ROW* selectedcut;
Expand Down
32 changes: 16 additions & 16 deletions src/scip/cutsel_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,23 @@ SCIP_RETCODE SCIPincludeCutselDynamic(
*/
SCIP_EXPORT
SCIP_RETCODE SCIPselectCutsDynamic(
SCIP* scip, /**< SCIP data structure */
SCIP_ROW** cuts, /**< array with cuts to perform selection algorithm */
SCIP_ROW** forcedcuts, /**< array with forced cuts */
SCIP_RANDNUMGEN* randnumgen, /**< random number generator for tie-breaking, or NULL */
char filtermode, /**< filtering strategy during cut selection (
SCIP* scip, /**< SCIP data structure */
SCIP_ROW** cuts, /**< array with cuts to perform selection algorithm */
SCIP_ROW** forcedcuts, /**< array with forced cuts */
SCIP_RANDNUMGEN* randnumgen, /**< random number generator for tie-breaking, or NULL */
char filtermode, /**< filtering strategy during cut selection (
* 'd'ynamic- and 'f'ull dynamic parallelism) */
SCIP_Real mingain, /**< minimum efficacy gain in percentage to filter cuts */
SCIP_Real maxparall, /**< maximal parallelism for all cuts that are not good */
SCIP_Real dircutoffdistweight,/**< weight of directed cutoff distance in cut score calculation */
SCIP_Real efficacyweight, /**< weight of efficacy in cut score calculation */
SCIP_Real objparalweight, /**< weight of objective parallelism in cut score calculation */
SCIP_Real intsupportweight, /**< weight of integral support in cut score calculation */
int ncuts, /**< number of cuts in cuts array */
int nforcedcuts, /**< number of forced cuts */
int maxselectedcuts, /**< maximal number of cuts from cuts array to select */
int* nselectedcuts /**< pointer to return number of selected cuts from cuts array */
);
SCIP_Real mingain, /**< minimum efficacy gain in percentage to filter cuts */
SCIP_Real maxparall, /**< maximal parallelism for all cuts that are not good */
SCIP_Real dircutoffdistweight, /**< weight of directed cutoff distance in cut score calculation */
SCIP_Real efficacyweight, /**< weight of efficacy in cut score calculation */
SCIP_Real objparalweight, /**< weight of objective parallelism in cut score calculation */
SCIP_Real intsupportweight, /**< weight of integral support in cut score calculation */
int ncuts, /**< number of cuts in cuts array */
int nforcedcuts, /**< number of forced cuts */
int maxselectedcuts, /**< maximal number of cuts from cuts array to select */
int* nselectedcuts /**< pointer to return number of selected cuts from cuts array */
);

/** @} */

Expand Down
Loading

0 comments on commit e4b587f

Please sign in to comment.