PPL
1.2
|
An iterator on the tree elements, ordered by key. More...
#include <CO_Tree_defs.hh>
Public Types | |
typedef std::bidirectional_iterator_tag | iterator_category |
typedef data_type | value_type |
typedef std::ptrdiff_t | difference_type |
typedef value_type * | pointer |
typedef value_type & | reference |
Public Member Functions | |
iterator () | |
Constructs an invalid iterator. More... | |
iterator (CO_Tree &tree) | |
Constructs an iterator pointing to first element of the tree. More... | |
iterator (CO_Tree &tree, dimension_type i) | |
Constructs an iterator pointing to the i-th node. More... | |
iterator (const tree_iterator &itr) | |
The constructor from a tree_iterator. More... | |
iterator (const iterator &itr) | |
The copy constructor. More... | |
void | m_swap (iterator &itr) |
Swaps itr with *this. More... | |
iterator & | operator= (const iterator &itr) |
Assigns itr to *this . More... | |
iterator & | operator= (const tree_iterator &itr) |
Assigns itr to *this . More... | |
iterator & | operator++ () |
Navigates to the next element in the tree. More... | |
iterator & | operator-- () |
Navigates to the previous element in the tree. More... | |
iterator | operator++ (int) |
Navigates to the next element in the tree. More... | |
iterator | operator-- (int) |
Navigates to the previous element in the tree. More... | |
data_type & | operator* () |
Returns the current element. More... | |
data_type_const_reference | operator* () const |
Returns the current element. More... | |
dimension_type | index () const |
Returns the index of the element pointed to by *this . More... | |
bool | operator== (const iterator &x) const |
Compares *this with x . More... | |
bool | operator!= (const iterator &x) const |
Compares *this with x . More... | |
Private Member Functions | |
bool | OK () const |
Checks the internal invariants, in debug mode only. More... | |
Private Attributes | |
const dimension_type * | current_index |
A pointer to the corresponding element of the tree's indexes[] array. More... | |
data_type * | current_data |
A pointer to the corresponding element of the tree's data[] array. More... | |
Friends | |
const_iterator & | const_iterator::operator= (const iterator &) |
dimension_type | CO_Tree::dfs_index (iterator itr) const |
Related Functions | |
(Note that these are not member functions.) | |
void | swap (CO_Tree::iterator &x, CO_Tree::iterator &y) |
Swaps x with y . More... | |
An iterator on the tree elements, ordered by key.
Iterator increment and decrement operations are time. These iterators are invalidated by operations that add or remove elements from the tree.
Definition at line 313 of file CO_Tree_defs.hh.
typedef std::ptrdiff_t Parma_Polyhedra_Library::CO_Tree::iterator::difference_type |
Definition at line 318 of file CO_Tree_defs.hh.
typedef std::bidirectional_iterator_tag Parma_Polyhedra_Library::CO_Tree::iterator::iterator_category |
Definition at line 316 of file CO_Tree_defs.hh.
Definition at line 319 of file CO_Tree_defs.hh.
Definition at line 320 of file CO_Tree_defs.hh.
Definition at line 317 of file CO_Tree_defs.hh.
|
inline |
Constructs an invalid iterator.
This constructor takes time.
Definition at line 523 of file CO_Tree_inlines.hh.
References OK().
|
inlineexplicit |
Constructs an iterator pointing to first element of the tree.
tree | The tree to which the new iterator will point to. |
This constructor takes time.
Definition at line 532 of file CO_Tree_inlines.hh.
References current_data, current_index, Parma_Polyhedra_Library::CO_Tree::empty(), OK(), and Parma_Polyhedra_Library::CO_Tree::unused_index.
|
inline |
Constructs an iterator pointing to the i-th node.
tree | The tree to which the new iterator will point to. |
i | The index of the element in tree to which the new iterator will point to. |
The i-th node must be a node with a value or end().
This constructor takes time.
Definition at line 547 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::empty(), Parma_Polyhedra_Library::CO_Tree::indexes, OK(), Parma_Polyhedra_Library::CO_Tree::reserved_size, and Parma_Polyhedra_Library::CO_Tree::unused_index.
|
inlineexplicit |
The constructor from a tree_iterator.
itr | The tree_iterator that will be converted into an iterator. |
This is meant for use by CO_Tree only. This is not private to avoid the friend declaration.
This constructor takes time.
Definition at line 559 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::OK().
|
inline |
The copy constructor.
itr | The iterator that will be copied. |
This constructor takes time.
Definition at line 565 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::OK().
|
inline |
Returns the index of the element pointed to by *this
.
*this
. Definition at line 674 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::OK().
Referenced by Parma_Polyhedra_Library::Sparse_Row::combine(), Parma_Polyhedra_Library::Sparse_Row::combine_needs_first(), Parma_Polyhedra_Library::Sparse_Row::combine_needs_second(), Parma_Polyhedra_Library::CO_Tree::erase(), Parma_Polyhedra_Library::CO_Tree::fast_shift(), Parma_Polyhedra_Library::Sparse_Row::find(), Parma_Polyhedra_Library::PIP_Solution_Node::generate_cut(), Parma_Polyhedra_Library::CO_Tree::insert(), Parma_Polyhedra_Library::Sparse_Row::linear_combine(), Parma_Polyhedra_Library::Sparse_Row::lower_bound(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::remove_space_dimensions(), Parma_Polyhedra_Library::Sparse_Row::reset(), Parma_Polyhedra_Library::MIP_Problem::second_phase(), Parma_Polyhedra_Library::PIP_Solution_Node::solve(), Parma_Polyhedra_Library::MIP_Problem::steepest_edge_float_entering_index(), and Parma_Polyhedra_Library::Sparse_Row::swap_coefficients().
|
inline |
Swaps itr with *this.
itr | The iterator that will be swapped with *this. |
This method takes time.
Definition at line 571 of file CO_Tree_inlines.hh.
References current_data, current_index, OK(), Parma_Polyhedra_Library::CO_Tree::OK(), Parma_Polyhedra_Library::swap(), and Parma_Polyhedra_Library::CO_Tree::swap().
Referenced by Parma_Polyhedra_Library::swap().
|
private |
Checks the internal invariants, in debug mode only.
Definition at line 1359 of file CO_Tree.cc.
Referenced by iterator(), and m_swap().
|
inline |
Compares *this
with x .
x | The iterator that will be compared with *this. |
Definition at line 693 of file CO_Tree_inlines.hh.
|
inline |
Returns the current element.
Definition at line 652 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::OK().
|
inline |
Returns the current element.
Definition at line 663 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::OK().
|
inline |
Navigates to the next element in the tree.
This method takes time.
Definition at line 605 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::OK(), and Parma_Polyhedra_Library::CO_Tree::unused_index.
|
inline |
Navigates to the next element in the tree.
This method takes time.
Definition at line 638 of file CO_Tree_inlines.hh.
|
inline |
Navigates to the previous element in the tree.
This method takes time.
Definition at line 623 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::OK(), and Parma_Polyhedra_Library::CO_Tree::unused_index.
|
inline |
Navigates to the previous element in the tree.
This method takes time.
Definition at line 645 of file CO_Tree_inlines.hh.
|
inline |
Assigns itr
to *this .
itr | The iterator that will be assigned into *this. |
This method takes time.
Definition at line 594 of file CO_Tree_inlines.hh.
References current_data, current_index, and Parma_Polyhedra_Library::CO_Tree::OK().
|
inline |
Assigns itr
to *this .
itr | The iterator that will be assigned into *this. |
This method takes time.
Definition at line 583 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::data, Parma_Polyhedra_Library::CO_Tree::tree_iterator::dfs_index(), Parma_Polyhedra_Library::CO_Tree::indexes, Parma_Polyhedra_Library::CO_Tree::OK(), and Parma_Polyhedra_Library::CO_Tree::tree_iterator::tree.
|
inline |
Compares *this
with x .
x | The iterator that will be compared with *this. |
Definition at line 685 of file CO_Tree_inlines.hh.
References current_data, current_index, and Parma_Polyhedra_Library::CO_Tree::OK().
|
friend |
|
friend |
|
related |
|
private |
A pointer to the corresponding element of the tree's data[] array.
Definition at line 458 of file CO_Tree_defs.hh.
Referenced by iterator(), m_swap(), Parma_Polyhedra_Library::CO_Tree::const_iterator::operator=(), operator=(), and operator==().
|
private |
A pointer to the corresponding element of the tree's indexes[] array.
Definition at line 455 of file CO_Tree_defs.hh.
Referenced by Parma_Polyhedra_Library::CO_Tree::dfs_index(), iterator(), m_swap(), Parma_Polyhedra_Library::CO_Tree::const_iterator::operator=(), operator=(), and operator==().