Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions changelog.in
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ Rank: minor
Fix MSVC compilation of matrix slice conversion operators by fully
qualifying their dependent return types.

[ENTRY]
Module: kernel
What: bug
Rank: minor
Issue: 62
Thanks: k0stjap
[DESCRIPTION]
Dispose the random view selector used by random variable branching so
its random generator handle is released when the brancher is discarded.

[ENTRY]
Module: float
What: bug
Expand Down
14 changes: 14 additions & 0 deletions gecode/kernel/branch/view-sel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ namespace Gecode {
//@{
/// Create copy during cloning
virtual ViewSel<View>* copy(Space& home);
/// Whether dispose must always be called (that is, notice is needed)
virtual bool notice(void) const;
/// Delete view selection
virtual void dispose(Space& home);
//@}
};

Expand Down Expand Up @@ -539,6 +543,16 @@ namespace Gecode {
ViewSelRnd<View>::copy(Space& home) {
return new (home) ViewSelRnd<View>(home,*this);
}
template<class View>
forceinline bool
ViewSelRnd<View>::notice(void) const {
return true;
}
template<class View>
forceinline void
ViewSelRnd<View>::dispose(Space&) {
r.~Rnd();
}


template<class Val>
Expand Down