Parma_Polyhedra_Library::DB_Row< T > Class Template Reference
[C++ Language Interface]

The base class for the single rows of matrices. More...

#include <DB_Row.defs.hh>

Inheritance diagram for Parma_Polyhedra_Library::DB_Row< T >:
Inheritance graph
[legend]
Collaboration diagram for Parma_Polyhedra_Library::DB_Row< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
Implementation::Ptr_Iterator
< T * > 
iterator
 A (non const) random access iterator to access the row's elements.
typedef
Implementation::Ptr_Iterator
< const T * > 
const_iterator
 A const random access iterator to access the row's elements.

Public Member Functions

 DB_Row ()
 Pre-constructs a row: construction must be completed by construct().
 DB_Row (dimension_type sz)
 Tight constructor: resizing will require reallocation.
 DB_Row (dimension_type sz, dimension_type capacity)
 Sizing constructor with capacity.
 DB_Row (const DB_Row &y)
 Ordinary copy constructor.
 DB_Row (const DB_Row &y, dimension_type capacity)
 Copy constructor with specified capacity.
 DB_Row (const DB_Row &y, dimension_type sz, dimension_type capacity)
 Copy constructor with specified size and capacity.
 ~DB_Row ()
 Destructor.
DB_Rowoperator= (const DB_Row &y)
 Assignment operator.
void swap (DB_Row &y)
 Swaps *this with y.
void assign (DB_Row &y)
 Assigns the implementation of y to *this.
void allocate (dimension_type capacity)
 Allocates memory for a default constructed DB_Row object, allowing for capacity coefficients at most.
void expand_within_capacity (dimension_type new_size)
 Expands the row to size new_size.
void shrink (dimension_type new_size)
 Shrinks the row by erasing elements at the end.
dimension_type size () const
 Gives the number of coefficients currently in use.
iterator begin ()
 Returns the const iterator pointing to the first element, if *this is not empty; otherwise, returns the past-the-end const iterator.
iterator end ()
 Returns the past-the-end iterator.
const_iterator begin () const
 Returns the const iterator pointing to the first element, if *this is not empty; otherwise, returns the past-the-end const iterator.
const_iterator end () const
 Returns the past-the-end const iterator.
memory_size_type total_memory_in_bytes () const
 Returns a lower bound to the total size in bytes of the memory occupied by *this.
memory_size_type external_memory_in_bytes () const
 Returns a lower bound to the size in bytes of the memory managed by *this.
memory_size_type total_memory_in_bytes (dimension_type capacity) const
 Returns the total size in bytes of the memory occupied by *this, provided the capacity of *this is given by capacity.
memory_size_type external_memory_in_bytes (dimension_type capacity) const
 Returns the size in bytes of the memory managed by *this, provided the capacity of *this is given by capacity.
bool OK (dimension_type row_size, dimension_type row_capacity) const
 Checks if all the invariants are satisfied.
Post-constructors.

void construct (dimension_type sz)
 Constructs properly a default-constructed element.
void construct (dimension_type sz, dimension_type capacity)
 Constructs properly a default-constructed element.
template<typename U >
void construct_upward_approximation (const DB_Row< U > &y, dimension_type capacity)
 Constructs properly a conservative approximation of y.
Subscript operators.

T & operator[] (dimension_type k)
 Returns a reference to the element of the row indexed by k.
const T & operator[] (dimension_type k) const
 Returns a constant reference to the element of the row indexed by k.

Static Public Member Functions

static dimension_type max_size ()
 Returns the size() of the largest possible DB_Row.

Private Member Functions

void copy_construct_coefficients (const DB_Row &y)
 Exception-safe copy construction mechanism for coefficients.

Friends

class Parma_Polyhedra_Library::DB_Row

Related Functions

(Note that these are not member functions.)



template<typename T >
void swap (Parma_Polyhedra_Library::DB_Row< T > &x, Parma_Polyhedra_Library::DB_Row< T > &y)
 Specializes std::swap.
template<typename T >
void iter_swap (typename std::vector< Parma_Polyhedra_Library::DB_Row< T > >::iterator x, typename std::vector< Parma_Polyhedra_Library::DB_Row< T > >::iterator y)
 Specializes std::iter_swap.
Classical comparison operators.

template<typename T >
bool operator== (const DB_Row< T > &x, const DB_Row< T > &y)
template<typename T >
bool operator!= (const DB_Row< T > &x, const DB_Row< T > &y)

Detailed Description

template<typename T>
class Parma_Polyhedra_Library::DB_Row< T >

The base class for the single rows of matrices.

The class template DB_Row<T> allows for the efficient representation of the single rows of a DB_Matrix. It contains elements of type T stored as a vector. The class T is a family of extended numbers that must provide representation for $ -\infty $, $0$,$ +\infty $ (and, consequently for nan, not a number, since this arises as the ``result'' of undefined sums like $ +\infty + (-\infty) $).

The class T must provide the following methods:

    T()

is the default constructor: no assumption is made on the particular object constructed, provided T().OK() gives true (see below).

    ~T()

is the destructor.

    bool is_nan() const

returns true if and only *this represents the not a number value.

    bool OK() const

returns true if and only if *this satisfies all its invariants.

Definition at line 120 of file DB_Row.defs.hh.


Member Typedef Documentation

template<typename T>
typedef Implementation::Ptr_Iterator<const T*> Parma_Polyhedra_Library::DB_Row< T >::const_iterator

A const random access iterator to access the row's elements.

Definition at line 247 of file DB_Row.defs.hh.

template<typename T>
typedef Implementation::Ptr_Iterator<T*> Parma_Polyhedra_Library::DB_Row< T >::iterator

A (non const) random access iterator to access the row's elements.

Definition at line 244 of file DB_Row.defs.hh.


Constructor & Destructor Documentation

template<typename T >
Parma_Polyhedra_Library::DB_Row< T >::DB_Row (  )  [inline]

Pre-constructs a row: construction must be completed by construct().

Definition at line 168 of file DB_Row.inlines.hh.

00169   : DB_Row_Impl_Handler<T>() {
00170 }

template<typename T >
Parma_Polyhedra_Library::DB_Row< T >::DB_Row ( dimension_type  sz  )  [inline]

Tight constructor: resizing will require reallocation.

Definition at line 252 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row< T >::construct().

00252                                          {
00253   construct(sz);
00254 }

template<typename T >
Parma_Polyhedra_Library::DB_Row< T >::DB_Row ( dimension_type  sz,
dimension_type  capacity 
) [inline]

Sizing constructor with capacity.

Definition at line 244 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row< T >::construct().

00246   : DB_Row_Impl_Handler<T>() {
00247   construct(sz, capacity);
00248 }

template<typename T >
Parma_Polyhedra_Library::DB_Row< T >::DB_Row ( const DB_Row< T > &  y  )  [inline]
template<typename T >
Parma_Polyhedra_Library::DB_Row< T >::DB_Row ( const DB_Row< T > &  y,
dimension_type  capacity 
) [inline]

Copy constructor with specified capacity.

It is assumed that capacity is greater than or equal to y size.

Definition at line 268 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row< T >::allocate(), Parma_Polyhedra_Library::DB_Row< T >::copy_construct_coefficients(), Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, Parma_Polyhedra_Library::DB_Row< T >::max_size(), and Parma_Polyhedra_Library::DB_Row< T >::size().

00270   : DB_Row_Impl_Handler<T>() {
00271   PPL_ASSERT(y.impl);
00272   PPL_ASSERT(y.size() <= capacity && capacity <= max_size());
00273   allocate(capacity);
00274   copy_construct_coefficients(y);
00275 }

template<typename T >
Parma_Polyhedra_Library::DB_Row< T >::DB_Row ( const DB_Row< T > &  y,
dimension_type  sz,
dimension_type  capacity 
) [inline]

Copy constructor with specified size and capacity.

It is assumed that sz is greater than or equal to the size of y and, of course, that sz is less than or equal to capacity. Any new position is initialized to $+\infty$.

Definition at line 279 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row< T >::allocate(), Parma_Polyhedra_Library::DB_Row< T >::copy_construct_coefficients(), Parma_Polyhedra_Library::DB_Row< T >::expand_within_capacity(), Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, Parma_Polyhedra_Library::DB_Row< T >::max_size(), and Parma_Polyhedra_Library::DB_Row< T >::size().

00282   : DB_Row_Impl_Handler<T>() {
00283   PPL_ASSERT(y.impl);
00284   PPL_ASSERT(y.size() <= sz && sz <= capacity && capacity <= max_size());
00285   allocate(capacity);
00286   copy_construct_coefficients(y);
00287   expand_within_capacity(sz);
00288 }

template<typename T >
Parma_Polyhedra_Library::DB_Row< T >::~DB_Row (  )  [inline]

Destructor.

Definition at line 292 of file DB_Row.inlines.hh.

00292                    {
00293 }


Member Function Documentation

template<typename T >
void Parma_Polyhedra_Library::DB_Row< T >::allocate ( dimension_type  capacity  )  [inline]

Allocates memory for a default constructed DB_Row object, allowing for capacity coefficients at most.

It is assumed that no allocation has been performed before (otherwise, a memory leak will occur). After execution, the size of the DB_Row object is zero.

Definition at line 174 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, and Parma_Polyhedra_Library::DB_Row< T >::max_size().

Referenced by Parma_Polyhedra_Library::DB_Row< T >::construct(), Parma_Polyhedra_Library::DB_Row< T >::construct_upward_approximation(), and Parma_Polyhedra_Library::DB_Row< T >::DB_Row().

00178                                         {
00179   DB_Row<T>& x = *this;
00180   PPL_ASSERT(capacity <= max_size());
00181 #if !PPL_CXX_SUPPORTS_FLEXIBLE_ARRAYS
00182   if (capacity == 0)
00183     ++capacity;
00184 #endif
00185   PPL_ASSERT(x.impl == 0);
00186   x.impl = new (capacity) typename DB_Row_Impl_Handler<T>::Impl();
00187 #if PPL_DB_ROW_EXTRA_DEBUG
00188   PPL_ASSERT(x.capacity_ == 0);
00189   x.capacity_ = capacity;
00190 #endif
00191 }

template<typename T >
void Parma_Polyhedra_Library::DB_Row< T >::assign ( DB_Row< T > &  y  )  [inline]

Assigns the implementation of y to *this.

Definition at line 315 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.

00315                            {
00316   DB_Row<T>& x = *this;
00317   x.impl = y.impl;
00318 #if PPL_DB_ROW_EXTRA_DEBUG
00319   x.capacity_ = y.capacity_;
00320 #endif
00321 }

template<typename T >
DB_Row< T >::const_iterator Parma_Polyhedra_Library::DB_Row< T >::begin (  )  const [inline]

Returns the const iterator pointing to the first element, if *this is not empty; otherwise, returns the past-the-end const iterator.

Definition at line 364 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, and Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::vec_.

00364                        {
00365   const DB_Row<T>& x = *this;
00366   return const_iterator(x.impl->vec_);
00367 }

template<typename T >
DB_Row< T >::iterator Parma_Polyhedra_Library::DB_Row< T >::begin (  )  [inline]

Returns the const iterator pointing to the first element, if *this is not empty; otherwise, returns the past-the-end const iterator.

Definition at line 350 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, and Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::vec_.

00350                  {
00351   DB_Row<T>& x = *this;
00352   return iterator(x.impl->vec_);
00353 }

template<typename T >
void Parma_Polyhedra_Library::DB_Row< T >::construct ( dimension_type  sz,
dimension_type  capacity 
) [inline]

Constructs properly a default-constructed element.

Parameters:
sz The size of the row that will be constructed.
capacity The minimum capacity of the row that will be constructed.

The row that we are constructing has a minimum capacity of (i.e., it can contain at least) elements, sz of which will be constructed now.

Definition at line 229 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row< T >::allocate(), Parma_Polyhedra_Library::DB_Row< T >::expand_within_capacity(), and Parma_Polyhedra_Library::DB_Row< T >::max_size().

00230                                                     {
00231   PPL_ASSERT(sz <= capacity && capacity <= max_size());
00232   allocate(capacity);
00233   expand_within_capacity(sz);
00234 }

template<typename T >
void Parma_Polyhedra_Library::DB_Row< T >::construct ( dimension_type  sz  )  [inline]

Constructs properly a default-constructed element.

Builds a row with size sz and minimum capacity.

Definition at line 238 of file DB_Row.inlines.hh.

Referenced by Parma_Polyhedra_Library::DB_Row< T >::DB_Row().

00238                                             {
00239   construct(sz, sz);
00240 }

template<typename T >
template<typename U >
void Parma_Polyhedra_Library::DB_Row< T >::construct_upward_approximation ( const DB_Row< U > &  y,
dimension_type  capacity 
) [inline]

Constructs properly a conservative approximation of y.

Parameters:
y A row containing the elements whose upward approximations will be used to properly construct *this.
capacity The capacity of the constructed row.

It is assumed that capacity is greater than or equal to the size of y.

Definition at line 218 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row< T >::allocate(), Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::construct_upward_approximation(), Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, Parma_Polyhedra_Library::DB_Row< T >::max_size(), and Parma_Polyhedra_Library::DB_Row< T >::size().

00219                                                                          {
00220   DB_Row<T>& x = *this;
00221   PPL_ASSERT(y.size() <= capacity && capacity <= max_size());
00222   allocate(capacity);
00223   PPL_ASSERT(y.impl);
00224   x.impl->construct_upward_approximation(*(y.impl));
00225 }

template<typename T >
void Parma_Polyhedra_Library::DB_Row< T >::copy_construct_coefficients ( const DB_Row< T > &  y  )  [inline, private]

Exception-safe copy construction mechanism for coefficients.

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

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::copy_construct_coefficients(), Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, and Parma_Polyhedra_Library::DB_Row< T >::size().

Referenced by Parma_Polyhedra_Library::DB_Row< T >::DB_Row().

00206                                                       {
00207   DB_Row<T>& x = *this;
00208   PPL_ASSERT(x.impl && y.impl);
00209 #if PPL_DB_ROW_EXTRA_DEBUG
00210   PPL_ASSERT(y.size() <= x.capacity_);
00211 #endif
00212   x.impl->copy_construct_coefficients(*(y.impl));
00213 }

template<typename T >
DB_Row< T >::const_iterator Parma_Polyhedra_Library::DB_Row< T >::end (  )  const [inline]

Returns the past-the-end const iterator.

Definition at line 371 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::size_, and Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::vec_.

00371                      {
00372   const DB_Row<T>& x = *this;
00373   return const_iterator(x.impl->vec_ + x.impl->size_);
00374 }

template<typename T >
DB_Row< T >::iterator Parma_Polyhedra_Library::DB_Row< T >::end (  )  [inline]

Returns the past-the-end iterator.

Definition at line 357 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::size_, and Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::vec_.

00357                {
00358   DB_Row<T>& x = *this;
00359   return iterator(x.impl->vec_ + x.impl->size_);
00360 }

template<typename T >
void Parma_Polyhedra_Library::DB_Row< T >::expand_within_capacity ( dimension_type  new_size  )  [inline]

Expands the row to size new_size.

Adds new positions to the implementation of the row obtaining a new row with size new_size. It is assumed that new_size is between the current size and capacity of the row. The new positions are initialized to $+\infty$.

Definition at line 195 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::expand_within_capacity(), and Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.

Referenced by Parma_Polyhedra_Library::DB_Row< T >::construct(), and Parma_Polyhedra_Library::DB_Row< T >::DB_Row().

00195                                                                {
00196   DB_Row<T>& x = *this;
00197   PPL_ASSERT(x.impl);
00198 #if PPL_DB_ROW_EXTRA_DEBUG
00199   PPL_ASSERT(new_size <= x.capacity_);
00200 #endif
00201   x.impl->expand_within_capacity(new_size);
00202 }

template<typename T >
memory_size_type Parma_Polyhedra_Library::DB_Row< T >::external_memory_in_bytes ( dimension_type  capacity  )  const [inline]

Returns the size in bytes of the memory managed by *this, provided the capacity of *this is given by capacity.

Definition at line 378 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, and Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::total_memory_in_bytes().

00378                                                                  {
00379   const DB_Row<T>& x = *this;
00380   return x.impl->total_memory_in_bytes(capacity);
00381 }

template<typename T >
memory_size_type Parma_Polyhedra_Library::DB_Row< T >::external_memory_in_bytes (  )  const [inline]

Returns a lower bound to the size in bytes of the memory managed by *this.

Definition at line 391 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, and Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::total_memory_in_bytes().

Referenced by Parma_Polyhedra_Library::DB_Row< T >::total_memory_in_bytes().

00391                                           {
00392   const DB_Row<T>& x = *this;
00393 #if PPL_DB_ROW_EXTRA_DEBUG
00394   return x.impl->total_memory_in_bytes(x.capacity_);
00395 #else
00396   return x.impl->total_memory_in_bytes();
00397 #endif
00398 }

template<typename T >
dimension_type Parma_Polyhedra_Library::DB_Row< T >::max_size (  )  [inline, static]
template<typename T >
bool Parma_Polyhedra_Library::DB_Row< T >::OK ( dimension_type  row_size,
dimension_type  row_capacity 
) const [inline]

Checks if all the invariants are satisfied.

Definition at line 126 of file DB_Row.templates.hh.

References Parma_Polyhedra_Library::is_not_a_number(), and Parma_Polyhedra_Library::DB_Row< T >::size().

00131                       {
00132 #ifndef NDEBUG
00133   using std::endl;
00134   using std::cerr;
00135 #endif
00136 
00137   const DB_Row<T>& x = *this;
00138   bool is_broken = false;
00139 
00140 #if PPL_DB_ROW_EXTRA_DEBUG
00141 # if !PPL_CXX_SUPPORTS_FLEXIBLE_ARRAYS
00142   if (x.capacity_ == 0) {
00143     cerr << "Illegal row capacity: is 0, should be at least 1"
00144          << endl;
00145     is_broken = true;
00146   }
00147   else if (x.capacity_ == 1 && row_capacity == 0)
00148     // This is fine.
00149     ;
00150   else
00151 # endif // !PPL_CXX_SUPPORTS_FLEXIBLE_ARRAYS
00152   if (x.capacity_ != row_capacity) {
00153     cerr << "DB_Row capacity mismatch: is " << x.capacity_
00154          << ", should be " << row_capacity << "."
00155          << endl;
00156     is_broken = true;
00157   }
00158 #endif // PPL_DB_ROW_EXTRA_DEBUG
00159 
00160   if (x.size() != row_size) {
00161 #ifndef NDEBUG
00162     cerr << "DB_Row size mismatch: is " << x.size()
00163          << ", should be " << row_size << "."
00164          << endl;
00165 #endif
00166     is_broken = true;
00167   }
00168 
00169 #if PPL_DB_ROW_EXTRA_DEBUG
00170   if (x.capacity_ < x.size()) {
00171 #ifndef NDEBUG
00172     cerr << "DB_Row is completely broken: capacity is " << x.capacity_
00173          << ", size is " << x.size() << "."
00174          << endl;
00175 #endif
00176     is_broken = true;
00177   }
00178 #endif // PPL_DB_ROW_EXTRA_DEBUG
00179 
00180   for (dimension_type i = x.size(); i-- > 0; ) {
00181     const T& element = x[i];
00182     // Not OK is bad.
00183     if (!element.OK()) {
00184       is_broken = true;
00185       break;
00186     }
00187     // In addition, nans should never occur.
00188     if (is_not_a_number(element)) {
00189 #ifndef NDEBUG
00190       cerr << "Not-a-number found in DB_Row."
00191            << endl;
00192 #endif
00193       is_broken = true;
00194       break;
00195     }
00196   }
00197 
00198   return !is_broken;
00199 }

template<typename T >
DB_Row< T > & Parma_Polyhedra_Library::DB_Row< T >::operator= ( const DB_Row< T > &  y  )  [inline]

Assignment operator.

Definition at line 325 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row< T >::swap().

00325                                     {
00326   // Copy-construct `tmp' from `y'.
00327   DB_Row tmp(y);
00328   // Swap the implementation of `*this' with the one of `tmp'.
00329   swap(tmp);
00330   // Now `tmp' goes out of scope, so the old `*this' will be destroyed.
00331   return *this;
00332 }

template<typename T >
const T & Parma_Polyhedra_Library::DB_Row< T >::operator[] ( dimension_type  k  )  const [inline]

Returns a constant reference to the element of the row indexed by k.

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

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.

00343                                                   {
00344   const DB_Row<T>& x = *this;
00345   return (*x.impl)[k];
00346 }

template<typename T >
T & Parma_Polyhedra_Library::DB_Row< T >::operator[] ( dimension_type  k  )  [inline]

Returns a reference to the element of the row indexed by k.

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

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.

00336                                             {
00337   DB_Row<T>& x = *this;
00338   return (*x.impl)[k];
00339 }

template<typename T >
void Parma_Polyhedra_Library::DB_Row< T >::shrink ( dimension_type  new_size  )  [inline]

Shrinks the row by erasing elements at the end.

Destroys elements of the row implementation from position new_size to the end. It is assumed that new_size is not greater than the current size.

Definition at line 297 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, and Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::shrink().

00297                                                {
00298   DB_Row<T>& x = *this;
00299   PPL_ASSERT(x.impl);
00300   x.impl->shrink(new_size);
00301 }

template<typename T >
dimension_type Parma_Polyhedra_Library::DB_Row< T >::size (  )  const [inline]
template<typename T >
void Parma_Polyhedra_Library::DB_Row< T >::swap ( DB_Row< T > &  y  )  [inline]

Swaps *this with y.

Definition at line 305 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.

Referenced by Parma_Polyhedra_Library::DB_Row< T >::operator=(), and Parma_Polyhedra_Library::DB_Row< T >::swap().

00305                          {
00306   DB_Row<T>& x = *this;
00307   std::swap(x.impl, y.impl);
00308 #if PPL_DB_ROW_EXTRA_DEBUG
00309   std::swap(x.capacity_, y.capacity_);
00310 #endif
00311 }

template<typename T >
memory_size_type Parma_Polyhedra_Library::DB_Row< T >::total_memory_in_bytes ( dimension_type  capacity  )  const [inline]

Returns the total size in bytes of the memory occupied by *this, provided the capacity of *this is given by capacity.

Definition at line 385 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row< T >::external_memory_in_bytes().

00385                                                               {
00386   return sizeof(*this) + external_memory_in_bytes(capacity);
00387 }

template<typename T >
memory_size_type Parma_Polyhedra_Library::DB_Row< T >::total_memory_in_bytes (  )  const [inline]

Returns a lower bound to the total size in bytes of the memory occupied by *this.

Definition at line 402 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row< T >::external_memory_in_bytes().

00402                                        {
00403   return sizeof(*this) + external_memory_in_bytes();
00404 }


Friends And Related Function Documentation

template<typename T >
void iter_swap ( typename std::vector< Parma_Polyhedra_Library::DB_Row< T > >::iterator  x,
typename std::vector< Parma_Polyhedra_Library::DB_Row< T > >::iterator  y 
) [related]

Specializes std::iter_swap.

Definition at line 429 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::swap().

00432                       {
00433   swap(*x, *y);
00434 }

template<typename T >
bool operator!= ( const DB_Row< T > &  x,
const DB_Row< T > &  y 
) [related]

Definition at line 409 of file DB_Row.inlines.hh.

00409                                                    {
00410   return !(x == y);
00411 }

template<typename T >
bool operator== ( const DB_Row< T > &  x,
const DB_Row< T > &  y 
) [related]

Definition at line 204 of file DB_Row.templates.hh.

References Parma_Polyhedra_Library::DB_Row< T >::size().

00204                                                    {
00205   if (x.size() != y.size())
00206     return false;
00207   for (dimension_type i = x.size(); i-- > 0; )
00208     if (x[i] != y[i])
00209       return false;
00210   return true;
00211 }

template<typename T>
friend class Parma_Polyhedra_Library::DB_Row [friend]

Definition at line 297 of file DB_Row.defs.hh.

template<typename T >
void swap ( Parma_Polyhedra_Library::DB_Row< T > &  x,
Parma_Polyhedra_Library::DB_Row< T > &  y 
) [related]

Specializes std::swap.

Definition at line 421 of file DB_Row.inlines.hh.

References Parma_Polyhedra_Library::DB_Row< T >::swap().

00422                                           {
00423   x.swap(y);
00424 }


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