@@ -118,7 +118,7 @@ struct SCIP_BranchruleData
118
118
* to that form. Specifically, non-basic variables at their lower bound are shifted so that the lower
119
119
* bound is 0 and non-basic at their upper bound are complemented. */
120
120
static
121
- SCIP_Bool getGMIFromRow (
121
+ void getGMIFromRow (
122
122
SCIP * scip , /**< SCIP data structure */
123
123
int ncols , /**< Number of columns (original variables) in the LP */
124
124
int nrows , /**< Number of rows (slack variables) in the LP */
@@ -334,8 +334,6 @@ SCIP_Bool getGMIFromRow(
334
334
}
335
335
}
336
336
}
337
-
338
- return TRUE;
339
337
}
340
338
341
339
@@ -397,7 +395,6 @@ SCIP_DECL_BRANCHEXECLP(branchExeclpGomory)
397
395
SCIP_Real cutrhs ;
398
396
SCIP_Real score ;
399
397
SCIP_Real bestscore ;
400
- SCIP_Bool success ;
401
398
int nlpcands ;
402
399
int maxncands ;
403
400
int ncols ;
@@ -506,38 +503,34 @@ SCIP_DECL_BRANCHEXECLP(branchExeclpGomory)
506
503
SCIP_CALL ( SCIPgetLPBInvARow (scip , basicvarpos2tableaurow [lppos ], binvrow , binvarow , inds , & ninds ) );
507
504
508
505
/* Compute the GMI cut */
509
- success = getGMIFromRow (scip , ncols , nrows , cols , rows , binvrow , binvarow , & lpcandssol [i ], cutcoefs ,
506
+ getGMIFromRow (scip , ncols , nrows , cols , rows , binvrow , binvarow , & lpcandssol [i ], cutcoefs ,
510
507
& cutrhs , branchruledata -> useweakercuts );
511
508
512
509
/* Calculate the weighted sum score of measures */
513
- if ( success )
510
+ cut = NULL ;
511
+ SCIP_CALL ( SCIPcreateEmptyRowUnspec (scip , & cut , name , - SCIPinfinity (scip ), cutrhs , TRUE, FALSE, TRUE) );
512
+ for ( j = 0 ; j < ncols ; ++ j )
514
513
{
515
- cut = NULL ;
516
- SCIP_CALL ( SCIPcreateEmptyRowUnspec (scip , & cut , name , - SCIPinfinity (scip ), cutrhs , TRUE,
517
- FALSE, TRUE) );
518
- for ( j = 0 ; j < ncols ; ++ j )
514
+ if ( !SCIPisZero (scip , cutcoefs [j ]) )
519
515
{
520
- if ( !SCIPisZero (scip , cutcoefs [j ]) )
521
- {
522
- SCIP_CALL ( SCIPaddVarToRow (scip , cut , SCIPcolGetVar (cols [j ]),
523
- cutcoefs [SCIPcolGetLPPos (cols [j ])]) );
524
- }
525
- }
526
- assert ( SCIPgetCutEfficacy (scip , NULL , cut ) >= - SCIPfeastol (scip ) );
527
- if ( branchruledata -> efficacyweight != 0 )
528
- score += branchruledata -> efficacyweight * SCIPgetCutEfficacy (scip , NULL , cut );
529
- if ( branchruledata -> objparallelweight != 0 )
530
- score += branchruledata -> objparallelweight * SCIPgetRowObjParallelism (scip , cut );
531
- if ( branchruledata -> intsupportweight != 0 )
532
- score += branchruledata -> intsupportweight * SCIPgetRowNumIntCols (scip , cut ) / (SCIP_Real ) SCIProwGetNNonz (cut );
533
- SCIP_CALL ( SCIPreleaseRow (scip , & cut ) );
534
-
535
- /* Replace the best cut if score is higher */
536
- if (score > bestscore ) {
537
- bestscore = score ;
538
- bestcand = i ;
516
+ SCIP_CALL ( SCIPaddVarToRow (scip , cut , SCIPcolGetVar (cols [j ]), cutcoefs [SCIPcolGetLPPos (cols [j ])]) );
539
517
}
540
518
}
519
+ assert ( SCIPgetCutEfficacy (scip , NULL , cut ) >= - SCIPfeastol (scip ) );
520
+ if ( branchruledata -> efficacyweight != 0 )
521
+ score += branchruledata -> efficacyweight * SCIPgetCutEfficacy (scip , NULL , cut );
522
+ if ( branchruledata -> objparallelweight != 0 )
523
+ score += branchruledata -> objparallelweight * SCIPgetRowObjParallelism (scip , cut );
524
+ if ( branchruledata -> intsupportweight != 0 )
525
+ score += branchruledata -> intsupportweight * SCIPgetRowNumIntCols (scip , cut ) / (SCIP_Real ) SCIProwGetNNonz (cut );
526
+ SCIP_CALL ( SCIPreleaseRow (scip , & cut ) );
527
+
528
+ /* Replace the best cut if score is higher */
529
+ if (score > bestscore )
530
+ {
531
+ bestscore = score ;
532
+ bestcand = i ;
533
+ }
541
534
}
542
535
543
536
/* Free temporary memory */
0 commit comments