Skip to content

Commit 52a7635

Browse files
jamesjersvigerske
authored andcommitted
Fix two bugs in SCIPcreateConsBasicSOCNonlinear
- Do not dereference coefs if it is NULL - Fix copy & paste error, coefs -> offsets - closes #181 - fixes #182
1 parent d267eec commit 52a7635

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
Fixed bugs
77
----------
88

9+
- fixed call of SCIPcreateConsBasicSOCNonlinear() with coefs being NULL, and fixed check for offsets being finite
10+
911

1012
@section RN1000 SCIP 10.0.0
1113
***************************

src/scip/cons_nonlinear.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13006,12 +13006,12 @@ SCIP_RETCODE SCIPcreateConsBasicSOCNonlinear(
1300613006
/* check values for infinity or nan */
1300713007
for( i = 0; i < nvars; ++i )
1300813008
{
13009-
if( !SCIPisFinite(coefs[i]) || SCIPisInfinity(scip, coefs[i]) )
13009+
if( coefs != NULL && ( !SCIPisFinite(coefs[i]) || SCIPisInfinity(scip, coefs[i]) ) )
1301013010
{
1301113011
SCIPerrorMessage("Second-order cone term with infinite or nan coefficient of variable %s in nonlinear constraint %s\n", SCIPvarGetName(vars[i]), name);
1301213012
return SCIP_INVALIDDATA;
1301313013
}
13014-
if( offsets != NULL && (!SCIPisFinite(offsets[i]) || SCIPisInfinity(scip, coefs[i])) )
13014+
if( offsets != NULL && (!SCIPisFinite(offsets[i]) || SCIPisInfinity(scip, offsets[i])) )
1301513015
{
1301613016
SCIPerrorMessage("Second-order cone term with infinite or nan offset for variable %s in nonlinear constraint %s\n", SCIPvarGetName(vars[i]), name);
1301713017
return SCIP_INVALIDDATA;

0 commit comments

Comments
 (0)