Gecode::Support::DynamicStack< T > Class Template Reference
[Support algorithms and datastructures]
#include <dynamic-stack.hh>
Detailed Description
template<class T>
class Gecode::Support::DynamicStack< T >
Stack with arbitrary number of elements.
Requires
#include "gecode/support/dynamic-stack.hh"
Definition at line 36 of file dynamic-stack.hh.
Public Member Functions | |
| DynamicStack (int n=64) | |
| Initialize stack with n elements. | |
| ~DynamicStack (void) | |
| Release memory. | |
| bool | empty (void) const |
| Test whether stack is empty. | |
| T | pop (void) |
| Pop topmost element from stack and return it. | |
| T & | top (void) |
| Return top of stack. | |
| void | push (T) |
| Push element on stack. | |
| int | entries (void) const |
| Return number of entries currently on stack. | |
| T & | operator[] (int i) |
| Return entry at position i. | |
| const T & | operator[] (int i) const |
| Return entry at position i. | |
| size_t | size (void) const |
| Return size of stack. | |
Constructor & Destructor Documentation
|
||||||||||
|
Initialize stack with n elements.
Definition at line 94 of file dynamic-stack.hh. |
|
||||||||||
|
Release memory.
Definition at line 99 of file dynamic-stack.hh. |
Member Function Documentation
|
||||||||||
|
Test whether stack is empty.
Definition at line 125 of file dynamic-stack.hh. |
|
||||||||||
|
Pop topmost element from stack and return it.
Definition at line 105 of file dynamic-stack.hh. |
|
||||||||||
|
Return top of stack.
Definition at line 111 of file dynamic-stack.hh. |
|
||||||||||
|
Push element on stack.
Definition at line 117 of file dynamic-stack.hh. |
|
||||||||||
|
Return number of entries currently on stack.
Definition at line 131 of file dynamic-stack.hh. |
|
||||||||||
|
Return entry at position i.
Position 0 corresponds to the element first pushed, whereas position Definition at line 137 of file dynamic-stack.hh. |
|
||||||||||
|
Return entry at position i.
Position 0 corresponds to the element first pushed, whereas position Definition at line 143 of file dynamic-stack.hh. |
|
||||||||||
|
Return size of stack.
Definition at line 149 of file dynamic-stack.hh. |
The documentation for this class was generated from the following file:
- gecode/support/dynamic-stack.hh (Revision: 3514)
