diff --git a/CHANGELOG b/CHANGELOG index d98010a828..8ea00ace96 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -87,7 +87,7 @@ Interface changes - SCIPincludeObjConshdlr(), SCIPincludeConshdlr(), SCIPconshdlrCreate() receive two more arguments for the conshdlr callbacks CONSGETPERMSYMGRAPH and CONSGETSIGNEDPERMSYMGRAPH - removed SYM_VARTYPE, SYM_OPTYPE, SYM_CONSTTYPE, SYM_RHSTYPE, SYM_MATRIXDATA -- new parameter issigend for SCIPcomputeOrbitsSym() +- new parameter issigned for SCIPcomputeOrbitsSym() - new parameter symtype for SCIPcomputeComponentsSym() - new parameter symtype and permvardomaincenter for SCIPlexicographicReductionAddPermutation() - replaced parameters matrixdata and exprdata of SYMcomputeSymmetryGenerators() by graph @@ -133,12 +133,12 @@ Interface changes - SCIPsetConshdlrGetPermsymGraph() and SCIPsetConshdlrGetSignedPermsymGraph() to set the (signed) permutation symmetry detection graph of a constraint - SCIPconshdlrSupportsPermsymDetection() and SCIPconshdlrSupportsSignedPermsymDetection() to access whether a conshdlr supports detection of (signed) permutation symmetries - new API functions for creating and manipulating a symmetry detection graph: SCIPcreateSymgraph(), SCIPfreeSymgraph(), SCIPcopySymgraph(), SCIPextendPermsymDetectionGraphLinear(), - SCIPaddSymgraphVarAggegration(), SCIPaddSymgraphOpnode(), SCIPaddSymgraphValnode(), SCIPaddSymgraphConsnode(), SCIPgetSymgraphVarnodeidx(), SCIPgetSymgraphNegatedVarnodeidx(), + SCIPaddSymgraphVarAggregation(), SCIPaddSymgraphOpnode(), SCIPaddSymgraphValnode(), SCIPaddSymgraphConsnode(), SCIPgetSymgraphVarnodeidx(), SCIPgetSymgraphNegatedVarnodeidx(), SCIPupdateSymgraphLhs(), SCIPupdateSymgraphRhs(), SCIPfixSymgraphVarnode(), SCIPaddSymgraphEdge(), SCIPcomputeSymgraphColors(), SCIPgetSymgraphSymtype(), SCIPgetSymgraphVars(), SCIPgetSymgraphNVars(), SCIPgetSymgraphNConsnodes(), SCIPgetSymgraphNNodes(), SCIPgetSymgraphNEdges(), SCIPgetSymgraphEdgeFirst(), SCIPgetSymgraphEdgeSecond(), SCIPgetSymgraphVarnodeColor(), SCIPgetSymgraphNodeType(), SCIPgetSymgraphNodeColor(), SCIPisSymgraphEdgeColored(), SCIPgetSymgraphEdgeColor(), SCIPgetSymgraphNVarcolors(), SCIPhasGraphUniqueEdgetype(), SCIPallocateSymgraphConsnodeperm(), SCIPcreateSymgraphConsnodeperm(), SCIPgetSymgraphConsnodeperm(), SCIPfreeSymgraphConsnodeperm(), - SCIPgetActiveVariables(), SCIPfreeSymDataExpr(), SCIPgetSymExprdataNConstants(), SCIPgetSymExprdataConstants(), SCIPgetCoefSymData(), + SCIPgetSymActiveVariables(), SCIPfreeSymDataExpr(), SCIPgetSymExprdataNConstants(), SCIPgetSymExprdataConstants(), SCIPgetCoefSymData(), SCIPcreateSymOpNodeType(), SCIPgetSymOpNodeType() - SCIPexprhdlrSetGetSymdata(), SCIPexprhdlrHasGetSymData(), SCIPgetSymDataExpr(), SCIPcallExprGetSymData() to access symmetry data of expressions - SYMcheckGraphsAreIdentical() to check whether two symmetry detection graphs are identical @@ -148,7 +148,7 @@ Interface changes - new member SYM_NODETYPE_CONS in SYM_NODETYPE enum - new members SYM_CONSOPTYPE_SUM, SYM_CONSOPTYPE_SLACK, SYM_CONSOPTYPE_COEF, SYM_CONSOPTYPE_RHS, SYM_CONSOPTYPE_LAST in SYM_CONSOPTYPE enum - new defintion SCIP_DECL_EXPRGETSYMDATA -- new functions SCIPdetectSingleOrDoubleLexMatrices() and tryHandleDoubleLexMatrices() +- new function SCIPdetectSingleOrDoubleLexMatrices() ### Command line interface diff --git a/src/scip/cons_and.c b/src/scip/cons_and.c index 5077ad531a..ee90a68f9e 100644 --- a/src/scip/cons_and.c +++ b/src/scip/cons_and.c @@ -3830,7 +3830,7 @@ SCIP_RETCODE addSymmetryInformation( vals[nlocvars++] = 2.0; assert(nlocvars <= nvars); - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); SCIP_CALL( SCIPextendPermsymDetectionGraphLinear(scip, graph, vars, vals, nlocvars, cons, constant, constant, success) ); diff --git a/src/scip/cons_bounddisjunction.c b/src/scip/cons_bounddisjunction.c index f966c7f509..19d9f9c252 100644 --- a/src/scip/cons_bounddisjunction.c +++ b/src/scip/cons_bounddisjunction.c @@ -2013,7 +2013,8 @@ SCIP_RETCODE addSymmetryInformation( nlocvars = 1; constant = 0.0; - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, + SCIPisTransformed(scip)) ); /* add node and edge for bound on literal (bound adapted by constant) */ bound = consdata->boundtypes[i] == SCIP_BOUNDTYPE_UPPER ? consdata->bounds[i] : -consdata->bounds[i]; @@ -2032,7 +2033,7 @@ SCIP_RETCODE addSymmetryInformation( } /* add nodes and edges for variables in aggregation (ignore constant, has been treated above) */ - SCIP_CALL( SCIPaddSymgraphVarAggegration(scip, graph, nodeidx, vars, vals, nlocvars, 0.0) ); + SCIP_CALL( SCIPaddSymgraphVarAggregation(scip, graph, nodeidx, vars, vals, nlocvars, 0.0) ); } SCIPfreeBufferArray(scip, &vals); diff --git a/src/scip/cons_cardinality.c b/src/scip/cons_cardinality.c index 3a86a27f60..0bbc05cf45 100644 --- a/src/scip/cons_cardinality.c +++ b/src/scip/cons_cardinality.c @@ -3182,7 +3182,7 @@ SCIP_DECL_CONSGETPERMSYMGRAPH(consGetPermsymGraphCardinality) nlocvars = 1; constant = 0.0; - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_PERM, &vars, &vals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_PERM, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); /* check whether variable is (multi-)aggregated or negated */ @@ -3196,7 +3196,7 @@ SCIP_DECL_CONSGETPERMSYMGRAPH(consGetPermsymGraphCardinality) SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, pairnodeidx, nodeidx, FALSE, 0.0) ); /* add nodes and edges for variables in aggregation */ - SCIP_CALL( SCIPaddSymgraphVarAggegration(scip, graph, nodeidx, vars, vals, nlocvars, constant) ); + SCIP_CALL( SCIPaddSymgraphVarAggregation(scip, graph, nodeidx, vars, vals, nlocvars, constant) ); } else if( nlocvars == 1 ) { @@ -3211,7 +3211,7 @@ SCIP_DECL_CONSGETPERMSYMGRAPH(consGetPermsymGraphCardinality) nlocvars = 1; constant = 0.0; - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_PERM, &vars, &vals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_PERM, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); /* check whether variable is (multi-)aggregated or negated */ @@ -3225,7 +3225,7 @@ SCIP_DECL_CONSGETPERMSYMGRAPH(consGetPermsymGraphCardinality) SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, pairnodeidx, nodeidx, FALSE, 0.0) ); /* add nodes and edges for variables in aggregation */ - SCIP_CALL( SCIPaddSymgraphVarAggegration(scip, graph, nodeidx, vars, vals, nlocvars, constant) ); + SCIP_CALL( SCIPaddSymgraphVarAggregation(scip, graph, nodeidx, vars, vals, nlocvars, constant) ); } else if( nlocvars == 1 ) { @@ -3285,7 +3285,7 @@ SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(consGetSignedPermsymGraphCardinality) /* use SYM_SYMTYPE_PERM here to NOT center variable domains at 0, as the latter might not preserve * cardinality constraints */ - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_PERM, &vars, &vals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_PERM, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); /* check whether variable is (multi-) aggregated or negated */ @@ -3303,7 +3303,7 @@ SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(consGetSignedPermsymGraphCardinality) /* add nodes and edges for variables in aggregation, do not add edges to negated variables * since this might not necessarily be a symmetry of the cardinality constraint; therefore, - * do not use SCIPaddSymgraphVarAggegration() */ + * do not use SCIPaddSymgraphVarAggregation() */ for( j = 0; j < nlocvars; ++j ) { nodeidx = SCIPgetSymgraphVarnodeidx(scip, graph, vars[j]); @@ -3350,7 +3350,7 @@ SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(consGetSignedPermsymGraphCardinality) nlocvars = 1; constant = 0.0; - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_PERM, &vars, &vals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_PERM, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); /* check whether variable is (multi-)aggregated or negated */ @@ -3364,7 +3364,7 @@ SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(consGetSignedPermsymGraphCardinality) SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, pairnodeidx, nodeidx, FALSE, 0.0) ); /* add nodes and edges for variables in aggregation */ - SCIP_CALL( SCIPaddSymgraphVarAggegration(scip, graph, nodeidx, vars, vals, nlocvars, constant) ); + SCIP_CALL( SCIPaddSymgraphVarAggregation(scip, graph, nodeidx, vars, vals, nlocvars, constant) ); } else if( nlocvars == 1 ) { diff --git a/src/scip/cons_indicator.c b/src/scip/cons_indicator.c index 112fb42f84..a431b9d645 100644 --- a/src/scip/cons_indicator.c +++ b/src/scip/cons_indicator.c @@ -524,7 +524,7 @@ SCIP_RETCODE addSymmetryInformation( nlocvars = nvarslincons; constant = 0.0; - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); /* update lhs/rhs due to possible variable aggregation */ lhs -= constant; @@ -536,7 +536,7 @@ SCIP_RETCODE addSymmetryInformation( SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, consnodeidx, opnodeidx, FALSE, 0.0) ); /* add nodes/edes for variables in linear constraint */ - SCIP_CALL( SCIPaddSymgraphVarAggegration(scip, graph, opnodeidx, vars, vals, nlocvars, 0.0) ); + SCIP_CALL( SCIPaddSymgraphVarAggregation(scip, graph, opnodeidx, vars, vals, nlocvars, 0.0) ); /* create nodes and edges for activation of constraint */ SCIP_CALL( SCIPaddSymgraphOpnode(scip, graph, (int) SYM_CONSOPTYPE_EQ, &eqnodeidx) ); /*lint !e641*/ @@ -548,7 +548,7 @@ SCIP_RETCODE addSymmetryInformation( constant = 0.0; nlocvars = 1; - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); /* activation of a constraint is modeled as weight of the edge to the activation variable */ actweight = consdata->activeone ? 1.0 : -1.0; @@ -560,7 +560,7 @@ SCIP_RETCODE addSymmetryInformation( SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, eqnodeidx, opnodeidx, TRUE, actweight) ); /* add nodes and edges for variables in aggregation */ - SCIP_CALL( SCIPaddSymgraphVarAggegration(scip, graph, opnodeidx, vars, vals, nlocvars, constant) ); + SCIP_CALL( SCIPaddSymgraphVarAggregation(scip, graph, opnodeidx, vars, vals, nlocvars, constant) ); } else if( nlocvars == 1 ) { @@ -588,7 +588,7 @@ SCIP_RETCODE addSymmetryInformation( constant = 0.0; nlocvars = 1; - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); if( nlocvars > 1 || !SCIPisEQ(scip, vals[0], 1.0) || !SCIPisZero(scip, constant) ) { @@ -597,7 +597,7 @@ SCIP_RETCODE addSymmetryInformation( SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, slacknodeidx, opnodeidx, FALSE, 0.0) ); /* add nodes and edges for variables in aggregation */ - SCIP_CALL( SCIPaddSymgraphVarAggegration(scip, graph, opnodeidx, vars, vals, nlocvars, constant) ); + SCIP_CALL( SCIPaddSymgraphVarAggregation(scip, graph, opnodeidx, vars, vals, nlocvars, constant) ); } else if( nlocvars == 1 ) { diff --git a/src/scip/cons_knapsack.c b/src/scip/cons_knapsack.c index a65636db9b..7554a227b6 100644 --- a/src/scip/cons_knapsack.c +++ b/src/scip/cons_knapsack.c @@ -12059,7 +12059,7 @@ SCIP_RETCODE addSymmetryInformation( vals[i] = (SCIP_Real) consdata->weights[i]; } - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); rhs = (SCIP_Real) SCIPgetCapacityKnapsack(scip, cons) - constant; SCIP_CALL( SCIPextendPermsymDetectionGraphLinear(scip, graph, vars, vals, nlocvars, diff --git a/src/scip/cons_linear.c b/src/scip/cons_linear.c index 0feece73df..be5eeda484 100644 --- a/src/scip/cons_linear.c +++ b/src/scip/cons_linear.c @@ -15266,7 +15266,7 @@ SCIP_RETCODE addSymmetryInformation( vals[i] = consdata->vals[i]; } - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); lhs = consdata->lhs - constant; rhs = consdata->rhs - constant; diff --git a/src/scip/cons_linking.c b/src/scip/cons_linking.c index 8b40c2879f..166f04cb81 100644 --- a/src/scip/cons_linking.c +++ b/src/scip/cons_linking.c @@ -2056,7 +2056,7 @@ SCIP_RETCODE addSymmetryInformation( vars[consdata->nbinvars] = consdata->linkvar; vals[consdata->nbinvars] = -1.0; - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); SCIP_CALL( SCIPextendPermsymDetectionGraphLinear(scip, graph, vars, vals, nlocvars, cons, -constant, -constant, success) ); diff --git a/src/scip/cons_logicor.c b/src/scip/cons_logicor.c index b96715ae68..e5bfff07be 100644 --- a/src/scip/cons_logicor.c +++ b/src/scip/cons_logicor.c @@ -4081,7 +4081,7 @@ SCIP_RETCODE addSymmetryInformation( vals[i] = 1.0; } - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); SCIP_CALL( SCIPextendPermsymDetectionGraphLinear(scip, graph, vars, vals, nlocvars, cons, 1.0 - constant, SCIPinfinity(scip), success) ); diff --git a/src/scip/cons_nonlinear.c b/src/scip/cons_nonlinear.c index 91ced6fde6..a96ac92afe 100644 --- a/src/scip/cons_nonlinear.c +++ b/src/scip/cons_nonlinear.c @@ -9477,7 +9477,7 @@ SCIP_RETCODE tryAddGadgetBilinearProductSignedPerm( nlocvars = 1; constant = 0.0; - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_SIGNPERM, consvars, consvals, &nlocvars, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_SIGNPERM, consvars, consvals, &nlocvars, &constant, SCIPconsIsTransformed(cons)) ); if( nlocvars != 1 || !SCIPisZero(scip, constant) ) @@ -9699,7 +9699,7 @@ SCIP_RETCODE tryAddGadgetEvenOperatorVariable( nlocvars = 1; SCIP_CALL( ensureLocVarsArraySize(scip, consvars, consvals, nlocvars, maxnconsvars) ); - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_SIGNPERM, consvars, consvals, &nlocvars, &constant, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_SIGNPERM, consvars, consvals, &nlocvars, &constant, SCIPconsIsTransformed(cons)) ); /* skip multi-aggregated variables or variables with domain not centered at 0 */ @@ -9796,7 +9796,7 @@ SCIP_RETCODE tryAddGadgetEvenOperatorSum( } constant = SCIPgetConstantExprSum(child); - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_SIGNPERM, consvars, consvals, &nlocvars, &constant, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_SIGNPERM, consvars, consvals, &nlocvars, &constant, SCIPconsIsTransformed(cons)) ); /* we can only handle the case without constant and two variables with domain centered at origin */ @@ -10163,7 +10163,7 @@ SCIP_RETCODE tryAddGadgetSquaredDifference( constant = 0.0; nlocvars = 1; - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_SIGNPERM, consvars, consvals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_SIGNPERM, consvars, consvals, &nlocvars, &constant, SCIPconsIsTransformed(cons)) ); if( nlocvars != 1 ) @@ -10179,7 +10179,7 @@ SCIP_RETCODE tryAddGadgetSquaredDifference( constant2 = 0.0; nlocvars = 1; - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_SIGNPERM, consvars, consvals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_SIGNPERM, consvars, consvals, &nlocvars, &constant2, SCIPconsIsTransformed(cons)) ); if( nlocvars != 1 ) @@ -10393,7 +10393,7 @@ SCIP_RETCODE addSymmetryInformation( consvals[0] = 1.0; constant = 0.0; - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &consvars, &consvals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &consvars, &consvals, &nconsvars, &constant, SCIPconsIsTransformed(cons)) ); /* check whether variable is aggregated */ @@ -10406,7 +10406,7 @@ SCIP_RETCODE addSymmetryInformation( parentidx = thisidx; } - SCIP_CALL( SCIPaddSymgraphVarAggegration(scip, graph, parentidx, consvars, consvals, + SCIP_CALL( SCIPaddSymgraphVarAggregation(scip, graph, parentidx, consvars, consvals, nconsvars, constant) ); } else if( SCIPisExprValue(scip, expr) ) @@ -10460,7 +10460,7 @@ SCIP_RETCODE addSymmetryInformation( constant = SCIPgetConstantExprSum(expr); - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &consvars, &consvals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &consvars, &consvals, &nlocvars, &constant, SCIPconsIsTransformed(cons)) ); SCIP_CALL( SCIPgetSymOpNodeType(scip, SCIPexprhdlrGetName(SCIPexprGetHdlr(expr)), &optype) ); @@ -10469,7 +10469,7 @@ SCIP_RETCODE addSymmetryInformation( SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, parentidx, sumidx, hasparentcoef, parentcoef) ); /* add the linear part of the sum */ - SCIP_CALL( SCIPaddSymgraphVarAggegration(scip, graph, sumidx, consvars, consvals, nlocvars, constant) ); + SCIP_CALL( SCIPaddSymgraphVarAggregation(scip, graph, sumidx, consvars, consvals, nlocvars, constant) ); SCIP_CALL( ensureOpenArraySizeSymdetect(scip, &openidx, nopenidx + 1, &maxnopenidx) ); diff --git a/src/scip/cons_or.c b/src/scip/cons_or.c index f445295d28..f8b3577b4e 100644 --- a/src/scip/cons_or.c +++ b/src/scip/cons_or.c @@ -1444,7 +1444,7 @@ SCIP_RETCODE addSymmetryInformation( vals[nlocvars++] = 2.0; assert(nlocvars <= nvars); - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); /* represent the OR constraint via the gadget for linear constraints and use the constant as lhs/rhs to * distinguish different OR constraints (OR constraints do not have an intrinsic right-hand side) diff --git a/src/scip/cons_setppc.c b/src/scip/cons_setppc.c index 8811a3c26d..0e2c1d9808 100644 --- a/src/scip/cons_setppc.c +++ b/src/scip/cons_setppc.c @@ -7443,7 +7443,7 @@ SCIP_RETCODE addSymmetryInformation( vals[i] = 1.0; } - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); lhs = -SCIPinfinity(scip); rhs = SCIPinfinity(scip); diff --git a/src/scip/cons_sos1.c b/src/scip/cons_sos1.c index c0888dcce3..17f3396d5c 100644 --- a/src/scip/cons_sos1.c +++ b/src/scip/cons_sos1.c @@ -10225,7 +10225,7 @@ SCIP_DECL_CONSGETPERMSYMGRAPH(consGetPermsymGraphSOS1) nlocvars = 1; /* ignore weights of SOS1 constraint (variables are sorted according to these weights) */ - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_PERM, &locvars, &locvals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_PERM, &locvars, &locvals, &nlocvars, &constant, SCIPisTransformed(scip)) ); if( nlocvars == 1 && SCIPisZero(scip, constant) && SCIPisEQ(scip, locvals[0], 1.0) ) @@ -10237,7 +10237,7 @@ SCIP_DECL_CONSGETPERMSYMGRAPH(consGetPermsymGraphSOS1) { SCIP_CALL( SCIPaddSymgraphOpnode(scip, graph, (int) SYM_CONSOPTYPE_SUM, &nodeidx) ); /*lint !e641*/ SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, consnodeidx, nodeidx, FALSE, 0.0) ); - SCIP_CALL( SCIPaddSymgraphVarAggegration(scip, graph, nodeidx, locvars, locvals, nlocvars, constant) ); + SCIP_CALL( SCIPaddSymgraphVarAggregation(scip, graph, nodeidx, locvars, locvals, nlocvars, constant) ); } } @@ -10291,7 +10291,7 @@ SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(consGetSignedPermsymGraphSOS1) /* use SYM_SYMTYPE_PERM here to NOT center variable domains at 0, as the latter might not preserve * SOS1 constraints */ - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_PERM, &locvars, &locvals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_PERM, &locvars, &locvals, &nlocvars, &constant, SCIPisTransformed(scip)) ); if( nlocvars == 1 && SCIPisZero(scip, constant) && SCIPisEQ(scip, locvals[0], 1.0) ) @@ -10327,7 +10327,7 @@ SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(consGetSignedPermsymGraphSOS1) /* add nodes and edges for variables in aggregation, do not add edges to negated variables * since this might not necessarily be a symmetry of the SOS1 constraint; therefore, - * do not use SCIPaddSymgraphVarAggegration() */ + * do not use SCIPaddSymgraphVarAggregation() */ for( j = 0; j < nlocvars; ++j ) { nodeidx = SCIPgetSymgraphVarnodeidx(scip, graph, locvars[j]); diff --git a/src/scip/cons_sos2.c b/src/scip/cons_sos2.c index 58c721cfaf..c741aa5d0d 100644 --- a/src/scip/cons_sos2.c +++ b/src/scip/cons_sos2.c @@ -2286,7 +2286,7 @@ SCIP_DECL_CONSGETPERMSYMGRAPH(consGetPermsymGraphSOS2) nlocvars = 1; /* ignore weights of SOS2 constraint (variables are sorted according to these weights) */ - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_PERM, &locvars, &locvals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_PERM, &locvars, &locvals, &nlocvars, &constant, SCIPisTransformed(scip)) ); if( nlocvars == 1 && SCIPisZero(scip, constant) && SCIPisEQ(scip, locvals[0], 1.0) ) @@ -2298,7 +2298,7 @@ SCIP_DECL_CONSGETPERMSYMGRAPH(consGetPermsymGraphSOS2) { SCIP_CALL( SCIPaddSymgraphOpnode(scip, graph, (int) SYM_CONSOPTYPE_SUM, &nodeidx) ); /*lint !e641*/ SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, opnodeidx, nodeidx, FALSE, 0.0) ); - SCIP_CALL( SCIPaddSymgraphVarAggegration(scip, graph, nodeidx, locvars, locvals, nlocvars, constant) ); + SCIP_CALL( SCIPaddSymgraphVarAggregation(scip, graph, nodeidx, locvars, locvals, nlocvars, constant) ); } } } @@ -2360,7 +2360,7 @@ SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(consGetSignedPermsymGraphSOS2) /* use SYM_SYMTYPE_PERM here to NOT center variable domains at 0, as the latter might not preserve * SOS1 constraints */ - SCIP_CALL( SCIPgetActiveVariables(scip, SYM_SYMTYPE_PERM, &locvars, &locvals, + SCIP_CALL( SCIPgetSymActiveVariables(scip, SYM_SYMTYPE_PERM, &locvars, &locvals, &nlocvars, &constant, SCIPisTransformed(scip)) ); if( nlocvars == 1 && SCIPisZero(scip, constant) && SCIPisEQ(scip, locvals[0], 1.0) ) @@ -2396,7 +2396,7 @@ SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(consGetSignedPermsymGraphSOS2) /* add nodes and edges for variables in aggregation, do not add edges to negated variables * since this might not necessarily be a symmetry of the SOS1 constraint; therefore, - * do not use SCIPaddSymgraphVarAggegration() */ + * do not use SCIPaddSymgraphVarAggregation() */ for( k = 0; k < nlocvars; ++k ) { nodeidx = SCIPgetSymgraphVarnodeidx(scip, graph, locvars[k]); diff --git a/src/scip/cons_varbound.c b/src/scip/cons_varbound.c index 0a9f034810..cffd38a41c 100644 --- a/src/scip/cons_varbound.c +++ b/src/scip/cons_varbound.c @@ -4364,7 +4364,7 @@ SCIP_RETCODE addSymmetryInformation( vals[0] = 1.0; vals[1] = SCIPgetVbdcoefVarbound(scip, cons); - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); lhs = SCIPgetLhsVarbound(scip, cons) - constant; rhs = SCIPgetRhsVarbound(scip, cons) - constant; diff --git a/src/scip/cons_xor.c b/src/scip/cons_xor.c index 95faaf8626..87432aad2c 100644 --- a/src/scip/cons_xor.c +++ b/src/scip/cons_xor.c @@ -4803,7 +4803,7 @@ SCIP_RETCODE addSymmetryInformation( } assert(nlocvars <= nvars); - SCIP_CALL( SCIPgetActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); + SCIP_CALL( SCIPgetSymActiveVariables(scip, symtype, &vars, &vals, &nlocvars, &constant, SCIPisTransformed(scip)) ); lrhs = (SCIP_Real) SCIPgetRhsXor(scip, cons) - constant; SCIP_CALL( SCIPextendPermsymDetectionGraphLinear(scip, graph, vars, vals, nlocvars, diff --git a/src/scip/symmetry.c b/src/scip/symmetry.c index 0c6e354d1a..c5125a0a29 100644 --- a/src/scip/symmetry.c +++ b/src/scip/symmetry.c @@ -51,7 +51,7 @@ */ SCIP_RETCODE SCIPcomputeOrbitsSym( SCIP* scip, /**< SCIP instance */ - SCIP_Bool issigend, /**< whether orbits for signed permutations shall be computed */ + SCIP_Bool issigned, /**< whether orbits for signed permutations shall be computed */ SCIP_VAR** permvars, /**< variables considered in a permutation */ int npermvars, /**< length of a permutation array */ int** perms, /**< matrix containing in each row a permutation of the symmetry group */ @@ -76,7 +76,7 @@ SCIP_RETCODE SCIPcomputeOrbitsSym( assert( norbits != NULL ); permlen = npermvars; - if ( issigend ) + if ( issigned ) permlen *= 2; /* init data structures*/ @@ -2189,7 +2189,7 @@ SCIP_RETCODE SCIPdetectSingleOrDoubleLexMatrices( /** helper function to test if val1 = val2 while permitting infinity-values */ -SCIP_Bool SCIPEQ( +SCIP_Bool SCIPsymEQ( SCIP* scip, /**< SCIP data structure */ SCIP_Real val1, /**< left-hand side value */ SCIP_Real val2 /**< right-hand side value */ @@ -2223,7 +2223,7 @@ SCIP_Bool SCIPEQ( /** helper function to test if val1 <= val2 while permitting infinity-values */ -SCIP_Bool SCIPLE( +SCIP_Bool SCIPsymLE( SCIP* scip, /**< SCIP data structure */ SCIP_Real val1, /**< left-hand side value */ SCIP_Real val2 /**< right-hand side value */ @@ -2261,7 +2261,7 @@ SCIP_Bool SCIPLE( /** helper function to test if val1 >= val2 while permitting infinity-values */ -SCIP_Bool SCIPGE( +SCIP_Bool SCIPsymGE( SCIP* scip, /**< SCIP data structure */ SCIP_Real val1, /**< left-hand side value */ SCIP_Real val2 /**< right-hand side value */ @@ -2299,7 +2299,7 @@ SCIP_Bool SCIPGE( /** helper function to test if val1 < val2 while permitting infinity-values */ -SCIP_Bool SCIPLT( +SCIP_Bool SCIPsymLT( SCIP* scip, /**< SCIP data structure */ SCIP_Real val1, /**< left-hand side value */ SCIP_Real val2 /**< right-hand side value */ @@ -2337,7 +2337,7 @@ SCIP_Bool SCIPLT( /** helper function to test if val1 > val2 while permitting infinity-values */ -SCIP_Bool SCIPGT( +SCIP_Bool SCIPsymGT( SCIP* scip, /**< SCIP data structure */ SCIP_Real val1, /**< left-hand side value */ SCIP_Real val2 /**< right-hand side value */ diff --git a/src/scip/symmetry.h b/src/scip/symmetry.h index 8e6082a3c0..51267d45eb 100644 --- a/src/scip/symmetry.h +++ b/src/scip/symmetry.h @@ -64,7 +64,7 @@ extern "C" { SCIP_EXPORT SCIP_RETCODE SCIPcomputeOrbitsSym( SCIP* scip, /**< SCIP instance */ - SCIP_Bool issigend, /**< whether orbits for signed permutations shall be computed */ + SCIP_Bool issigned, /**< whether orbits for signed permutations shall be computed */ SCIP_VAR** permvars, /**< variables considered in a permutation array */ int npermvars, /**< length of a permutation array */ int** perms, /**< matrix containing in each row a permutation of the symmetry group */ @@ -284,24 +284,8 @@ SCIP_RETCODE SCIPdetectSingleOrDoubleLexMatrices( int* ncolmatrices /**< pointer to store number of single lex column matrices in rows */ ); -/** tries to handle variable matrices with lex ordered rows and columns */ -SCIP_EXPORT -SCIP_RETCODE tryHandleDoubleLexMatrices( - SCIP* scip, /**< SCIP pointer */ - SCIP_VAR** vars, /**< variables on which permutations act */ - int** perms, /**< array of permutations */ - int nperms, /**< number of permutations in perms */ - int permlen, /**< number of original (non-negated) variables in a permutation */ - SCIP_Bool issignedperm, /**< whether permutations are encoded as signed */ - SCIP_Bool* success, /**< pointer to store whether symmetries are handled */ - int cidx, /**< identifier of component to be handled by double lex matrices */ - SCIP_CONS*** genorbconss, /**< pointer to store generated orbitope constraints */ - int* ngenorbconss, /**< pointer to store number of generated orbitope constraints */ - int* genorbconsssize /**< pointer to store size genorbconss */ - ); - /** helper function to test if val1 = val2 while permitting infinity-values */ -SCIP_Bool SCIPEQ( +SCIP_Bool SCIPsymEQ( SCIP* scip, /**< SCIP data structure */ SCIP_Real val1, /**< left-hand side value */ SCIP_Real val2 /**< right-hand side value */ @@ -309,7 +293,7 @@ SCIP_Bool SCIPEQ( /** helper function to test if val1 <= val2 while permitting infinity-values */ -SCIP_Bool SCIPLE( +SCIP_Bool SCIPsymLE( SCIP* scip, /**< SCIP data structure */ SCIP_Real val1, /**< left-hand side value */ SCIP_Real val2 /**< right-hand side value */ @@ -317,7 +301,7 @@ SCIP_Bool SCIPLE( /** helper function to test if val1 >= val2 while permitting infinity-values */ -SCIP_Bool SCIPGE( +SCIP_Bool SCIPsymGE( SCIP* scip, /**< SCIP data structure */ SCIP_Real val1, /**< left-hand side value */ SCIP_Real val2 /**< right-hand side value */ @@ -325,7 +309,7 @@ SCIP_Bool SCIPGE( /** helper function to test if val1 < val2 while permitting infinity-values */ -SCIP_Bool SCIPLT( +SCIP_Bool SCIPsymLT( SCIP* scip, /**< SCIP data structure */ SCIP_Real val1, /**< left-hand side value */ SCIP_Real val2 /**< right-hand side value */ @@ -333,7 +317,7 @@ SCIP_Bool SCIPLT( /** helper function to test if val1 > val2 while permitting infinity-values */ -SCIP_Bool SCIPGT( +SCIP_Bool SCIPsymGT( SCIP* scip, /**< SCIP data structure */ SCIP_Real val1, /**< left-hand side value */ SCIP_Real val2 /**< right-hand side value */ diff --git a/src/scip/symmetry_graph.c b/src/scip/symmetry_graph.c index 66563e5c90..2cdbf6649c 100644 --- a/src/scip/symmetry_graph.c +++ b/src/scip/symmetry_graph.c @@ -291,7 +291,7 @@ SCIP_RETCODE SCIPextendPermsymDetectionGraphLinear( * For signed permutation symmetries, also edges connecting the root node and the negated variable * nodes are added, these edges are colored by the negative coefficients. */ -SCIP_RETCODE SCIPaddSymgraphVarAggegration( +SCIP_RETCODE SCIPaddSymgraphVarAggregation( SCIP* scip, /**< SCIP data structure */ SYM_GRAPH* graph, /**< symmetry detection graph */ int rootidx, /**< index of root node of the aggegration */ @@ -1694,7 +1694,7 @@ int* SCIPgetSymgraphConsnodeperm( * * @note @p constant needs to be initialized! */ -SCIP_RETCODE SCIPgetActiveVariables( +SCIP_RETCODE SCIPgetSymActiveVariables( SCIP* scip, /**< SCIP data structure */ SYM_SYMTYPE symtype, /**< type of symmetries for which variables are required */ SCIP_VAR*** vars, /**< pointer to vars array to get active variables for */ diff --git a/src/scip/symmetry_graph.h b/src/scip/symmetry_graph.h index f176561c4e..ac7522f562 100644 --- a/src/scip/symmetry_graph.h +++ b/src/scip/symmetry_graph.h @@ -111,7 +111,7 @@ SCIP_RETCODE SCIPextendPermsymDetectionGraphLinear( * nodes are added, these edges are colored by the negative coefficients. */ SCIP_EXPORT -SCIP_RETCODE SCIPaddSymgraphVarAggegration( +SCIP_RETCODE SCIPaddSymgraphVarAggregation( SCIP* scip, /**< SCIP data structure */ SYM_GRAPH* graph, /**< symmetry detection graph */ int rootidx, /**< index of root node of the aggregation */ @@ -367,7 +367,7 @@ SCIP_RETCODE SCIPfreeSymgraphConsnodeperm( * @note @p constant needs to be initialized! */ SCIP_EXPORT -SCIP_RETCODE SCIPgetActiveVariables( +SCIP_RETCODE SCIPgetSymActiveVariables( SCIP* scip, /**< SCIP data structure */ SYM_SYMTYPE symtype, /**< type of symmetries for which variables are required */ SCIP_VAR*** vars, /**< pointer to vars array to get active variables for */ diff --git a/src/scip/symmetry_lexred.c b/src/scip/symmetry_lexred.c index d1fb8e23ec..deaf46f0f4 100644 --- a/src/scip/symmetry_lexred.c +++ b/src/scip/symmetry_lexred.c @@ -1320,10 +1320,10 @@ SCIP_RETCODE propagateStaticLexred( if ( vari == varj ) { assert( lexdata->symtype == SYM_SYMTYPE_SIGNPERM ); - assert( SCIPGE(scip, lb1, lexdata->vardomaincenter[i]) ); /* propagation enforces xi - center >= center - xi */ + assert( SCIPsymGE(scip, lb1, lexdata->vardomaincenter[i]) ); /* propagation enforces xi - center >= center - xi */ /* both variables can only be the same if they are fixed to the domain center */ - if ( SCIPGT(scip, lb1, lexdata->vardomaincenter[i]) ) + if ( SCIPsymGT(scip, lb1, lexdata->vardomaincenter[i]) ) return SCIP_OKAY; SCIP_CALL( SCIPallocBufferArray(scip, &peeklbs, lexdata->nvars) ); @@ -1348,13 +1348,13 @@ SCIP_RETCODE propagateStaticLexred( if ( *infeasible ) goto FREEMEMORY; lb1 = lexdata->vardomaincenter[i] + 1.0; - assert( SCIPLE(scip, lb1, ub1) ); + assert( SCIPsymLE(scip, lb1, ub1) ); break; case SCIP_VARTYPE_CONTINUOUS: /* continuous variable type: act as if we increase the variable by a very little bit. * This is only possible if we're able to increase the variable bound by a bit. */ - if ( SCIPEQ(scip, lb1, ub1) ) + if ( SCIPsymEQ(scip, lb1, ub1) ) { *infeasible = TRUE; goto FREEMEMORY; @@ -1406,14 +1406,14 @@ SCIP_RETCODE propagateStaticLexred( } /* check whether peek is called */ - if ( (!SCIPEQ(scip, lbi, lbj)) && (!SCIPEQ(scip, ubi, ubj)) ) + if ( (!SCIPsymEQ(scip, lbi, lbj)) && (!SCIPsymEQ(scip, ubi, ubj)) ) return SCIP_OKAY; SCIP_CALL( SCIPallocBufferArray(scip, &peeklbs, lexdata->nvars) ); SCIP_CALL( SCIPallocBufferArray(scip, &peekubs, lexdata->nvars) ); SCIP_CALL( SCIPallocBufferArray(scip, &peekbdset, lexdata->nvars) ); - if ( SCIPEQ(scip, lbj, lbi) ) + if ( SCIPsymEQ(scip, lbj, lbi) ) { SCIP_Real fixvalj; @@ -1442,13 +1442,13 @@ SCIP_RETCODE propagateStaticLexred( if ( *infeasible ) goto FREEMEMORY; lb1 = lb1 + 1.0; - assert( SCIPLE(scip, lb1, ub1) ); + assert( SCIPsymLE(scip, lb1, ub1) ); break; case SCIP_VARTYPE_CONTINUOUS: /* continuous variable type: act as if we increase the variable by a very little bit. * That is only possible if we're able to increase the variable bound by a bit. */ - if ( SCIPEQ(scip, lbi, ubi) ) + if ( SCIPsymEQ(scip, lbi, ubi) ) { *infeasible = TRUE; goto FREEMEMORY; @@ -1467,8 +1467,8 @@ SCIP_RETCODE propagateStaticLexred( * Option 2: vari gets fixed to ubj. Then, we must check if feasibility is found, still. * If it turns out infeasible, then we know varj cannot take value ubj, so we can decrease the upper bound. */ - assert( SCIPGE(scip, ubi, ubj) ); /* this must be the case after reductions in the for-loop */ - if ( SCIPEQ(scip, ubi, ubj) ) + assert( SCIPsymGE(scip, ubi, ubj) ); /* this must be the case after reductions in the for-loop */ + if ( SCIPsymEQ(scip, ubi, ubj) ) { SCIP_Real fixvalj; @@ -1505,12 +1505,12 @@ SCIP_RETCODE propagateStaticLexred( if ( *infeasible ) goto FREEMEMORY; ubj = ubj - 1.0; - assert( SCIPLE(scip, lbj, ubj) ); + assert( SCIPsymLE(scip, lbj, ubj) ); break; case SCIP_VARTYPE_CONTINUOUS: /* continuous variable type: act as if we decrease the variable by a very little bit. * that is only possible if we're able to decrease the variable bound by a bit. */ - if ( SCIPEQ(scip, lbj, ubj) ) + if ( SCIPsymEQ(scip, lbj, ubj) ) { *infeasible = TRUE; goto FREEMEMORY; diff --git a/src/scip/symmetry_orbital.c b/src/scip/symmetry_orbital.c index 86977aaf14..c4fe35de28 100644 --- a/src/scip/symmetry_orbital.c +++ b/src/scip/symmetry_orbital.c @@ -251,7 +251,7 @@ SCIP_RETCODE identifyOrbitalSymmetriesBroken( if ( !orbitsymbroken ) { - if ( !SCIPEQ(scip, orbitglb, orcdata->globalvarlbs[j]) || !SCIPEQ(scip, orbitgub, orcdata->globalvarubs[j]) ) + if ( !SCIPsymEQ(scip, orbitglb, orcdata->globalvarlbs[j]) || !SCIPsymEQ(scip, orbitgub, orcdata->globalvarubs[j]) ) { orbitsymbroken = TRUE; break; @@ -393,7 +393,7 @@ SCIP_RETCODE orbitalReductionGetSymmetryStabilizerSubgroup( * a series of equalities yielding that all expressions must be the same: * \f$ub_i = lb_j <= ub_j = lb_{\cdots} <= \cdots = lb_j < ub_j \f$ */ - if ( ! SCIPEQ(scip, + if ( ! SCIPsymEQ(scip, varubs ? varubs[varid] : SCIPvarGetUbLocal(orcdata->permvars[varid]), varlbs ? varlbs[varidimage] : SCIPvarGetLbLocal(orcdata->permvars[varidimage]) ) ) @@ -419,7 +419,7 @@ SCIP_RETCODE orbitalReductionGetSymmetryStabilizerSubgroup( if ( varidimage == varid ) continue; - if ( SCIPGT(scip, + if ( SCIPsymGT(scip, varubs ? varubs[varid] : SCIPvarGetUbLocal(orcdata->permvars[varid]), varlbs ? varlbs[varidimage] : SCIPvarGetLbLocal(orcdata->permvars[varidimage]) ) ) @@ -568,20 +568,20 @@ SCIP_RETCODE applyOrbitalReductionPart( assert( orcdata->permvars[varid] != NULL ); lb = varlbs ? varlbs[varid] : SCIPvarGetLbLocal(orcdata->permvars[varid]); - if ( SCIPGT(scip, lb, orbitlb) ) + if ( SCIPsymGT(scip, lb, orbitlb) ) orbitlb = lb; ub = varubs ? varubs[varid] : SCIPvarGetUbLocal(orcdata->permvars[varid]); - if ( SCIPLT(scip, ub, orbitub) ) + if ( SCIPsymLT(scip, ub, orbitub) ) orbitub = ub; } /* if bounds are incompatible, infeasibility is detected */ - if ( SCIPGT(scip, orbitlb, orbitub) ) + if ( SCIPsymGT(scip, orbitlb, orbitub) ) { *infeasible = TRUE; return SCIP_OKAY; } - assert( SCIPLE(scip, orbitlb, orbitub) ); + assert( SCIPsymLE(scip, orbitlb, orbitub) ); /* update variable bounds to be in this range */ for (i = orbitbegin; i < orbitend; ++i) @@ -592,11 +592,11 @@ SCIP_RETCODE applyOrbitalReductionPart( if ( varlbs != NULL ) { - assert( SCIPLE(scip, varlbs[varid], orbitlb) ); + assert( SCIPsymLE(scip, varlbs[varid], orbitlb) ); varlbs[varid] = orbitlb; } if ( !SCIPisInfinity(scip, -orbitlb) && - SCIPLT(scip, SCIPvarGetLbLocal(orcdata->permvars[varid]), orbitlb) ) + SCIPsymLT(scip, SCIPvarGetLbLocal(orcdata->permvars[varid]), orbitlb) ) { SCIP_Bool tightened; SCIP_CALL( SCIPtightenVarLb(scip, orcdata->permvars[varid], orbitlb, TRUE, infeasible, &tightened) ); @@ -610,11 +610,11 @@ SCIP_RETCODE applyOrbitalReductionPart( if ( varubs != NULL ) { - assert( SCIPGE(scip, varubs[varid], orbitub) ); + assert( SCIPsymGE(scip, varubs[varid], orbitub) ); varubs[varid] = orbitub; } if ( !SCIPisInfinity(scip, orbitub) && - SCIPGT(scip, SCIPvarGetUbLocal(orcdata->permvars[varid]), orbitub) ) + SCIPsymGT(scip, SCIPvarGetUbLocal(orcdata->permvars[varid]), orbitub) ) { SCIP_Bool tightened; SCIP_CALL( SCIPtightenVarUb(scip, orcdata->permvars[varid], orbitub, TRUE, infeasible, &tightened) ); @@ -764,21 +764,21 @@ SCIP_RETCODE applyOrbitalBranchingPropagations( assert( varid >= 0 ); if ( varid < orcdata->npermvars ) { - assert( SCIPLE(scip, varlbs[varid], varubs[varid]) ); + assert( SCIPsymLE(scip, varlbs[varid], varubs[varid]) ); switch (update->boundchgtype) { case SCIP_BOUNDTYPE_LOWER: - assert( SCIPGE(scip, update->newbound, varlbs[varid]) ); + assert( SCIPsymGE(scip, update->newbound, varlbs[varid]) ); varlbs[varid] = update->newbound; break; case SCIP_BOUNDTYPE_UPPER: - assert( SCIPLE(scip, update->newbound, varubs[varid]) ); + assert( SCIPsymLE(scip, update->newbound, varubs[varid]) ); varubs[varid] = update->newbound; break; default: assert( FALSE ); } - assert( SCIPLE(scip, varlbs[varid], varubs[varid]) ); + assert( SCIPsymLE(scip, varlbs[varid], varubs[varid]) ); } } @@ -818,9 +818,9 @@ SCIP_RETCODE applyOrbitalBranchingPropagations( continue; assert( branchingdecisionvarid >= 0 && branchingdecisionvarid < orcdata->npermvars ); assert( branchingdecision->boundchgtype == SCIP_BOUNDTYPE_LOWER ? - SCIPLE(scip, varlbs[branchingdecisionvarid], branchingdecision->newbound) : - SCIPGE(scip, varubs[branchingdecisionvarid], branchingdecision->newbound) ); - assert( SCIPLE(scip, varlbs[branchingdecisionvarid], varubs[branchingdecisionvarid]) ); + SCIPsymLE(scip, varlbs[branchingdecisionvarid], branchingdecision->newbound) : + SCIPsymGE(scip, varubs[branchingdecisionvarid], branchingdecision->newbound) ); + assert( SCIPsymLE(scip, varlbs[branchingdecisionvarid], varubs[branchingdecisionvarid]) ); /* get the generating set of permutations of a subgroup of a stabilizing symmetry subgroup. * @@ -868,29 +868,29 @@ SCIP_RETCODE applyOrbitalBranchingPropagations( * * Due to the steps above, it is possible that the branching step is redundant or infeasible. */ - assert( SCIPLE(scip, varlbs[branchingdecisionvarid], varubs[branchingdecisionvarid]) ); + assert( SCIPsymLE(scip, varlbs[branchingdecisionvarid], varubs[branchingdecisionvarid]) ); switch (branchingdecision->boundchgtype) { case SCIP_BOUNDTYPE_LOWER: /* incompatible upper bound */ - if ( SCIPGT(scip, branchingdecision->newbound, varubs[branchingdecisionvarid]) ) + if ( SCIPsymGT(scip, branchingdecision->newbound, varubs[branchingdecisionvarid]) ) { *infeasible = TRUE; goto FREE; } - assert( SCIPLE(scip, varlbs[branchingdecisionvarid], branchingdecision->newbound) ); + assert( SCIPsymLE(scip, varlbs[branchingdecisionvarid], branchingdecision->newbound) ); varlbs[branchingdecisionvarid] = branchingdecision->newbound; break; case SCIP_BOUNDTYPE_UPPER: /* incompatible lower bound */ - if ( SCIPLT(scip, branchingdecision->newbound, varlbs[branchingdecisionvarid]) ) + if ( SCIPsymLT(scip, branchingdecision->newbound, varlbs[branchingdecisionvarid]) ) { *infeasible = TRUE; goto FREE; } - assert( SCIPGE(scip, varubs[branchingdecisionvarid], branchingdecision->newbound) ); + assert( SCIPsymGE(scip, varubs[branchingdecisionvarid], branchingdecision->newbound) ); varubs[branchingdecisionvarid] = branchingdecision->newbound; break; default: @@ -937,18 +937,18 @@ SCIP_RETCODE applyOrbitalBranchingPropagations( * the branching step above. After the branching step, the branching variable bounds are most restricted. */ assert( SCIPisInfinity(scip, -varlbs[branchingdecisionvarid]) - || SCIPGE(scip, varlbs[branchingdecisionvarid], varlbs[varid]) ); + || SCIPsymGE(scip, varlbs[branchingdecisionvarid], varlbs[varid]) ); assert( SCIPisInfinity(scip, varubs[branchingdecisionvarid]) - || SCIPLE(scip, varubs[branchingdecisionvarid], varubs[varid]) ); + || SCIPsymLE(scip, varubs[branchingdecisionvarid], varubs[varid]) ); /* bound changes already made could only have tightened the variable domains we are thinking about */ - assert( SCIPGE(scip, SCIPvarGetLbLocal(orcdata->permvars[varid]), varlbs[varid]) ); - assert( SCIPLE(scip, SCIPvarGetUbLocal(orcdata->permvars[varid]), varubs[varid]) ); + assert( SCIPsymGE(scip, SCIPvarGetLbLocal(orcdata->permvars[varid]), varlbs[varid]) ); + assert( SCIPsymLE(scip, SCIPvarGetUbLocal(orcdata->permvars[varid]), varubs[varid]) ); /* for branching variable x and variable y in its orbit, propagate x >= y. */ /* modify UB of y-variables */ - assert( SCIPGE(scip, varubs[varid], varubs[branchingdecisionvarid]) ); + assert( SCIPsymGE(scip, varubs[varid], varubs[branchingdecisionvarid]) ); varubs[varid] = varubs[branchingdecisionvarid]; - if ( SCIPGT(scip, SCIPvarGetUbLocal(orcdata->permvars[varid]), varubs[branchingdecisionvarid]) ) + if ( SCIPsymGT(scip, SCIPvarGetUbLocal(orcdata->permvars[varid]), varubs[branchingdecisionvarid]) ) { SCIP_Bool tightened; SCIP_CALL( SCIPtightenVarUb(scip, orcdata->permvars[varid], varubs[branchingdecisionvarid], TRUE, @@ -962,7 +962,7 @@ SCIP_RETCODE applyOrbitalBranchingPropagations( } /* because variable domains are initially the same, the LB of the x-variables does not need to be modified. */ - assert( SCIPLE(scip, varlbs[varid], varlbs[branchingdecisionvarid]) ); + assert( SCIPsymLE(scip, varlbs[varid], varlbs[branchingdecisionvarid]) ); } FREE: diff --git a/src/scip/symmetry_orbitopal.c b/src/scip/symmetry_orbitopal.c index b37926161c..973dfcf467 100644 --- a/src/scip/symmetry_orbitopal.c +++ b/src/scip/symmetry_orbitopal.c @@ -270,9 +270,9 @@ SCIP_Bool testColumnsAreSymmetricallyEquivalent( /* if variable bounds differ: columns c and origcolid are not the same */ if ( - (! SCIPEQ(scip, SCIPvarGetLbLocal(var1), SCIPvarGetLbLocal(var2))) + (! SCIPsymEQ(scip, SCIPvarGetLbLocal(var1), SCIPvarGetLbLocal(var2))) || - (! SCIPEQ(scip, SCIPvarGetUbLocal(var1), SCIPvarGetUbLocal(var2))) + (! SCIPsymEQ(scip, SCIPvarGetUbLocal(var1), SCIPvarGetUbLocal(var2))) ) return FALSE; } @@ -487,8 +487,8 @@ SCIP_RETCODE updateColumnOrderWhenBranchingOnColumn( { var1 = orbidata->vars[i * ncols + swaporigcolid]; var2 = orbidata->vars[i * ncols + origcolid]; - assert( SCIPEQ(scip, SCIPvarGetLbLocal(var1), SCIPvarGetLbLocal(var2)) ); - assert( SCIPEQ(scip, SCIPvarGetUbLocal(var1), SCIPvarGetUbLocal(var2)) ); + assert( SCIPsymEQ(scip, SCIPvarGetLbLocal(var1), SCIPvarGetLbLocal(var2)) ); + assert( SCIPsymEQ(scip, SCIPvarGetUbLocal(var1), SCIPvarGetUbLocal(var2)) ); } #endif @@ -1393,8 +1393,8 @@ void assertIsOrbitopeMatrix( idx = rowid * ncols + colid; origidx = origrowid * ncols + origcolid; var = orbidata->vars[origidx]; - assert( SCIPGE(scip, matrix[idx], SCIPvarGetLbLocal(var)) ); - assert( SCIPLE(scip, matrix[idx], SCIPvarGetUbLocal(var)) ); + assert( SCIPsymGE(scip, matrix[idx], SCIPvarGetLbLocal(var)) ); + assert( SCIPsymLE(scip, matrix[idx], SCIPvarGetUbLocal(var)) ); } } @@ -1405,9 +1405,9 @@ void assertIsOrbitopeMatrix( for (rowid = 0; rowid < nrows; ++rowid) { /* entry is >= entry to the right */ - assert( SCIPGE(scip, matrix[rowid * ncols + colid], matrix[rowid * ncols + colid + 1]) ); + assert( SCIPsymGE(scip, matrix[rowid * ncols + colid], matrix[rowid * ncols + colid + 1]) ); - if ( SCIPGT(scip, matrix[rowid * ncols + colid], matrix[rowid * ncols + colid + 1]) ) + if ( SCIPsymGT(scip, matrix[rowid * ncols + colid], matrix[rowid * ncols + colid + 1]) ) { /* critical row */ break; @@ -1420,7 +1420,7 @@ void assertIsOrbitopeMatrix( * due to the axioms x + epsilon > x + epsilon and x + epsilon > x. * Analogously, x > x - epsilon and x - epsilon > x - epsilon. */ - assert( SCIPEQ(scip, matrix[rowid * ncols + colid], matrix[rowid * ncols + colid + 1]) ); + assert( SCIPsymEQ(scip, matrix[rowid * ncols + colid], matrix[rowid * ncols + colid + 1]) ); if ( addinfinitesimals ? (infinitesimal[colid] == rowid) /* left has +epsilon term */ : (infinitesimal[colid + 1] == rowid) /* right has -epsilon term */ @@ -1625,8 +1625,8 @@ SCIP_RETCODE propagateStaticOrbitope( ub = SCIPvarGetUbLocal(var); /* compare to the value in the column right of it */ - if ( SCIPLT(scip, ub, lexminface[i + 1]) || - ( lexminepsrow[colid + 1] == rowid && SCIPEQ(scip, ub, lexminface[i + 1]) ) ) + if ( SCIPsymLT(scip, ub, lexminface[i + 1]) || + ( lexminepsrow[colid + 1] == rowid && SCIPsymEQ(scip, ub, lexminface[i + 1]) ) ) { /* value of this column can only be strictly smaller than the value in the column to its right * This may not be possible. @@ -1635,7 +1635,7 @@ SCIP_RETCODE propagateStaticOrbitope( if ( lastunfixed >= 0 ) { /* repair: return to the last row with "room", and increase the lexmin-value at that row. */ - assert( SCIPEQ(scip, lexminface[lastunfixed * ncols + colid], + assert( SCIPsymEQ(scip, lexminface[lastunfixed * ncols + colid], lexminface[lastunfixed * ncols + colid + 1]) ); othervar = orbidata->vars[getArrayEntryOrIndex(roworder, lastunfixed) * ncols + origcolid]; switch (SCIPvarGetType(othervar)) @@ -1648,11 +1648,11 @@ SCIP_RETCODE propagateStaticOrbitope( assert( SCIPisIntegral(scip, lexminface[lastunfixed * ncols + colid]) ); lexminface[lastunfixed * ncols + colid] += 1.0; assert( SCIPisIntegral(scip, lexminface[lastunfixed * ncols + colid]) ); - assert( SCIPLE(scip, lexminface[lastunfixed * ncols + colid], SCIPvarGetUbLocal(othervar)) ); + assert( SCIPsymLE(scip, lexminface[lastunfixed * ncols + colid], SCIPvarGetUbLocal(othervar)) ); break; case SCIP_VARTYPE_CONTINUOUS: /* continuous type, so add an infinitesimal value to the bound */ - assert( SCIPLE(scip, lexminface[lastunfixed * ncols + colid], SCIPvarGetUbLocal(othervar)) ); + assert( SCIPsymLE(scip, lexminface[lastunfixed * ncols + colid], SCIPvarGetUbLocal(othervar)) ); assert( lexminepsrow[colid] == -1 ); lexminepsrow[colid] = lastunfixed; break; @@ -1675,18 +1675,18 @@ SCIP_RETCODE propagateStaticOrbitope( } else { - assert( SCIPGE(scip, ub, lexminface[i + 1]) ); + assert( SCIPsymGE(scip, ub, lexminface[i + 1]) ); lb = SCIPvarGetLbLocal(var); - assert( SCIPLE(scip, lb, ub) ); + assert( SCIPsymLE(scip, lb, ub) ); lexminface[i] = MAX(lexminface[i + 1], lb); - assert( SCIPGE(scip, lexminface[i], lexminface[i + 1]) ); + assert( SCIPsymGE(scip, lexminface[i], lexminface[i + 1]) ); /* are we still equal? */ - if ( SCIPGT(scip, lexminface[i], lexminface[i + 1]) ) + if ( SCIPsymGT(scip, lexminface[i], lexminface[i + 1]) ) iseq = FALSE; else if ( lexminepsrow[colid + 1] == rowid ) { - assert( SCIPEQ(scip, lexminface[i], lexminface[i + 1]) ); + assert( SCIPsymEQ(scip, lexminface[i], lexminface[i + 1]) ); assert( SCIPvarGetType(orbidata->vars[getArrayEntryOrIndex(roworder, rowid) * ncols + origcolid]) == SCIP_VARTYPE_CONTINUOUS ); assert( SCIPvarGetType(var) == SCIP_VARTYPE_CONTINUOUS ); @@ -1709,14 +1709,14 @@ SCIP_RETCODE propagateStaticOrbitope( /* @todo @question Are variable bounds for SCIP_VARTYPE_IMPLINT always integral? */ /* @todo in principle, this can be made more tight using the hole-lists... */ assert( SCIPisIntegral(scip, lexminface[i]) ); - if ( SCIPLE(scip, lexminface[i] + 1.0, ub) ) + if ( SCIPsymLE(scip, lexminface[i] + 1.0, ub) ) lastunfixed = rowid; break; case SCIP_VARTYPE_CONTINUOUS: /* continuous type: if we can add an infinitesimal value to the current lexminface[i] value, * mark row as 'lastunfixed' */ - if ( SCIPLT(scip, lexminface[i], ub) ) + if ( SCIPsymLT(scip, lexminface[i], ub) ) lastunfixed = rowid; break; default: @@ -1793,8 +1793,8 @@ SCIP_RETCODE propagateStaticOrbitope( lb = SCIPvarGetLbLocal(var); /* compare to the value in the column left of it */ - if ( SCIPGT(scip, lb, lexmaxface[i - 1]) || - ( lexmaxepsrow[colid - 1] == rowid && SCIPEQ(scip, lb, lexmaxface[i - 1]) ) ) + if ( SCIPsymGT(scip, lb, lexmaxface[i - 1]) || + ( lexmaxepsrow[colid - 1] == rowid && SCIPsymEQ(scip, lb, lexmaxface[i - 1]) ) ) { /* value of this column can only be strictly larger than the value in the column to its left * This may not be possible. @@ -1803,7 +1803,7 @@ SCIP_RETCODE propagateStaticOrbitope( if ( lastunfixed >= 0 ) { /* repair: return to the last row with "room", and decrease the lexmax-value at that row. */ - assert( SCIPEQ(scip, lexmaxface[lastunfixed * ncols + colid], + assert( SCIPsymEQ(scip, lexmaxface[lastunfixed * ncols + colid], lexmaxface[lastunfixed * ncols + colid - 1]) ); othervar = orbidata->vars[getArrayEntryOrIndex(roworder, lastunfixed) * ncols + origcolid]; switch (SCIPvarGetType(othervar)) @@ -1816,13 +1816,13 @@ SCIP_RETCODE propagateStaticOrbitope( assert( SCIPisIntegral(scip, lexmaxface[lastunfixed * ncols + colid]) ); lexmaxface[lastunfixed * ncols + colid] -= 1.0; assert( SCIPisIntegral(scip, lexmaxface[lastunfixed * ncols + colid]) ); - assert( SCIPGE(scip, lexmaxface[lastunfixed * ncols + colid], SCIPvarGetLbLocal(othervar)) ); - assert( SCIPLE(scip, lexmaxface[lastunfixed * ncols + colid], SCIPvarGetUbLocal(othervar)) ); + assert( SCIPsymGE(scip, lexmaxface[lastunfixed * ncols + colid], SCIPvarGetLbLocal(othervar)) ); + assert( SCIPsymLE(scip, lexmaxface[lastunfixed * ncols + colid], SCIPvarGetUbLocal(othervar)) ); break; case SCIP_VARTYPE_CONTINUOUS: /* continuous type, so subtract an infinitesimal value to the bound */ - assert( SCIPGE(scip, lexmaxface[lastunfixed * ncols + colid], SCIPvarGetLbLocal(othervar)) ); - assert( SCIPLE(scip, lexmaxface[lastunfixed * ncols + colid], SCIPvarGetUbLocal(othervar)) ); + assert( SCIPsymGE(scip, lexmaxface[lastunfixed * ncols + colid], SCIPvarGetLbLocal(othervar)) ); + assert( SCIPsymLE(scip, lexmaxface[lastunfixed * ncols + colid], SCIPvarGetUbLocal(othervar)) ); assert( lexmaxepsrow[colid] == -1 ); lexmaxepsrow[colid] = lastunfixed; break; @@ -1845,18 +1845,18 @@ SCIP_RETCODE propagateStaticOrbitope( } else { - assert( SCIPLE(scip, lb, lexmaxface[i - 1]) ); + assert( SCIPsymLE(scip, lb, lexmaxface[i - 1]) ); ub = SCIPvarGetUbLocal(var); - assert( SCIPLE(scip, lb, ub) ); + assert( SCIPsymLE(scip, lb, ub) ); lexmaxface[i] = MIN(lexmaxface[i - 1], ub); - assert( SCIPGE(scip, lexmaxface[i - 1], lexmaxface[i]) ); + assert( SCIPsymGE(scip, lexmaxface[i - 1], lexmaxface[i]) ); /* are we still equal? */ - if ( SCIPGT(scip, lexmaxface[i - 1], lexmaxface[i]) ) + if ( SCIPsymGT(scip, lexmaxface[i - 1], lexmaxface[i]) ) iseq = FALSE; else if ( lexmaxepsrow[colid - 1] == rowid ) { - assert( SCIPEQ(scip, lexmaxface[i - 1], lexmaxface[i]) ); + assert( SCIPsymEQ(scip, lexmaxface[i - 1], lexmaxface[i]) ); assert( SCIPvarGetType(orbidata->vars[getArrayEntryOrIndex(roworder, rowid) * ncols + origcolid]) == SCIP_VARTYPE_CONTINUOUS ); assert( SCIPvarGetType(var) == SCIP_VARTYPE_CONTINUOUS ); @@ -1879,14 +1879,14 @@ SCIP_RETCODE propagateStaticOrbitope( /* @todo @question Are variable bounds for SCIP_VARTYPE_IMPLINT always integral? */ /* @todo in principle, this can be made more tight using the hole-lists... */ assert( SCIPisIntegral(scip, lexmaxface[i]) ); - if ( SCIPGE(scip, lexmaxface[i] - 1.0, lb) ) + if ( SCIPsymGE(scip, lexmaxface[i] - 1.0, lb) ) lastunfixed = rowid; break; case SCIP_VARTYPE_CONTINUOUS: /* continuous type: if we can subtract an infinitesimal value to the current lexmaxface[i] value, * mark row as 'lastunfixed' */ - if ( SCIPGT(scip, lexmaxface[i], lb) ) + if ( SCIPsymGT(scip, lexmaxface[i], lb) ) lastunfixed = rowid; break; default: @@ -1928,7 +1928,7 @@ SCIP_RETCODE propagateStaticOrbitope( origidx = origrowid * ncols + origcolid; var = orbidata->vars[origidx]; - if ( SCIPEQ(scip, lexminface[i], lexmaxface[i]) ) + if ( SCIPsymEQ(scip, lexminface[i], lexmaxface[i]) ) { /* tighten LB and UB to same value (i.e. fixing) */ SCIP_CALL( SCIPtightenVarLb(scip, var, lexminface[i], FALSE, infeasible, &success) );