Skip to content

Commit 8f8864d

Browse files
committed
Merge branch 'fix_lpi_unittest_wrt_nonzero_entries' into 'v91-bugfix'
fix failing lpi unittest See merge request integer/scip!3477
2 parents fc3fd04 + 997eae3 commit 8f8864d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/src/lpi/solve.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,13 @@ SCIP_RETCODE checkData(
458458
cr_assert_float_eq(lpiobj[j], obj[j], EPS, "Violation of objective coefficient %d: %g != %g\n", j, lpiobj[j], obj[j]);
459459

460460
cr_assert( lpibeg[j] == beg[j] );
461+
462+
/* LP-solvers sometimes permute the nonzero entries per column (e.g., XPRESS with barrier) - we therefore sort them */
463+
if ( j < ncols - 1 )
464+
i = lpibeg[j+1] - lpibeg[j];
465+
else
466+
i = lpinnonz2 - lpibeg[j];
467+
SCIPsortIntReal(&lpiind[lpibeg[j]], &lpival[lpibeg[j]], i);
461468
}
462469

463470
/* compare matrix */

0 commit comments

Comments
 (0)