Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Array_2D< T, A > Class Template Reference

Class representing a 2D array. More...

#include <array.h>

List of all members.

Public Types

typedef Storage::value_type value_type
 Standard type.

typedef Storage::allocator_type allocator_type
 Standard type.

typedef Storage::size_type size_type
 Standard type.

typedef Storage::difference_type difference_type
 Standard type.

typedef Storage::iterator iterator
 Standard type.

typedef Storage::const_iterator const_iterator
 Standard type.

typedef Storage::reverse_iterator reverse_iterator
 Standard type.

typedef Storage::const_reverse_iterator const_reverse_iterator
 Standard type.

typedef Storage::reference reference
 Standard type.

typedef Storage::const_reference const_reference
 Standard type.


Public Methods

void assign (const size_type nx, const size_type ny, const T &val)
 Assignement of a default value.

void swap (Array_2D< T, A > &a)
 Efficient swapping of two 2D arrays.

allocator_type get_allocator () const
 Gives the memory allocator.

 Array_2D (const A &a=A())
 Classical constructor.

 Array_2D (const size_type nx, const size_type ny, const T &val=T(), const A &a=A())
 Classical constructor.

template<typename Element_iterator>  Array_2D (Element_iterator begin_elt, Element_iterator end_elt, const size_type nx, const size_type ny, const A &a=A())
 Array_2D (const Array_2D< T, A > &a)
 Classical constructor.

bool empty () const
 Handle the array dimension.

size_type x_size () const
 Handle the array dimension.

size_type y_size () const
 Handle the array dimension.

size_type size () const
 Handle the array dimension.

size_type max_size () const
 Handle the array dimension.

void resize (const size_type nx, const size_type ny)
 Handle the array dimension.

Array_2D< T, A > & operator= (const Array_2D< T, A > &a)
 Classical operator.

bool operator== (const Array_2D< T, A > &a)
 Classical operator.

bool operator!= (const Array_2D< T, A > &a)
 Classical operator.

template<typename Vector_position> reference operator[] (const Vector_position &v)
 Access operator.

template<typename Vector_position> const_reference operator[] (const Vector_position &v) const
 Access operator.

reference operator() (const size_type x, const size_type y)
 Access operator.

const_reference operator() (const size_type x, const size_type y) const
 Access operator.

template<typename Vector_position> reference at (const Vector_position &v)
 Access operator.

template<typename Vector_position> const_reference at (const Vector_position &v) const
 Access operator.

reference at (const size_type x, const size_type y)
 Access operator.

const_reference at (const size_type x, const size_type y) const
 Access operator.

iterator begin ()
 Points on the (0,0) element.

const_iterator begin () const
 Points on the (0,0) element.

iterator end ()
 Points on the element after (x_size()-1,y_size()-1).

const_iterator end () const
 Points on the element after (x_size()-1,y_size()-1).

reverse_iterator rbegin ()
 Reverse iterator.

const_reverse_iterator rbegin () const
 Reverse iterator.

reverse_iterator rend ()
 Reverse iterator.

const_reverse_iterator rend () const
 Reverse iterator.


Detailed Description

template<typename T, typename A = std::allocator<T>>
class Array_2D< T, A >

Class representing a 2D array.

Optimised for an access in order :

  for(x=...){ for(y=...){...} }

at() and the operator[]() also accept a vector that provides an access to its elements through an [] operator.


Member Typedef Documentation

template<typename T, typename A = std::allocator<T>>
typedef Storage::allocator_type Array_2D< T, A >::allocator_type
 

Standard type.

template<typename T, typename A = std::allocator<T>>
typedef Storage::const_iterator Array_2D< T, A >::const_iterator
 

Standard type.

template<typename T, typename A = std::allocator<T>>
typedef Storage::const_reference Array_2D< T, A >::const_reference
 

Standard type.

template<typename T, typename A = std::allocator<T>>
typedef Storage::const_reverse_iterator Array_2D< T, A >::const_reverse_iterator
 

Standard type.

template<typename T, typename A = std::allocator<T>>
typedef Storage::difference_type Array_2D< T, A >::difference_type
 

Standard type.

template<typename T, typename A = std::allocator<T>>
typedef Storage::iterator Array_2D< T, A >::iterator
 

Standard type.

template<typename T, typename A = std::allocator<T>>
typedef Storage::reference Array_2D< T, A >::reference
 

Standard type.

template<typename T, typename A = std::allocator<T>>
typedef Storage::reverse_iterator Array_2D< T, A >::reverse_iterator
 

Standard type.

template<typename T, typename A = std::allocator<T>>
typedef Storage::size_type Array_2D< T, A >::size_type
 

Standard type.

template<typename T, typename A = std::allocator<T>>
typedef Storage::value_type Array_2D< T, A >::value_type
 

Standard type.


Constructor & Destructor Documentation

template<typename T, typename A>
Array_2D< T, A >::Array_2D const A &    a = A() [inline, explicit]
 

Classical constructor.

template<typename T, typename A>
Array_2D< T, A >::Array_2D const size_type    nx,
const size_type    ny,
const T &    val = T(),
const A &    a = A()
[inline, explicit]
 

Classical constructor.

template<typename T, typename A>
template<typename Element_iterator>
Array_2D< T, A >::Array_2D Element_iterator    begin_elt,
Element_iterator    end_elt,
const size_type    nx,
const size_type    ny,
const A &    a = A()
[inline]
 

Fills in the array with the elements between begin_elt and \e end_elt.

Throw the length_error() exception if not enough elements.

template<typename T, typename A>
Array_2D< T, A >::Array_2D const Array_2D< T, A > &    a [inline]
 

Classical constructor.


Member Function Documentation

template<typename T, typename A>
void Array_2D< T, A >::assign const size_type    nx,
const size_type    ny,
const T &    val
 

Assignement of a default value.

template<typename T, typename A>
Array_2D< T, A >::const_reference Array_2D< T, A >::at const size_type    x,
const size_type    y
const [inline]
 

Access operator.

template<typename T, typename A>
Array_2D< T, A >::reference Array_2D< T, A >::at const size_type    x,
const size_type    y
[inline]
 

Access operator.

template<typename T, typename A>
template<typename Vector_position>
Array_2D< T, A >::const_reference Array_2D< T, A >::at const Vector_position &    v const [inline]
 

Access operator.

template<typename T, typename A>
template<typename Vector_position>
Array_2D< T, A >::reference Array_2D< T, A >::at const Vector_position &    v [inline]
 

Access operator.

template<typename T, typename A>
Array_2D< T, A >::const_iterator Array_2D< T, A >::begin   [inline]
 

Points on the (0,0) element.

Goes through the array in the order

      for(x=...){ for(y=...){...} }.

template<typename T, typename A>
Array_2D< T, A >::iterator Array_2D< T, A >::begin   [inline]
 

Points on the (0,0) element.

Goes through the array in the order

      for(x=...){ for(y=...){...} }.

template<typename T, typename A>
bool Array_2D< T, A >::empty   [inline]
 

Handle the array dimension.

template<typename T, typename A>
Array_2D< T, A >::const_iterator Array_2D< T, A >::end   [inline]
 

Points on the element after (x_size()-1,y_size()-1).

Goes through the array in the order

      for(x=...){ for(y=...){...} }.

template<typename T, typename A>
Array_2D< T, A >::iterator Array_2D< T, A >::end   [inline]
 

Points on the element after (x_size()-1,y_size()-1).

Goes through the array in the order

      for(x=...){ for(y=...){...} }.

template<typename T, typename A>
Array_2D< T, A >::allocator_type Array_2D< T, A >::get_allocator   [inline]
 

Gives the memory allocator.

template<typename T, typename A>
Array_2D< T, A >::size_type Array_2D< T, A >::max_size   [inline]
 

Handle the array dimension.

template<typename T, typename A>
bool Array_2D< T, A >::operator!= const Array_2D< T, A > &    a [inline]
 

Classical operator.

template<typename T, typename A>
Array_2D< T, A >::const_reference Array_2D< T, A >::operator() const size_type    x,
const size_type    y
const [inline]
 

Access operator.

template<typename T, typename A>
Array_2D< T, A >::reference Array_2D< T, A >::operator() const size_type    x,
const size_type    y
[inline]
 

Access operator.

template<typename T, typename A>
Array_2D< T, A > & Array_2D< T, A >::operator= const Array_2D< T, A > &    a [inline]
 

Classical operator.

template<typename T, typename A>
bool Array_2D< T, A >::operator== const Array_2D< T, A > &    a [inline]
 

Classical operator.

template<typename T, typename A>
template<typename Vector_position>
Array_2D< T, A >::const_reference Array_2D< T, A >::operator[] const Vector_position &    v const [inline]
 

Access operator.

template<typename T, typename A>
template<typename Vector_position>
Array_2D< T, A >::reference Array_2D< T, A >::operator[] const Vector_position &    v [inline]
 

Access operator.

template<typename T, typename A>
Array_2D< T, A >::const_reverse_iterator Array_2D< T, A >::rbegin   [inline]
 

Reverse iterator.

template<typename T, typename A>
Array_2D< T, A >::reverse_iterator Array_2D< T, A >::rbegin   [inline]
 

Reverse iterator.

template<typename T, typename A>
Array_2D< T, A >::const_reverse_iterator Array_2D< T, A >::rend   [inline]
 

Reverse iterator.

template<typename T, typename A>
Array_2D< T, A >::reverse_iterator Array_2D< T, A >::rend   [inline]
 

Reverse iterator.

template<typename T, typename A>
void Array_2D< T, A >::resize const size_type    nx,
const size_type    ny
[inline]
 

Handle the array dimension.

template<typename T, typename A>
Array_2D< T, A >::size_type Array_2D< T, A >::size   [inline]
 

Handle the array dimension.

template<typename T, typename A>
void Array_2D< T, A >::swap Array_2D< T, A > &    a [inline]
 

Efficient swapping of two 2D arrays.

template<typename T, typename A>
Array_2D< T, A >::size_type Array_2D< T, A >::x_size   [inline]
 

Handle the array dimension.

template<typename T, typename A>
Array_2D< T, A >::size_type Array_2D< T, A >::y_size   [inline]
 

Handle the array dimension.


The documentation for this class was generated from the following file:
Generated on Tue Mar 2 18:12:45 2004 for Graph-cut code by doxygen1.2.18