PPL
1.2
|
A const iterator on the tree elements, ordered by key. More...
#include <CO_Tree_defs.hh>
Public Types | |
typedef std::bidirectional_iterator_tag | iterator_category |
typedef const data_type | value_type |
typedef std::ptrdiff_t | difference_type |
typedef value_type * | pointer |
typedef data_type_const_reference | reference |
Public Member Functions | |
const_iterator () | |
Constructs an invalid const_iterator. More... | |
const_iterator (const CO_Tree &tree) | |
Constructs an iterator pointing to the first element of the tree. More... | |
const_iterator (const CO_Tree &tree, dimension_type i) | |
Constructs a const_iterator pointing to the i-th node of the tree. More... | |
const_iterator (const const_iterator &itr) | |
The copy constructor. More... | |
const_iterator (const iterator &itr) | |
Converts an iterator into a const_iterator. More... | |
void | m_swap (const_iterator &itr) |
Swaps itr with *this. More... | |
const_iterator & | operator= (const const_iterator &itr) |
Assigns itr to *this . More... | |
const_iterator & | operator= (const iterator &itr) |
Assigns itr to *this . More... | |
const_iterator & | operator++ () |
Navigates to the next element. More... | |
const_iterator & | operator-- () |
Navigates to the previous element. More... | |
const_iterator | operator++ (int) |
Navigates to the next element. More... | |
const_iterator | operator-- (int) |
Navigates to the previous 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 const_iterator &x) const |
Compares *this with x . More... | |
bool | operator!= (const 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... | |
const data_type * | current_data |
A pointer to the corresponding element of the tree's data[] array. More... | |
Friends | |
dimension_type | CO_Tree::dfs_index (const_iterator itr) const |
Related Functions | |
(Note that these are not member functions.) | |
void | swap (CO_Tree::const_iterator &x, CO_Tree::const_iterator &y) |
Swaps x with y . More... | |
A const 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 157 of file CO_Tree_defs.hh.
typedef std::ptrdiff_t Parma_Polyhedra_Library::CO_Tree::const_iterator::difference_type |
Definition at line 163 of file CO_Tree_defs.hh.
typedef std::bidirectional_iterator_tag Parma_Polyhedra_Library::CO_Tree::const_iterator::iterator_category |
Definition at line 161 of file CO_Tree_defs.hh.
Definition at line 164 of file CO_Tree_defs.hh.
Definition at line 165 of file CO_Tree_defs.hh.
Definition at line 162 of file CO_Tree_defs.hh.
|
inlineexplicit |
Constructs an invalid const_iterator.
This constructor takes time.
Definition at line 359 of file CO_Tree_inlines.hh.
References OK().
|
inlineexplicit |
Constructs an iterator pointing to the first element of the tree.
tree | The tree that the new iterator will point to. |
This constructor takes time.
Definition at line 368 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 a const_iterator pointing to the i-th node of the tree.
tree | The tree that the new iterator will point to. |
i | The index of the element in tree to which the iterator will point to. |
The i-th node must be a node with a value or end().
This constructor takes time.
Definition at line 383 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.
|
inline |
The copy constructor.
itr | The iterator that will be copied. |
This constructor takes time.
Definition at line 396 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::OK().
|
inline |
Converts an iterator into a const_iterator.
itr | The iterator that will be converted into a const_iterator. |
This constructor takes time.
Definition at line 402 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 498 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::OK().
Referenced by Parma_Polyhedra_Library::PIP_Tree_Node::add_constraint(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::all_zeroes(), Parma_Polyhedra_Library::Sparse_Row::combine(), Parma_Polyhedra_Library::Sparse_Row::combine_needs_first(), Parma_Polyhedra_Library::MIP_Problem::erase_artificials(), Parma_Polyhedra_Library::Sparse_Row::find(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::first_nonzero(), Parma_Polyhedra_Library::PIP_Solution_Node::generate_cut(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::has_a_free_dimension_helper(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::have_a_common_variable(), Parma_Polyhedra_Library::Dense_Row::init(), Parma_Polyhedra_Library::PIP_Solution_Node::Tableau::is_better_pivot(), Parma_Polyhedra_Library::Linear_Expression_Impl< Row >::last_nonzero(), Parma_Polyhedra_Library::Sparse_Row::linear_combine(), Parma_Polyhedra_Library::Sparse_Row::lower_bound(), Parma_Polyhedra_Library::MIP_Problem::OK(), Parma_Polyhedra_Library::Sparse_Row::OK(), Parma_Polyhedra_Library::Dense_Row::operator=(), Parma_Polyhedra_Library::Sparse_Row::operator==(), Parma_Polyhedra_Library::operator==(), Parma_Polyhedra_Library::MIP_Problem::process_pending_constraints(), Parma_Polyhedra_Library::MIP_Problem::steepest_edge_exact_entering_index(), Parma_Polyhedra_Library::MIP_Problem::steepest_edge_float_entering_index(), Parma_Polyhedra_Library::CO_Tree::structure_OK(), Parma_Polyhedra_Library::MIP_Problem::textbook_entering_index(), and Parma_Polyhedra_Library::PIP_Solution_Node::update_solution().
|
inline |
Swaps itr with *this.
itr | The iterator that will be swapped with *this. |
This method takes time.
Definition at line 408 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 1317 of file CO_Tree.cc.
Referenced by const_iterator(), and m_swap().
|
inline |
Compares *this
with x .
x | The iterator that will be compared with *this. |
Definition at line 517 of file CO_Tree_inlines.hh.
|
inline |
Returns the current element.
Definition at line 487 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::OK().
|
inline |
Navigates to the next element.
This method takes time.
Definition at line 442 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.
This method takes time.
Definition at line 473 of file CO_Tree_inlines.hh.
|
inline |
Navigates to the previous element.
This method takes time.
Definition at line 459 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.
This method takes time.
Definition at line 480 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 420 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 431 of file CO_Tree_inlines.hh.
References Parma_Polyhedra_Library::CO_Tree::iterator::current_data, Parma_Polyhedra_Library::CO_Tree::iterator::current_index, and Parma_Polyhedra_Library::CO_Tree::OK().
|
inline |
Compares *this
with x .
x | The iterator that will be compared with *this. |
Definition at line 509 of file CO_Tree_inlines.hh.
References current_data, current_index, and Parma_Polyhedra_Library::CO_Tree::OK().
|
friend |
|
related |
|
private |
A pointer to the corresponding element of the tree's data[] array.
Definition at line 297 of file CO_Tree_defs.hh.
Referenced by const_iterator(), m_swap(), operator=(), and operator==().
|
private |
A pointer to the corresponding element of the tree's indexes[] array.
Definition at line 294 of file CO_Tree_defs.hh.
Referenced by const_iterator(), Parma_Polyhedra_Library::CO_Tree::dfs_index(), m_swap(), operator=(), and operator==().