Skip to content

Commit 4f0ff1d

Browse files
committed
Fix bug in the FlatZinc LNS that would cause a crash when the search restarted before finding the first solution
git-svn-id: file:///Users/tack/GecodeGitMigration/gecode-svn-mirror/gecode/trunk@14397 e85b7adc-8362-4630-8c63-7469d557c915
1 parent 8a4ee76 commit 4f0ff1d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

changelog.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ Date: 2015-01-20
7272
[DESCRIPTION]
7373
Yada! Yada!
7474

75+
[ENTRY]
76+
Module: flatzinc
77+
What: bug
78+
Rank: minor
79+
Thanks: H�kan Kjellerstrand
80+
[DESCRIPTION]
81+
LNS could fail when the search was restarted before finding the first solution.
82+
7583
[ENTRY]
7684
Module: search
7785
What: bug

gecode/flatzinc/flatzinc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ namespace Gecode { namespace FlatZinc {
16131613

16141614
bool
16151615
FlatZincSpace::slave(const CRI& cri) {
1616-
if (cri.restart() != 0 && _lns > 0) {
1616+
if (cri.restart() != 0 && _lns > 0 && cri.last()) {
16171617
const FlatZincSpace& last = static_cast<const FlatZincSpace&>(*cri.last());
16181618
for (unsigned int i=iv_lns.size(); i--;) {
16191619
if ((*_random)(99) <= _lns) {

0 commit comments

Comments
 (0)