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 202 of file OR_Matrix.defs.hh.


Member Typedef Documentation

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

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

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 204 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 207 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 208 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 205 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.

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

00131   : value(),
00132     e(n_rows)
00133     // Field `i' is intentionally not initialized here.
00134 {
00135 #if PPL_OR_MATRIX_EXTRA_DEBUG
00136   // Turn `value' into a valid object.
00137   value.size_ = OR_Matrix::row_size(e);
00138 #endif
00139 }

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 144 of file OR_Matrix.inlines.hh.

00145   :  value(base
00146 #if PPL_OR_MATRIX_EXTRA_DEBUG
00147            , OR_Matrix<T>::row_size(0)
00148 #endif
00149            ),
00150      e(0),
00151      i(0) {
00152 }

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 159 of file OR_Matrix.inlines.hh.

00160   : value(y.value),
00161     e(y.e),
00162     i(y.i) {
00163 }


Member Function Documentation

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

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

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

00347                                              {
00348   return e;
00349 }

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 303 of file OR_Matrix.inlines.hh.

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

00303                                             {
00304   return e != y.e;
00305 }

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 179 of file OR_Matrix.inlines.hh.

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

00179                                                  {
00180   return value;
00181 }

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 276 of file OR_Matrix.inlines.hh.

00276                                                                   {
00277   any_row_iterator r = *this;
00278   r += m;
00279   return r;
00280 }

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 211 of file OR_Matrix.inlines.hh.

00211                                                {
00212   any_row_iterator old = *this;
00213   ++(*this);
00214   return old;
00215 }

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 193 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.

00193                                             {
00194   ++e;
00195   dimension_type increment = e;
00196   if (e % 2 != 0)
00197     ++increment;
00198 #if PPL_OR_MATRIX_EXTRA_DEBUG
00199   else {
00200     value.size_ += 2;
00201   }
00202 #endif
00203   i += increment;
00204   value.first += increment;
00205   return *this;
00206 }

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 246 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.

00246                                                                    {
00247   difference_type increment = m + m*m/2 + m*e;
00248   if (e % 2 == 0 && m % 2 != 0)
00249     ++increment;
00250   e += m;
00251   i += increment;
00252   value.first += increment;
00253 #if PPL_OR_MATRIX_EXTRA_DEBUG
00254   value.size_ += (m - m%2);
00255 #endif
00256   return *this;
00257 }

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 285 of file OR_Matrix.inlines.hh.

00285                                                                         {
00286   any_row_iterator r = *this;
00287   r -= m;
00288   return r;
00289 }

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 269 of file OR_Matrix.inlines.hh.

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

00269                                                                           {
00270   return e - y.e;
00271 }

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 237 of file OR_Matrix.inlines.hh.

00237                                                {
00238   any_row_iterator old = *this;
00239   --(*this);
00240   return old;
00241 }

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 220 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.

00220                                             {
00221   dimension_type decrement = e + 1;
00222   --e;
00223   if (e % 2 != 0) {
00224     ++decrement;
00225 #if PPL_OR_MATRIX_EXTRA_DEBUG
00226     value.size_ -= 2;
00227 #endif
00228   }
00229   i -= decrement;
00230   value.first -= decrement;
00231   return *this;
00232 }

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 262 of file OR_Matrix.inlines.hh.

00262                                                              {
00263   return *this += -m;
00264 }

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 186 of file OR_Matrix.inlines.hh.

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

00186                                                   {
00187   return &value;
00188 }

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 310 of file OR_Matrix.inlines.hh.

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

00310                                                                           {
00311   return e < y.e;
00312 }

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 318 of file OR_Matrix.inlines.hh.

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

00318                                             {
00319   return e <= y.e;
00320 }

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 169 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.

00169                                                                        {
00170   value = y.value;
00171   e = y.e;
00172   i = y.i;
00173   return *this;
00174 }

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 295 of file OR_Matrix.inlines.hh.

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

00295                                             {
00296   return e == y.e;
00297 }

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 325 of file OR_Matrix.inlines.hh.

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

00325                                                                           {
00326   return e > y.e;
00327 }

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 333 of file OR_Matrix.inlines.hh.

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

00333                                             {
00334   return e >= y.e;
00335 }

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 >
dimension_type Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::row_size (  )  const [inline]

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>
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]
template<typename T>
template<typename U>
Pseudo_Row<U> Parma_Polyhedra_Library::OR_Matrix< T >::any_row_iterator< U >::value [private]

The documentation for this class was generated from the following files:
Generated on Sun Feb 27 16:20:31 2011 for PPL by  doxygen 1.6.3