Gecode::Search::ReCoStack Class Reference
#include <search.hh>
Detailed Description
Stack of nodes supporting recomputation.Maintains the invariant that it contains the path of the node being currently explored. This is required to support recomputation, of course.
The stack supports adaptive recomputation controlled by the value of a_d: only if the recomputation distance is at least this large, an additional clone is created.
Definition at line 278 of file search.hh.
Public Member Functions | |
ReCoStack (unsigned int a_d) | |
Initialize with adaptive recomputation distance a_d. | |
const BranchingDesc * | push (Space *s, Space *c) |
Push space c (a clone of s or NULL). | |
bool | next (EngineCtrl &s) |
Generate path for next node and return whether a next node exists. | |
int | lc (Space *&s) const |
Return position on stack of last copy. | |
void | unwind (int l) |
Unwind the stack up to position l (after failure). | |
void | commit (Space *s, int i) const |
Commit space s as described by stack entry at position i. | |
template<bool constrained> | |
Space * | recompute (unsigned int &d, EngineCtrl &s) |
Recompute space according to path with copying distance d. | |
int | entries (void) const |
Return number of entries on stack. | |
size_t | stacksize (void) const |
Return stack size used. | |
void | reset (void) |
Reset stack. |
Constructor & Destructor Documentation
Gecode::Search::ReCoStack::ReCoStack | ( | unsigned int | a_d | ) | [inline] |
Member Function Documentation
const BranchingDesc * Gecode::Search::ReCoStack::push | ( | Space * | s, | |
Space * | c | |||
) | [inline] |
bool Gecode::Search::ReCoStack::next | ( | EngineCtrl & | s | ) | [inline] |
Generate path for next node and return whether a next node exists.
Definition at line 84 of file reco-stack.icc.
int Gecode::Search::ReCoStack::lc | ( | Space *& | s | ) | const [inline] |
void Gecode::Search::ReCoStack::unwind | ( | int | l | ) | [inline] |
void Gecode::Search::ReCoStack::commit | ( | Space * | s, | |
int | i | |||
) | const [inline] |
Commit space s as described by stack entry at position i.
Definition at line 98 of file reco-stack.icc.
Space * Gecode::Search::ReCoStack::recompute | ( | unsigned int & | d, | |
EngineCtrl & | s | |||
) | [inline] |
Recompute space according to path with copying distance d.
The template parameter constrained describes whether the stack might contain spaces not propagated (from constraining during branch-and-bound).
Definition at line 139 of file reco-stack.icc.
int Gecode::Search::ReCoStack::entries | ( | void | ) | const [inline] |
size_t Gecode::Search::ReCoStack::stacksize | ( | void | ) | const [inline] |
void Gecode::Search::ReCoStack::reset | ( | void | ) | [inline] |
The documentation for this class was generated from the following files:
- gecode/search.hh (Revision: 3516)
- gecode/search/reco-stack.icc (Revision: 3511)