SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
slip::Array< T > Class Template Reference

This is a linear (one-dimensional) dynamic template container. This container statisfies the RandomAccessContainer concepts of the Standard Template Library (STL). More...

#include <Array.hpp>

Inheritance diagram for slip::Array< T >:
Inheritance graph

Public Types

typedef T value_type
 
typedef Array< T > self
 
typedef const Array< T > const_self
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef ptrdiff_t difference_type
 
typedef std::size_t size_type
 
typedef pointer iterator
 
typedef const_pointer const_iterator
 
typedef slip::stride_iterator
< pointer
iterator_range
 
typedef slip::stride_iterator
< const_pointer
const_iterator_range
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 
typedef std::reverse_iterator
< iterator_range
reverse_iterator_range
 
typedef std::reverse_iterator
< const_iterator_range
const_reverse_iterator_range
 
typedef iterator default_iterator
 
typedef const_iterator const_default_iterator
 

Public Member Functions

void resize (const size_type size, const T &val=T())
 Resizes a Array. More...
 
std::string name () const
 Returns the name of the class. More...
 
size_type size () const
 Returns the number of elements in the Array. More...
 
size_type max_size () const
 Returns the maximal size (number of elements) in the Array. More...
 
bool empty () const
 Returns true if the Array is empty. (Thus size() == 0) More...
 
void swap (self &rhs)
 Swaps data with another Array. More...
 
template<typename T>
 Array (const typename Array< T >::size_type n)
 
template<typename T>
 Array (typename Array< T >::size_type n, const T &val)
 
template<typename T>
 Array (typename Array< T >::size_type n, const T *val)
 
Constructors & Destructors
 Array ()
 Constructs a Array. More...
 
 Array (const size_type size)
 Constructs a Array. More...
 
 Array (const size_type size, const T &val)
 Constructs a Array initialized by the scalar value val. More...
 
 Array (const size_type size, const T *val)
 Constructs a Array initialized by an array val. More...
 
template<typename InputIterator >
 Array (const size_type n, InputIterator first, InputIterator last)
 Constructs a Array from a range. More...
 
 Array (const self &rhs)
 Constructs a copy of the Array rhs. More...
 
 ~Array ()
 Destructor of the Array. More...
 
iterators
iterator begin ()
 Returns a read/write iterator that points to the first element in the Array. Iteration is done in ordinary element order. More...
 
const_iterator begin () const
 Returns a read-only (constant) iterator that points to the first element in the Array. Iteration is done in ordinary element order. More...
 
iterator end ()
 Returns a read/write iterator that points one past the last element in the Array. Iteration is done in ordinary element order. More...
 
const_iterator end () const
 Returns a read-only (constant) iterator that points one past the last element in the Array. Iteration is done in ordinary element order. More...
 
reverse_iterator rbegin ()
 Returns a read/write reverse iterator that points to the last element in the Array. Iteration is done in reverse element order. More...
 
const_reverse_iterator rbegin () const
 Returns a read-only (constant) reverse iterator that points to the last element in the Array. Iteration is done in reverse element order. More...
 
reverse_iterator rend ()
 Returns a read/write reverse iterator that points to one before the first element in the Array. Iteration is done in reverse element order. More...
 
const_reverse_iterator rend () const
 Returns a read-only (constant) reverse iterator that points to one before the first element within the Array. Iteration is done in reverse element order. More...
 
iterator_range begin (const slip::Range< int > &range)
 Returns a read/write iterator_range that points the first element within the Range. Iteration is done in ordinary element order according to the Range. More...
 
const_iterator_range begin (const slip::Range< int > &range) const
 Returns a read-only (constant) iterator_range that points the first element within the Range. Iteration is done in ordinary element order according to the Range. More...
 
iterator_range end (const slip::Range< int > &range)
 Returns a read/write iterator_range that points one past the last element in the Array. Iteration is done in ordinary element order according to the Range. More...
 
const_iterator_range end (const slip::Range< int > &range) const
 Returns a read-only (constant) iterator_range that points one past the last element in the Array. Iteration is done in ordinary element order according to the Range. More...
 
iterator begin (const slip::Box1d< int > &box)
 Returns a read/write iterator that points the first element within the Box1d. Iteration is done in ordinary element order. More...
 
const_iterator begin (const slip::Box1d< int > &box) const
 Returns a read-only (constant) iterator that points the first element within the Box1d. Iteration is done in ordinary element order. More...
 
iterator end (const slip::Box1d< int > &box)
 Returns a read/write iterator that points one past the last element in the Array. Iteration is done in ordinary element order. More...
 
const_iterator end (const slip::Box1d< int > &box) const
 Returns a read-only (constant) iterator that points one past the last element within the Box1d. Iteration is done in ordinary element order. More...
 
reverse_iterator_range rbegin (const slip::Range< int > &range)
 Returns a read/write reverse_iterator_range that points the end element within the Range. Iteration is done in reverse element order according to the Range. More...
 
const_reverse_iterator_range rbegin (const slip::Range< int > &range) const
 Returns a read-only (constant) reverse_iterator_range that points the end element within the Range. Iteration is done in reverse element order according to the Range. More...
 
reverse_iterator_range rend (const slip::Range< int > &range)
 Returns a read/write reverse_iterator_range that points one previous the first element in the Range. Iteration is done in reverse element order according to the Range. More...
 
const_reverse_iterator_range rend (const slip::Range< int > &range) const
 Returns a read-only (constant) reverse_iterator_range that points one previous the first element in the Range. Iteration is done in reverse element order according to the Range. More...
 
reverse_iterator rbegin (const slip::Box1d< int > &box)
 Returns a read/write reverse_iterator that points the last element within the Box1d. Iteration is done in reverse element order. More...
 
const_reverse_iterator rbegin (const slip::Box1d< int > &box) const
 Returns a read-only (constant) reverse_iterator that points the last element within the Box1d. Iteration is done in reverse element order. More...
 
reverse_iterator rend (const slip::Box1d< int > &box)
 Returns a read/write reverse_iterator that points one previous the first element in the Box1d. Iteration is done in reverse element order. More...
 
const_reverse_iterator rend (const slip::Box1d< int > &box) const
 Returns a read-only (constant) reverse_iterator that points one previous the first element of the Box1d. Iteration is done in reverse element order. More...
 
Assignment operators and methods
selfoperator= (const self &rhs)
 Assigns a Array in rhs. More...
 
selfoperator= (const T &value)
 Assign all the elements of the Array by value. More...
 
void fill (const T &value)
 Fills the container range [begin(),begin()+N) with copies of value. More...
 
void fill (const T *value)
 Fills the container range [begin(),begin()+N) with a copy of the value array. More...
 
template<typename InputIterator >
void fill (InputIterator first, InputIterator last)
 Fills the container range [begin(),begin()+N) with a copy of the range [first,last) More...
 
Element access operators
reference operator[] (const size_type n)
 Subscript access to the data contained in the Array. More...
 
const_reference operator[] (const size_type n) const
 Subscript access to the data contained in the Array. More...
 
reference operator() (const size_type n)
 Subscript access to the data contained in the Array. More...
 
const_reference operator() (const size_type n) const
 Subscript access to the data contained in the Array. More...
 
reference operator() (const slip::Point1d< size_type > &p)
 Subscript access to the data contained in the Array. More...
 
const_reference operator() (const slip::Point1d< size_type > &p) const
 Subscript access to the data contained in the Array. More...
 
self operator() (const slip::Range< int > &range)
 Subscript access to the data contained in the Array. More...
 

Static Public Attributes

static const std::size_t DIM = 1
 

Friends

class boost::serialization::access
 
i/o operators
std::ostream & operator<< (std::ostream &out, const self &a)
 Write the Array to the ouput stream. More...
 
Comparison operators
bool operator== (const Array< T > &x, const Array< T > &y)
 Array equality comparison More...
 
bool operator!= (const Array< T > &x, const Array< T > &y)
 Array inequality comparison More...
 
bool operator< (const Array< T > &x, const Array< T > &y)
 Less than comparison operator (Array ordering relation) More...
 
bool operator> (const Array< T > &x, const Array< T > &y)
 More than comparison operator. More...
 
bool operator<= (const Array< T > &x, const Array< T > &y)
 Less than equal comparison operator. More...
 
bool operator>= (const Array< T > &x, const Array< T > &y)
 More than equal comparison operator. More...
 

Detailed Description

template<typename T>
class slip::Array< T >

This is a linear (one-dimensional) dynamic template container. This container statisfies the RandomAccessContainer concepts of the Standard Template Library (STL).

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Version
0.0.4
Since
1.0.0
Date
2014/03/13
Parameters
TType of the element in the Array
Examples:
color_gaussian_filter.cpp, regularvector2dfield2d_op.cpp, and regularvector3dfield3d_op.cpp.

Definition at line 94 of file Array.hpp.

Member Typedef Documentation

template<typename T>
typedef const_iterator slip::Array< T >::const_default_iterator

Definition at line 172 of file Array.hpp.

template<typename T>
typedef const_pointer slip::Array< T >::const_iterator

Definition at line 159 of file Array.hpp.

Definition at line 162 of file Array.hpp.

template<typename T>
typedef const value_type* slip::Array< T >::const_pointer

Definition at line 151 of file Array.hpp.

template<typename T>
typedef const value_type& slip::Array< T >::const_reference

Definition at line 153 of file Array.hpp.

template<typename T>
typedef std::reverse_iterator<const_iterator> slip::Array< T >::const_reverse_iterator

Definition at line 165 of file Array.hpp.

template<typename T>
typedef std::reverse_iterator<const_iterator_range> slip::Array< T >::const_reverse_iterator_range

Definition at line 168 of file Array.hpp.

template<typename T>
typedef const Array<T> slip::Array< T >::const_self

Definition at line 148 of file Array.hpp.

template<typename T>
typedef iterator slip::Array< T >::default_iterator

Definition at line 171 of file Array.hpp.

template<typename T>
typedef ptrdiff_t slip::Array< T >::difference_type

Definition at line 155 of file Array.hpp.

template<typename T>
typedef pointer slip::Array< T >::iterator

Definition at line 158 of file Array.hpp.

template<typename T>
typedef slip::stride_iterator<pointer> slip::Array< T >::iterator_range

Definition at line 161 of file Array.hpp.

template<typename T>
typedef value_type* slip::Array< T >::pointer

Definition at line 150 of file Array.hpp.

template<typename T>
typedef value_type& slip::Array< T >::reference

Definition at line 152 of file Array.hpp.

template<typename T>
typedef std::reverse_iterator<iterator> slip::Array< T >::reverse_iterator

Definition at line 164 of file Array.hpp.

template<typename T>
typedef std::reverse_iterator<iterator_range> slip::Array< T >::reverse_iterator_range

Definition at line 167 of file Array.hpp.

template<typename T>
typedef Array<T> slip::Array< T >::self

Definition at line 147 of file Array.hpp.

template<typename T>
typedef std::size_t slip::Array< T >::size_type

Definition at line 156 of file Array.hpp.

template<typename T>
typedef T slip::Array< T >::value_type

Definition at line 146 of file Array.hpp.

Constructor & Destructor Documentation

template<typename T >
slip::Array< T >::Array ( )
inline

Constructs a Array.

Definition at line 986 of file Array.hpp.

template<typename T>
slip::Array< T >::Array ( const size_type  size)

Constructs a Array.

Parameters
sizedimension of the Array
The Array is initialized with the default value of T.
template<typename T>
slip::Array< T >::Array ( const size_type  size,
const T &  val 
)

Constructs a Array initialized by the scalar value val.

Parameters
sizedimension of the Array
valinitialization value of the elements
template<typename T>
slip::Array< T >::Array ( const size_type  size,
const T *  val 
)

Constructs a Array initialized by an array val.

Parameters
sizedimension of the Array
valinitialization array value of the elements
template<typename T>
template<typename InputIterator >
slip::Array< T >::Array ( const size_type  n,
InputIterator  first,
InputIterator  last 
)
inline

Constructs a Array from a range.

Parameters
nSize of the Array.
firstAn input iterator.
lastAn input iterator.
Date
2014/03/13 Create a Array consisting of copies of the elements from [first,last).

Definition at line 221 of file Array.hpp.

template<typename T>
slip::Array< T >::Array ( const self rhs)
inline

Constructs a copy of the Array rhs.

Definition at line 1022 of file Array.hpp.

template<typename T >
slip::Array< T >::~Array ( )
inline

Destructor of the Array.

Definition at line 1031 of file Array.hpp.

template<typename T>
template<typename T>
slip::Array< T >::Array ( const typename Array< T >::size_type  n)
inline

Definition at line 993 of file Array.hpp.

template<typename T>
template<typename T>
slip::Array< T >::Array ( typename Array< T >::size_type  n,
const T &  val 
)
inline

Definition at line 1002 of file Array.hpp.

template<typename T>
template<typename T>
slip::Array< T >::Array ( typename Array< T >::size_type  n,
const T *  val 
)
inline

Definition at line 1012 of file Array.hpp.

Member Function Documentation

template<typename T >
Array< T >::iterator slip::Array< T >::begin ( )
inline

Returns a read/write iterator that points to the first element in the Array. Iteration is done in ordinary element order.

Returns
begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1077 of file Array.hpp.

template<typename T >
Array< T >::const_iterator slip::Array< T >::begin ( ) const
inline

Returns a read-only (constant) iterator that points to the first element in the Array. Iteration is done in ordinary element order.

Returns
const begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1091 of file Array.hpp.

template<typename T >
Array< T >::iterator_range slip::Array< T >::begin ( const slip::Range< int > &  range)
inline

Returns a read/write iterator_range that points the first element within the Range. Iteration is done in ordinary element order according to the Range.

Parameters
rangeRange to iterate.
Returns
end iterator_range value
Precondition
The range must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.begin(range),A5.end(range),std::ostream_iterator<double>(std::cout," "));

Definition at line 1108 of file Array.hpp.

template<typename T >
Array< T >::const_iterator_range slip::Array< T >::begin ( const slip::Range< int > &  range) const
inline

Returns a read-only (constant) iterator_range that points the first element within the Range. Iteration is done in ordinary element order according to the Range.

Parameters
rangeRange to iterate.
Returns
const_iterator_range value
Precondition
The range must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.begin(range),A5.end(range),std::ostream_iterator<double>(std::cout,"
"));

Definition at line 1130 of file Array.hpp.

template<typename T >
Array< T >::iterator slip::Array< T >::begin ( const slip::Box1d< int > &  box)
inline

Returns a read/write iterator that points the first element within the Box1d. Iteration is done in ordinary element order.

Parameters
boxBox1d to iterate.
Returns
end iterator value
Precondition
The box must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.begin(box),A5.end(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1153 of file Array.hpp.

template<typename T >
Array< T >::const_iterator slip::Array< T >::begin ( const slip::Box1d< int > &  box) const
inline

Returns a read-only (constant) iterator that points the first element within the Box1d. Iteration is done in ordinary element order.

Parameters
boxBox1d to iterate.
Returns
const_iterator value
Precondition
The box must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.begin(box),A5.end(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1171 of file Array.hpp.

template<typename T >
bool slip::Array< T >::empty ( ) const
inline

Returns true if the Array is empty. (Thus size() == 0)

Definition at line 1392 of file Array.hpp.

template<typename T >
Array< T >::iterator slip::Array< T >::end ( )
inline

Returns a read/write iterator that points one past the last element in the Array. Iteration is done in ordinary element order.

Returns
end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1084 of file Array.hpp.

template<typename T >
Array< T >::const_iterator slip::Array< T >::end ( ) const
inline

Returns a read-only (constant) iterator that points one past the last element in the Array. Iteration is done in ordinary element order.

Returns
const end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1098 of file Array.hpp.

template<typename T >
Array< T >::iterator_range slip::Array< T >::end ( const slip::Range< int > &  range)
inline

Returns a read/write iterator_range that points one past the last element in the Array. Iteration is done in ordinary element order according to the Range.

Parameters
rangeRange to iterate.
Returns
end iterator_range value
Precondition
The range must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.begin(range),A5.end(range),std::ostream_iterator<double>(std::cout," "));

Definition at line 1121 of file Array.hpp.

template<typename T >
Array< T >::const_iterator_range slip::Array< T >::end ( const slip::Range< int > &  range) const
inline

Returns a read-only (constant) iterator_range that points one past the last element in the Array. Iteration is done in ordinary element order according to the Range.

Parameters
rangeRange to iterate.
Returns
const_iterator_range value
Precondition
The range must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.begin(range),A5.end(range),std::ostream_iterator<double>(std::cout,"
"));

Definition at line 1143 of file Array.hpp.

template<typename T >
Array< T >::iterator slip::Array< T >::end ( const slip::Box1d< int > &  box)
inline

Returns a read/write iterator that points one past the last element in the Array. Iteration is done in ordinary element order.

Parameters
boxBox1d to iterate.
Returns
end iterator value
Precondition
The box must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.begin(box),A5.end(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1162 of file Array.hpp.

template<typename T >
Array< T >::const_iterator slip::Array< T >::end ( const slip::Box1d< int > &  box) const
inline

Returns a read-only (constant) iterator that points one past the last element within the Box1d. Iteration is done in ordinary element order.

Parameters
boxBox1d to iterate.
Returns
const_iterator value
Precondition
The box must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.begin(box),A5.end(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1180 of file Array.hpp.

template<typename T>
void slip::Array< T >::fill ( const T &  value)
inline

Fills the container range [begin(),begin()+N) with copies of value.

Parameters
valueA reference-to-const of arbitrary type.

Definition at line 700 of file Array.hpp.

template<typename T>
void slip::Array< T >::fill ( const T *  value)
inline

Fills the container range [begin(),begin()+N) with a copy of the value array.

Parameters
valueA pointer of arbitrary type.

Definition at line 710 of file Array.hpp.

template<typename T>
template<typename InputIterator >
void slip::Array< T >::fill ( InputIterator  first,
InputIterator  last 
)
inline

Fills the container range [begin(),begin()+N) with a copy of the range [first,last)

Parameters
firstAn input iterator.
lastAn input iterator.

Definition at line 724 of file Array.hpp.

template<typename T >
Array< T >::size_type slip::Array< T >::max_size ( ) const
inline

Returns the maximal size (number of elements) in the Array.

Definition at line 1385 of file Array.hpp.

template<typename T >
std::string slip::Array< T >::name ( ) const
inline

Returns the name of the class.

Definition at line 1376 of file Array.hpp.

template<typename T>
reference slip::Array< T >::operator() ( const size_type  n)

Subscript access to the data contained in the Array.

Parameters
nThe index of the element for which data should be accessed.
Returns
Read/write reference to data.
Precondition
n < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
const_reference slip::Array< T >::operator() ( const size_type  n) const

Subscript access to the data contained in the Array.

Parameters
nThe index of the element for which data should be accessed.
Returns
Read-only (constant) reference to data.
Precondition
n < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
reference slip::Array< T >::operator() ( const slip::Point1d< size_type > &  p)

Subscript access to the data contained in the Array.

Parameters
pThe index point corresponding of the element for which data should be accessed.
Returns
Read/write reference to data.
Precondition
p[0] < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
const_reference slip::Array< T >::operator() ( const slip::Point1d< size_type > &  p) const

Subscript access to the data contained in the Array.

Parameters
pThe index point corresponding of the element for which data should be accessed.
Returns
Read-only (constant) reference to data.
Precondition
p[0] < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T >
Array< T > slip::Array< T >::operator() ( const slip::Range< int > &  range)
inline

Subscript access to the data contained in the Array.

Parameters
rangeThe range of the Array.
Returns
a copy of the range.
Precondition
range must be valid.
The ranges indices must be inside the ranges of the Array ones.

This operator allows for easy, 1d array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

Definition at line 1361 of file Array.hpp.

template<typename T >
Array< T > & slip::Array< T >::operator= ( const self rhs)
inline

Assigns a Array in rhs.

Parameters
rhsArray to get the values from.
Returns

Definition at line 1038 of file Array.hpp.

template<typename T>
self& slip::Array< T >::operator= ( const T &  value)
inline

Assign all the elements of the Array by value.

Parameters
valueA reference-to-const of arbitrary type.
Returns

Definition at line 690 of file Array.hpp.

template<typename T>
reference slip::Array< T >::operator[] ( const size_type  n)

Subscript access to the data contained in the Array.

Parameters
nThe index of the element for which data should be accessed.
Returns
Read/write reference to data.
Precondition
n < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
const_reference slip::Array< T >::operator[] ( const size_type  n) const

Subscript access to the data contained in the Array.

Parameters
nThe index of the element for which data should be accessed.
Returns
Read-only (constant) reference to data.
Precondition
n < size()

This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T >
Array< T >::reverse_iterator slip::Array< T >::rbegin ( )
inline

Returns a read/write reverse iterator that points to the last element in the Array. Iteration is done in reverse element order.

Returns
reverse begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1188 of file Array.hpp.

template<typename T >
Array< T >::const_reverse_iterator slip::Array< T >::rbegin ( ) const
inline

Returns a read-only (constant) reverse iterator that points to the last element in the Array. Iteration is done in reverse element order.

Returns
const reverse begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1202 of file Array.hpp.

template<typename T >
Array< T >::reverse_iterator_range slip::Array< T >::rbegin ( const slip::Range< int > &  range)
inline

Returns a read/write reverse_iterator_range that points the end element within the Range. Iteration is done in reverse element order according to the Range.

Parameters
rangeRange to iterate.
Returns
reverse_iterator_range value
Precondition
The range must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.rbegin(range),A5.rend(range),std::ostream_iterator<double>(std::cout," "));

Definition at line 1248 of file Array.hpp.

template<typename T >
Array< T >::const_reverse_iterator_range slip::Array< T >::rbegin ( const slip::Range< int > &  range) const
inline

Returns a read-only (constant) reverse_iterator_range that points the end element within the Range. Iteration is done in reverse element order according to the Range.

Parameters
rangeRange to iterate.
Returns
cons_treverse__iterator_range value
Precondition
The range must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.rbegin(range),A5.rend(range),std::ostream_iterator<double>(std::cout,"
"));

Definition at line 1264 of file Array.hpp.

template<typename T >
Array< T >::reverse_iterator slip::Array< T >::rbegin ( const slip::Box1d< int > &  box)
inline

Returns a read/write reverse_iterator that points the last element within the Box1d. Iteration is done in reverse element order.

Parameters
boxBox1d to iterate.
Returns
reverse_iterator value
Precondition
The box must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.rbegin(box),A5.rend(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1217 of file Array.hpp.

template<typename T >
Array< T >::const_reverse_iterator slip::Array< T >::rbegin ( const slip::Box1d< int > &  box) const
inline

Returns a read-only (constant) reverse_iterator that points the last element within the Box1d. Iteration is done in reverse element order.

Parameters
boxBox1d to iterate.
Returns
const_reverse_iterator value
Precondition
The box must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.rbegin(box),A5.rend(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1233 of file Array.hpp.

template<typename T >
Array< T >::reverse_iterator slip::Array< T >::rend ( )
inline

Returns a read/write reverse iterator that points to one before the first element in the Array. Iteration is done in reverse element order.

Returns
reverse end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1195 of file Array.hpp.

template<typename T >
Array< T >::const_reverse_iterator slip::Array< T >::rend ( ) const
inline

Returns a read-only (constant) reverse iterator that points to one before the first element within the Array. Iteration is done in reverse element order.

Returns
const reverse end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.

Definition at line 1209 of file Array.hpp.

template<typename T >
Array< T >::reverse_iterator_range slip::Array< T >::rend ( const slip::Range< int > &  range)
inline

Returns a read/write reverse_iterator_range that points one previous the first element in the Range. Iteration is done in reverse element order according to the Range.

Parameters
rangeRange to iterate.
Returns
reverse_iterator_range value
Precondition
The range must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.rbegin(range),A5.rend(range),std::ostream_iterator<double>(std::cout," "));

Definition at line 1256 of file Array.hpp.

template<typename T >
Array< T >::const_reverse_iterator_range slip::Array< T >::rend ( const slip::Range< int > &  range) const
inline

Returns a read-only (constant) reverse_iterator_range that points one previous the first element in the Range. Iteration is done in reverse element order according to the Range.

Parameters
rangeRange to iterate.
Returns
const_reverse_iterator_range value
Precondition
The range must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Range<int> range(1,5,2);
std::copy(A5.rbegin(range),A5.rend(range),std::ostream_iterator<double>(std::cout,"
"));

Definition at line 1272 of file Array.hpp.

template<typename T >
Array< T >::reverse_iterator slip::Array< T >::rend ( const slip::Box1d< int > &  box)
inline

Returns a read/write reverse_iterator that points one previous the first element in the Box1d. Iteration is done in reverse element order.

Parameters
boxBox1d to iterate.
Returns
reverse_iterator value
Precondition
The box must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.rbegin(box),A5.rend(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1225 of file Array.hpp.

template<typename T >
Array< T >::const_reverse_iterator slip::Array< T >::rend ( const slip::Box1d< int > &  box) const
inline

Returns a read-only (constant) reverse_iterator that points one previous the first element of the Box1d. Iteration is done in reverse element order.

Parameters
boxBox1d to iterate.
Returns
const_reverse_iterator value
Precondition
The box must be inside the whole range of the Array.
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
std::copy(A5.rbegin(box),A5.rend(box),std::ostream_iterator<double>(std::cout," "));

Definition at line 1241 of file Array.hpp.

template<typename T>
void slip::Array< T >::resize ( const size_type  size,
const T &  val = T() 
)
inline

Resizes a Array.

Parameters
sizenew dimension
valnew value for all the elements

Definition at line 1059 of file Array.hpp.

template<typename T >
Array< T >::size_type slip::Array< T >::size ( ) const
inline

Returns the number of elements in the Array.

Definition at line 1381 of file Array.hpp.

template<typename T >
void slip::Array< T >::swap ( self rhs)
inline

Swaps data with another Array.

Parameters
rhsA Array of the same element type

Definition at line 1396 of file Array.hpp.

Friends And Related Function Documentation

template<typename T>
friend class boost::serialization::access
friend

Definition at line 932 of file Array.hpp.

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

Array inequality comparison

Parameters
xA Array
yA Array of the same type of x
Returns
true if !(x == y)

Definition at line 1448 of file Array.hpp.

template<typename T>
bool operator< ( const Array< T > &  x,
const Array< T > &  y 
)
friend

Less than comparison operator (Array ordering relation)

Parameters
xA Array
yA Array of the same type of x
Returns
true iff x is lexicographically less than y

Definition at line 1460 of file Array.hpp.

template<typename T>
std::ostream& operator<< ( std::ostream &  out,
const self a 
)
friend

Write the Array to the ouput stream.

Parameters
outoutput std::ostream
aArray to write to the output stream

Definition at line 1282 of file Array.hpp.

template<typename T>
bool operator<= ( const Array< T > &  x,
const Array< T > &  y 
)
friend

Less than equal comparison operator.

Parameters
xA Array
yA Array of the same type of x
Returns
true iff !(y > x)

Definition at line 1477 of file Array.hpp.

template<typename T>
bool operator== ( const Array< T > &  x,
const Array< T > &  y 
)
friend

Array equality comparison

Parameters
xA Array
yA Array of the same type of x
Returns
true iff the size and the elements of the Arrays are equal

Definition at line 1439 of file Array.hpp.

template<typename T>
bool operator> ( const Array< T > &  x,
const Array< T > &  y 
)
friend

More than comparison operator.

Parameters
xA Array
yA Array of the same type of x
Returns
true iff y > x

Definition at line 1469 of file Array.hpp.

template<typename T>
bool operator>= ( const Array< T > &  x,
const Array< T > &  y 
)
friend

More than equal comparison operator.

Parameters
xA Array
yA Array of the same type of x
Returns
true iff !(x < y)

Definition at line 1485 of file Array.hpp.

Member Data Documentation

template<typename T>
const std::size_t slip::Array< T >::DIM = 1
static

Definition at line 174 of file Array.hpp.


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