File tree Expand file tree Collapse file tree 4 files changed +24
-0
lines changed Expand file tree Collapse file tree 4 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -3360,6 +3360,10 @@ SCIP_RETCODE SCIPcreateConsBounddisjunction(
3360
3360
for ( v1 = 0 ; v1 < nvars ; v1 ++ )
3361
3361
{
3362
3362
int v2 ;
3363
+
3364
+ /* check that the bounds are sensible, i.e., not nan or inf */
3365
+ assert ( SCIPisFinite (bounds [v1 ]) );
3366
+
3363
3367
for ( v2 = v1 + 1 ; v2 < nvars ; v2 ++ )
3364
3368
{
3365
3369
assert (vars [v1 ] != vars [v2 ] || (SCIPboundtypeOpposite (boundtypes [v1 ]) == boundtypes [v2 ]
Original file line number Diff line number Diff line change @@ -3647,6 +3647,15 @@ SCIP_RETCODE SCIPcreateConsCardinality(
3647
3647
3648
3648
modifiable = FALSE;
3649
3649
3650
+ #ifndef NDEBUG
3651
+ /* Check that the weights are sensible (not nan or inf); although not strictly needed, such values are likely a mistake. */
3652
+ if ( nvars > 0 && weights != NULL )
3653
+ {
3654
+ for (v = 0 ; v < nvars ; ++ v )
3655
+ assert ( SCIPisFinite (weights [v ]) );
3656
+ }
3657
+ #endif
3658
+
3650
3659
/* find the cardinality constraint handler */
3651
3660
conshdlr = SCIPfindConshdlr (scip , CONSHDLR_NAME );
3652
3661
if ( conshdlr == NULL )
Original file line number Diff line number Diff line change @@ -17897,8 +17897,14 @@ SCIP_RETCODE SCIPcreateConsLinear(
17897
17897
return SCIP_PLUGINNOTFOUND;
17898
17898
}
17899
17899
17900
+ /* check that the given lhs/rhs are sensible, i.e., not nan or inf */
17901
+ assert( SCIPisFinite(lhs) );
17902
+ assert( SCIPisFinite(rhs) );
17903
+
17900
17904
for( j = 0; j < nvars; ++j )
17901
17905
{
17906
+ /* check that the given coefficients are sensible, i.e., not nan or inf */
17907
+ assert( SCIPisFinite(vals[j]) );
17902
17908
if( SCIPisInfinity(scip, REALABS(vals[j])) )
17903
17909
{
17904
17910
SCIPerrorMessage("coefficient of variable <%s> is infinite.\n", SCIPvarGetName(vars[j]));
Original file line number Diff line number Diff line change @@ -5421,6 +5421,11 @@ SCIP_RETCODE SCIPcreateConsVarbound(
5421
5421
SCIP_CONSHDLRDATA * conshdlrdata ;
5422
5422
SCIP_CONSDATA * consdata ;
5423
5423
5424
+ /* check that the given parameters are sensible, i.e., not nan or inf */
5425
+ assert ( SCIPisFinite (vbdcoef ) );
5426
+ assert ( SCIPisFinite (lhs ) );
5427
+ assert ( SCIPisFinite (rhs ) );
5428
+
5424
5429
/* find the variable bound constraint handler */
5425
5430
conshdlr = SCIPfindConshdlr (scip , CONSHDLR_NAME );
5426
5431
if ( conshdlr == NULL )
You can’t perform that action at this time.
0 commit comments