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 Jun 4, 2024
2 parents 8706483 + a5c624e commit bf2f9e3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
26 changes: 13 additions & 13 deletions tests/src/limit/dual.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,38 +60,38 @@ Test(dual, duallimit_min, .description = "tests dual limit for minimization")
SCIP_Real duallimit;

cr_assert_not_null(scip);
SCIPsetRealParam(scip, "limits/dual", target);
SCIP_CALL( SCIPsetRealParam(scip, "limits/dual", target) );
/* turn on aggressive separators to get more limit candidates */
SCIPsetSeparating(scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE);
SCIP_CALL( SCIPsetSeparating(scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
/* turn off heuristics to oppose optimality before the limit */
SCIPsetHeuristics(scip, SCIP_PARAMSETTING_OFF, TRUE);
SCIPreadProb(scip, "../check/instances/MIP/rgn.mps", NULL);
SCIPsolve(scip);
SCIP_CALL( SCIPsetHeuristics(scip, SCIP_PARAMSETTING_OFF, TRUE) );
SCIP_CALL( SCIPreadProb(scip, "../check/instances/MIP/rgn.mps", NULL) );
SCIP_CALL( SCIPsolve(scip) );

cr_assert_eq(SCIPgetStatus(scip), SCIP_STATUS_DUALLIMIT, "SCIP terminated with status %d but should have terminated with status %d", SCIPgetStatus(scip), SCIP_STATUS_DUALLIMIT);
duallimit = SCIPgetDualbound(scip);
cr_assert_geq(duallimit, target, "Dual bound is %f but should be at least %f", duallimit, target);
SCIPgetRealParam(scip, "limits/dual", &duallimit);
SCIP_CALL( SCIPgetRealParam(scip, "limits/dual", &duallimit) );
cr_assert_eq(duallimit, target, "Dual limit is %f but should be %f", duallimit, target);
}

Test(dual, duallimit_max, .description = "tests dual limit for maximization")
{
const SCIP_Real target = 29;
const SCIP_Real target = 30;
SCIP_Real duallimit;

cr_assert_not_null(scip);
SCIPsetRealParam(scip, "limits/dual", target);
SCIP_CALL( SCIPsetRealParam(scip, "limits/dual", target) );
/* turn on aggressive separators to get more limit candidates */
SCIPsetSeparating(scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE);
SCIP_CALL( SCIPsetSeparating(scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
/* turn off heuristics to oppose optimality before the limit */
SCIPsetHeuristics(scip, SCIP_PARAMSETTING_OFF, TRUE);
SCIPreadProb(scip, "../check/instances/Symmetry/packorb_1-FullIns_3.cip", NULL);
SCIPsolve(scip);
SCIP_CALL( SCIPsetHeuristics(scip, SCIP_PARAMSETTING_OFF, TRUE) );
SCIP_CALL( SCIPreadProb(scip, "../check/instances/Symmetry/packorb_1-FullIns_3.cip", NULL) );
SCIP_CALL( SCIPsolve(scip) );

cr_assert_eq(SCIPgetStatus(scip), SCIP_STATUS_DUALLIMIT, "SCIP terminated with status %d but should have terminated with status %d", SCIPgetStatus(scip), SCIP_STATUS_DUALLIMIT);
duallimit = SCIPgetDualbound(scip);
cr_assert_leq(duallimit, target, "Dual bound is %f but should be at most %f", duallimit, target);
SCIPgetRealParam(scip, "limits/dual", &duallimit);
SCIP_CALL( SCIPgetRealParam(scip, "limits/dual", &duallimit) );
cr_assert_eq(duallimit, target, "Dual limit is %f but should be %f", duallimit, target);
}
24 changes: 12 additions & 12 deletions tests/src/limit/primal.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ Test(primal, primallimit_min, .description = "tests primal limit for minimizatio
SCIP_Real primallimit;

cr_assert_not_null(scip);
SCIPsetRealParam(scip, "limits/primal", target);
SCIP_CALL( SCIPsetRealParam(scip, "limits/primal", target) );
/* turn on aggressive heuristics to get more limit candidates */
SCIPsetHeuristics(scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE);
SCIP_CALL( SCIPsetHeuristics(scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
/* turn off separators to oppose optimality before the limit */
SCIPsetSeparating(scip, SCIP_PARAMSETTING_OFF, TRUE);
SCIPreadProb(scip, "../check/instances/MIP/rgn.mps", NULL);
SCIPsolve(scip);
SCIP_CALL( SCIPsetSeparating(scip, SCIP_PARAMSETTING_OFF, TRUE) );
SCIP_CALL( SCIPreadProb(scip, "../check/instances/MIP/rgn.mps", NULL) );
SCIP_CALL( SCIPsolve(scip) );

cr_assert_eq(SCIPgetStatus(scip), SCIP_STATUS_PRIMALLIMIT, "SCIP terminated with status %d but should have terminated with status %d", SCIPgetStatus(scip), SCIP_STATUS_PRIMALLIMIT);
primallimit = SCIPgetPrimalbound(scip);
cr_assert_leq(primallimit, target, "Primal bound is %f but should be at most %f", primallimit, target);
SCIPgetRealParam(scip, "limits/primal", &primallimit);
SCIP_CALL( SCIPgetRealParam(scip, "limits/primal", &primallimit) );
cr_assert_eq(primallimit, target, "Primal limit is %f but should be %f", primallimit, target);
}

Expand All @@ -81,17 +81,17 @@ Test(primal, primallimit_max, .description = "tests primal limit for maximizatio
SCIP_Real primallimit;

cr_assert_not_null(scip);
SCIPsetRealParam(scip, "limits/primal", target);
SCIP_CALL( SCIPsetRealParam(scip, "limits/primal", target) );
/* turn on aggressive heuristics to get more limit candidates */
SCIPsetHeuristics(scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE);
SCIP_CALL( SCIPsetHeuristics(scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
/* turn off separators to oppose optimality before the limit */
SCIPsetSeparating(scip, SCIP_PARAMSETTING_OFF, TRUE);
SCIPreadProb(scip, "../check/instances/Symmetry/packorb_1-FullIns_3.cip", NULL);
SCIPsolve(scip);
SCIP_CALL( SCIPsetSeparating(scip, SCIP_PARAMSETTING_OFF, TRUE) );
SCIP_CALL( SCIPreadProb(scip, "../check/instances/Symmetry/packorb_1-FullIns_3.cip", NULL) );
SCIP_CALL( SCIPsolve(scip) );

cr_assert_eq(SCIPgetStatus(scip), SCIP_STATUS_PRIMALLIMIT, "SCIP terminated with status %d but should have terminated with status %d", SCIPgetStatus(scip), SCIP_STATUS_PRIMALLIMIT);
primallimit = SCIPgetPrimalbound(scip);
cr_assert_geq(primallimit, target, "Primal bound is %f but should be at least %f", primallimit, target);
SCIPgetRealParam(scip, "limits/primal", &primallimit);
SCIP_CALL( SCIPgetRealParam(scip, "limits/primal", &primallimit) );
cr_assert_eq(primallimit, target, "Primal limit is %f but should be %f", primallimit, target);
}

0 comments on commit bf2f9e3

Please sign in to comment.