Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U > Class Template Reference

A template class to derive both OR_Matrix::iterator and OR_Matrix::const_iterator. More...

List of all members.

Public Types

typedef
std::random_access_iterator_tag 
iterator_category
typedef Pseudo_Row< U > value_type
typedef long difference_type
typedef const Pseudo_Row< U > * pointer
typedef const Pseudo_Row< U > & reference

Public Member Functions

 any_row_iterator (dimension_type n_rows)
 Constructor to build past-the-end objects.
 any_row_iterator (U &base)
 Builds an iterator pointing at the beginning of an OR_Matrix whose first element is base;.
template<typename V>
 any_row_iterator (const any_row_iterator< V > &y)
 Copy-constructor allowing the construction of a const_iterator from a non-const iterator.
template<typename V>
any_row_iteratoroperator= (const any_row_iterator< V > &y)
 Assignment operator allowing the assignment of a non-const iterator to a const_iterator.
reference operator* () const
 Dereference operator.
pointer operator-> () const
 Indirect member selector.
any_row_iteratoroperator++ ()
 Prefix increment operator.
any_row_iterator operator++ (int)
 Postfix increment operator.
any_row_iteratoroperator-- ()
 Prefix decrement operator.
any_row_iterator operator-- (int)
 Postfix decrement operator.
reference operator[] (difference_type m) const
 Subscript operator.
any_row_iteratoroperator+= (difference_type m)
 Assignment-increment operator.
any_row_iteratoroperator-= (difference_type m)
 Assignment-decrement operator.
difference_type operator- (const any_row_iterator &y) const
 Returns the difference between *this and y.
any_row_iterator operator+ (difference_type m) const
 Returns the sum of *this and m.
any_row_iterator operator- (difference_type m) const
 Returns the difference of *this and m.
bool operator== (const any_row_iterator &y) const
 Returns true if and only if *this is equal to y.
bool operator!= (const any_row_iterator &y) const
 Returns true if and only if *this is different from y.
bool operator< (const any_row_iterator &y) const
 Returns true if and only if *this is less than y.
bool operator<= (const any_row_iterator &y) const
 Returns true if and only if *this is less than or equal to y.
bool operator> (const any_row_iterator &y) const
 Returns true if and only if *this is greater than y.
bool operator>= (const any_row_iterator &y) const
 Returns true if and only if *this is greater than or equal to y.
dimension_type row_size () const
dimension_type index () const

Private Attributes

Pseudo_Row< U > value
 Represents the beginning of a row.
dimension_type e
 External index.
dimension_type i
 Internal index: i = (e+1)*(e+1)/2.

Friends

class any_row_iterator


Detailed Description

template<typename T>
template<typename U>
class Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >

A template class to derive both OR_Matrix::iterator and OR_Matrix::const_iterator.

Definition at line 201 of file OR_Matrix.defs.hh.


Member Typedef Documentation

template<typename T>
template<typename U>
typedef std::random_access_iterator_tag Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::iterator_category

Definition at line 203 of file OR_Matrix.defs.hh.

template<typename T>
template<typename U>
typedef Pseudo_Row<U> Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::value_type

Definition at line 204 of file OR_Matrix.defs.hh.

template<typename T>
template<typename U>
typedef long Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::difference_type

Definition at line 205 of file OR_Matrix.defs.hh.

template<typename T>
template<typename U>
typedef const Pseudo_Row<U>* Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::pointer

Definition at line 206 of file OR_Matrix.defs.hh.

template<typename T>
template<typename U>
typedef const Pseudo_Row<U>& Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::reference

Definition at line 207 of file OR_Matrix.defs.hh.


Constructor & Destructor Documentation

template<typename T>
template<typename U>
Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::any_row_iterator ( dimension_type  n_rows  )  [inline]

Constructor to build past-the-end objects.

Definition at line 130 of file OR_Matrix.inlines.hh.

00131   : value(),
00132     e(n_rows)
00133     // Field `i' is intentionally not initialized here.
00134 {
00135 }

template<typename T>
template<typename U>
Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::any_row_iterator ( U &  base  )  [inline, explicit]

Builds an iterator pointing at the beginning of an OR_Matrix whose first element is base;.

Definition at line 140 of file OR_Matrix.inlines.hh.

00141   :  value(base
00142 #if PPL_OR_MATRIX_EXTRA_DEBUG
00143            , OR_Matrix<T>::row_size(0)
00144 #endif
00145            ),
00146      e(0),
00147      i(0) {
00148 }

template<typename T>
template<typename U>
template<typename V>
Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::any_row_iterator ( const any_row_iterator< V > &  y  )  [inline]

Copy-constructor allowing the construction of a const_iterator from a non-const iterator.

Definition at line 155 of file OR_Matrix.inlines.hh.

00156   : value(y.value),
00157     e(y.e),
00158     i(y.i) {
00159 }


Member Function Documentation

template<typename T>
template<typename U>
template<typename V>
OR_Matrix< T >::template any_row_iterator< U > & Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator= ( const any_row_iterator< V > &  y  )  [inline]

Assignment operator allowing the assignment of a non-const iterator to a const_iterator.

Definition at line 165 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e, Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::i, and Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::value.

00165                                                                        {
00166   value = y.value;
00167   e = y.e;
00168   i = y.i;
00169   return *this;
00170 }

template<typename T>
template<typename U>
OR_Matrix< T >::template any_row_iterator< U >::reference Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator* (  )  const [inline]

Dereference operator.

Definition at line 175 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::value.

00175                                                  {
00176   return value;
00177 }

template<typename T>
template<typename U>
OR_Matrix< T >::template any_row_iterator< U >::pointer Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator-> (  )  const [inline]

Indirect member selector.

Definition at line 182 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::value.

00182                                                   {
00183   return &value;
00184 }

template<typename T>
template<typename U>
OR_Matrix< T >::template any_row_iterator< U > & Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator++ (  )  [inline]

Prefix increment operator.

Definition at line 189 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e, Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::i, and Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::value.

00189                                             {
00190   ++e;
00191   dimension_type increment = e;
00192   if (e % 2) {
00193     ++increment;
00194 #if PPL_OR_MATRIX_EXTRA_DEBUG
00195     value.size_ += 2;
00196 #endif
00197   }
00198   i += increment;
00199   value.first += increment;
00200   return *this;
00201 }

template<typename T>
template<typename U>
OR_Matrix< T >::template any_row_iterator< U > Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator++ ( int   )  [inline]

Postfix increment operator.

Definition at line 206 of file OR_Matrix.inlines.hh.

00206                                                {
00207   any_row_iterator old = *this;
00208   ++(*this);
00209   return old;
00210 }

template<typename T>
template<typename U>
OR_Matrix< T >::template any_row_iterator< U > & Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator-- (  )  [inline]

Prefix decrement operator.

Definition at line 215 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e, Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::i, and Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::value.

00215                                             {
00216   dimension_type decrement = e + 1;
00217   --e;
00218   if (e % 2) {
00219     ++decrement;
00220 #if PPL_OR_MATRIX_EXTRA_DEBUG
00221     value.size_ -= 2;
00222 #endif
00223   }
00224   i -= decrement;
00225   value.first -= decrement;
00226   return *this;
00227 }

template<typename T>
template<typename U>
OR_Matrix< T >::template any_row_iterator< U > Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator-- ( int   )  [inline]

Postfix decrement operator.

Definition at line 232 of file OR_Matrix.inlines.hh.

00232                                                {
00233   any_row_iterator old = *this;
00234   --(*this);
00235   return old;
00236 }

template<typename T>
template<typename U>
reference Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator[] ( difference_type  m  )  const

Subscript operator.

template<typename T>
template<typename U>
OR_Matrix< T >::template any_row_iterator< U > & Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator+= ( difference_type  m  )  [inline]

Assignment-increment operator.

Definition at line 241 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e, Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::i, Parma_Polyhedra_Library::OR_Matrix< T >::row_size(), and Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::value.

00241                                                              {
00242   difference_type increment = m + m*m/2 + m*e;
00243   if (e%2 == 0 && m%2 == 1)
00244     ++increment;
00245   e += m;
00246   i += increment;
00247   value.first += increment;
00248 #if PPL_OR_MATRIX_EXTRA_DEBUG
00249   // FIXME!!!
00250   value.size_ = OR_Matrix::row_size(e);
00251 #endif
00252   return *this;
00253 }

template<typename T>
template<typename U>
OR_Matrix< T >::template any_row_iterator< U > & Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator-= ( difference_type  m  )  [inline]

Assignment-decrement operator.

Definition at line 258 of file OR_Matrix.inlines.hh.

00258                                                              {
00259   return *this += -m;
00260 }

template<typename T>
template<typename U>
OR_Matrix< T >::template any_row_iterator< U >::difference_type Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator- ( const any_row_iterator< U > &  y  )  const [inline]

Returns the difference between *this and y.

Definition at line 265 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e.

00265                                                                           {
00266   return e - y.e;
00267 }

template<typename T>
template<typename U>
OR_Matrix< T >::template any_row_iterator< U > Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator+ ( difference_type  m  )  const [inline]

Returns the sum of *this and m.

Definition at line 272 of file OR_Matrix.inlines.hh.

00272                                                                   {
00273   any_row_iterator r = *this;
00274   r += m;
00275   return r;
00276 }

template<typename T>
template<typename U>
OR_Matrix< T >::template any_row_iterator< U > Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator- ( difference_type  m  )  const [inline]

Returns the difference of *this and m.

Definition at line 281 of file OR_Matrix.inlines.hh.

00281                                                                         {
00282   any_row_iterator r = *this;
00283   r -= m;
00284   return r;
00285 }

template<typename T>
template<typename U>
bool Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator== ( const any_row_iterator< U > &  y  )  const [inline]

Returns true if and only if *this is equal to y.

Definition at line 291 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e.

00291                                             {
00292   return e == y.e;
00293 }

template<typename T>
template<typename U>
bool Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator!= ( const any_row_iterator< U > &  y  )  const [inline]

Returns true if and only if *this is different from y.

Definition at line 299 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e.

00299                                             {
00300   return e != y.e;
00301 }

template<typename T>
template<typename U>
bool Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator< ( const any_row_iterator< U > &  y  )  const [inline]

Returns true if and only if *this is less than y.

Definition at line 306 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e.

00306                                                                           {
00307   return e < y.e;
00308 }

template<typename T>
template<typename U>
bool Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator<= ( const any_row_iterator< U > &  y  )  const [inline]

Returns true if and only if *this is less than or equal to y.

Definition at line 314 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e.

00314                                             {
00315   return e <= y.e;
00316 }

template<typename T>
template<typename U>
bool Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator> ( const any_row_iterator< U > &  y  )  const [inline]

Returns true if and only if *this is greater than y.

Definition at line 321 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e.

00321                                                                           {
00322   return e > y.e;
00323 }

template<typename T>
template<typename U>
bool Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::operator>= ( const any_row_iterator< U > &  y  )  const [inline]

Returns true if and only if *this is greater than or equal to y.

Definition at line 329 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e.

00329                                             {
00330   return e >= y.e;
00331 }

template<typename T>
template<typename U>
dimension_type Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::row_size (  )  const [inline]

Definition at line 336 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e.

00336                                                 {
00337   return (e+2) & ~dimension_type(1);
00338 }

template<typename T>
template<typename U>
dimension_type Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::index (  )  const [inline]

Definition at line 343 of file OR_Matrix.inlines.hh.

References Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e.

00343                                              {
00344   return e;
00345 }


Friends And Related Function Documentation

template<typename T>
template<typename U>
friend class any_row_iterator [friend]

Definition at line 317 of file OR_Matrix.defs.hh.


Member Data Documentation

template<typename T>
template<typename U>
Pseudo_Row<U> Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::value [private]

template<typename T>
template<typename U>
dimension_type Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::e [private]

template<typename T>
template<typename U>
dimension_type Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::i [private]


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

Generated on Sat Oct 11 10:41:17 2008 for PPL by  doxygen 1.5.6