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 329 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). | |
template<class DescType> | |
const BranchingDesc * | nextDesc (EngineCtrl &s, int &alt, int &closedDescs) |
Generate path for next node and return BranchingDesc for next node if its type is DescType, or NULL otherwise. | |
template<class DescType, bool inclusive> | |
void | closeBranch (EngineCtrl &s) |
Generate path for next node with BranchingDesc type DescType. | |
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] |
const BranchingDesc * Gecode::Search::ReCoStack::nextDesc | ( | EngineCtrl & | s, | |
int & | alt, | |||
int & | closedDescs | |||
) | [inline] |
Generate path for next node and return BranchingDesc for next node if its type is DescType, or NULL otherwise.
Definition at line 101 of file reco-stack.icc.
void Gecode::Search::ReCoStack::closeBranch | ( | EngineCtrl & | s | ) | [inline] |
Generate path for next node with BranchingDesc type DescType.
Definition at line 119 of file reco-stack.icc.
bool Gecode::Search::ReCoStack::next | ( | EngineCtrl & | s | ) | [inline] |
Generate path for next node and return whether a next node exists.
Definition at line 134 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 148 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 189 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: 7310)
- gecode/search/reco-stack.icc (Revision: 7658)