Generated on Mon Aug 25 11:35:53 2008 for Gecode by doxygen 1.5.6

Gecode::Search::ReCoStack Class Reference

#include <search.hh>

List of all members.


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 BranchingDescpush (Space *s, Space *c)
 Push space c (a clone of s or NULL).
template<class DescType>
const BranchingDescnextDesc (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>
Spacerecompute (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]

Initialize with adaptive recomputation distance a_d.

Definition at line 90 of file reco-stack.icc.


Member Function Documentation

const BranchingDesc * Gecode::Search::ReCoStack::push ( Space s,
Space c 
) [inline]

Push space c (a clone of s or NULL).

Definition at line 93 of file reco-stack.icc.

template<class DescType>
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.

template<class DescType, bool inclusive>
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]

Return position on stack of last copy.

Definition at line 154 of file reco-stack.icc.

void Gecode::Search::ReCoStack::unwind ( int  l  )  [inline]

Unwind the stack up to position l (after failure).

Definition at line 173 of file reco-stack.icc.

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.

template<bool constrained>
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]

Return number of entries on stack.

Definition at line 163 of file reco-stack.icc.

size_t Gecode::Search::ReCoStack::stacksize ( void   )  const [inline]

Return stack size used.

Definition at line 168 of file reco-stack.icc.

void Gecode::Search::ReCoStack::reset ( void   )  [inline]

Reset stack.

Definition at line 182 of file reco-stack.icc.


The documentation for this class was generated from the following files: