@@ -3876,7 +3876,7 @@ SCIP_RETCODE copyConsPseudoboolean(
3876
3876
assert (SCIPconsGetHdlr (targetlincons ) != NULL );
3877
3877
/* @note due to copying special linear constraints, now leads only to simple linear constraints, we check that
3878
3878
* our target constraint handler is the same as our source constraint handler of the linear constraint,
3879
- * if not copying was not valid
3879
+ * if copying was not valid
3880
3880
*/
3881
3881
if ( strcmp (SCIPconshdlrGetName (SCIPconsGetHdlr (targetlincons )), "linear" ) == 0 )
3882
3882
targetlinconstype = SCIP_LINEARCONSTYPE_LINEAR ;
@@ -3977,13 +3977,6 @@ SCIP_RETCODE copyConsPseudoboolean(
3977
3977
assert (ntargetandconss <= ntargetlinvars );
3978
3978
}
3979
3979
3980
- /* no correct pseudoboolean constraint */
3981
- if ( ntargetandconss == 0 )
3982
- {
3983
- SCIPdebugMsg (sourcescip , "no and-constraints copied for pseudoboolean constraint <%s>\n" , SCIPconsGetName (sourcecons ));
3984
- * valid = FALSE;
3985
- }
3986
-
3987
3980
if ( * valid )
3988
3981
{
3989
3982
SCIP_Real targetrhs ;
@@ -4027,6 +4020,7 @@ SCIP_RETCODE copyConsPseudoboolean(
4027
4020
/* create new pseudoboolean constraint */
4028
4021
/* coverity[var_deref_op] */
4029
4022
/* coverity[var_deref_model] */
4023
+ /* Note that due to compression the and constraints might have disappeared in which case ntargetandconss == 0. */
4030
4024
SCIP_CALL ( SCIPcreateConsPseudobooleanWithConss (targetscip , targetcons , consname ,
4031
4025
targetlincons , targetlinconstype , targetandconss , targetandcoefs , ntargetandconss ,
4032
4026
indvar , sourceconsdata -> weight , sourceconsdata -> issoftcons , intvar , targetlhs , targetrhs ,
@@ -9369,9 +9363,7 @@ SCIP_RETCODE SCIPcreateConsPseudobooleanWithConss(
9369
9363
assert (cons != NULL );
9370
9364
assert (lincons != NULL );
9371
9365
assert (linconstype > SCIP_LINEARCONSTYPE_INVALIDCONS );
9372
- assert (andconss != NULL );
9373
- assert (andcoefs != NULL );
9374
- assert (nandconss >= 1 );
9366
+ assert (nandconss == 0 || (andconss != NULL && andcoefs != NULL ));
9375
9367
assert (issoftcons == (indvar != NULL ));
9376
9368
9377
9369
if ( intvar != NULL )
0 commit comments