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::Array2d< T > Class Template Reference

This is a two-dimensional dynamic and generic container. This container statisfies the BidirectionnalContainer concepts of the STL. It is also an 2d extension of the RandomAccessContainer concept. That is to say the bracket element access is replaced by the double bracket element access. More...

#include <Array2d.hpp>

Public Types

typedef T value_type
 
typedef Array2d< T > self
 
typedef const Array2d< T > const_self
 
typedef value_typereference
 
typedef value_type const & const_reference
 
typedef value_typepointer
 
typedef value_type const * const_pointer
 
typedef ptrdiff_t difference_type
 
typedef std::size_t size_type
 
typedef pointer iterator
 
typedef const_pointer const_iterator
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 
typedef pointer row_iterator
 
typedef const_pointer const_row_iterator
 
typedef slip::stride_iterator
< pointer
col_iterator
 
typedef slip::stride_iterator
< const_pointer
const_col_iterator
 
typedef slip::iterator2d_box
< self
iterator2d
 
typedef
slip::const_iterator2d_box
< const_self
const_iterator2d
 
typedef slip::stride_iterator
< pointer
row_range_iterator
 
typedef slip::stride_iterator
< const_pointer
const_row_range_iterator
 
typedef slip::stride_iterator
< col_iterator
col_range_iterator
 
typedef slip::stride_iterator
< const_col_iterator
const_col_range_iterator
 
typedef slip::iterator2d_range
< self
iterator2d_range
 
typedef
slip::const_iterator2d_range
< const_self
const_iterator2d_range
 
typedef std::reverse_iterator
< iterator
reverse_row_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_row_iterator
 
typedef std::reverse_iterator
< col_iterator
reverse_col_iterator
 
typedef std::reverse_iterator
< const_col_iterator
const_reverse_col_iterator
 
typedef std::reverse_iterator
< iterator2d
reverse_iterator2d
 
typedef std::reverse_iterator
< const_iterator2d
const_reverse_iterator2d
 
typedef std::reverse_iterator
< row_range_iterator
reverse_row_range_iterator
 
typedef std::reverse_iterator
< const_row_range_iterator
const_reverse_row_range_iterator
 
typedef std::reverse_iterator
< col_range_iterator
reverse_col_range_iterator
 
typedef std::reverse_iterator
< const_col_range_iterator
const_reverse_col_range_iterator
 
typedef std::reverse_iterator
< iterator2d_range
reverse_iterator2d_range
 
typedef std::reverse_iterator
< const_iterator2d_range
const_reverse_iterator2d_range
 
typedef iterator2d default_iterator
 
typedef const_iterator2d const_default_iterator
 

Public Member Functions

void resize (const size_type d1, const size_type d2, const T &val=T())
 Resizes a Array2d. More...
 
std::string name () const
 Returns the name of the class. More...
 
size_type dim1 () const
 Returns the number of rows (first dimension size) in the Array2d. More...
 
size_type rows () const
 Returns the number of rows (first dimension size) in the Array2d. More...
 
size_type dim2 () const
 Returns the number of columns (second dimension size) in the Array2d. More...
 
size_type columns () const
 Returns the number of columns (second dimension size) in the Array2d. More...
 
size_type cols () const
 Returns the number of columns (second dimension size) in the Array2d. More...
 
size_type size () const
 Returns the number of elements in the Array2d. More...
 
size_type max_size () const
 Returns the maximal size (number of elements) in the Array2d. More...
 
bool empty () const
 Returns true if the Array2d is empty. (Thus size() == 0) More...
 
void swap (self &M)
 Swaps data with another Array. More...
 
template<typename T>
 Array2d (const typename Array2d< T >::size_type d1, const typename Array2d< T >::size_type d2)
 
template<typename T>
 Array2d (const typename Array2d< T >::size_type d1, const typename Array2d< T >::size_type d2, const T &val)
 
template<typename T>
 Array2d (const typename Array2d< T >::size_type d1, const typename Array2d< T >::size_type d2, const T *val)
 
Constructors & Destructors
 Array2d ()
 Constructs a Array2d. More...
 
 Array2d (const size_type d1, const size_type d2)
 Constructs a Array2d. More...
 
 Array2d (const size_type d1, const size_type d2, const T &val)
 Constructs a Array2d initialized by the scalar value val. More...
 
 Array2d (const size_type d1, const size_type d2, const T *val)
 Constructs a Array2d initialized by an array val. More...
 
template<typename InputIterator >
 Array2d (const size_type d1, const size_type d2, InputIterator first, InputIterator last)
 Contructs a Array2d from a range. More...
 
 Array2d (const self &rhs)
 Constructs a copy of the Array2d rhs. More...
 
 ~Array2d ()
 Destructor of the Array2d. More...
 
iterators
iterator begin ()
 Returns a read/write iterator that points to the first element in the Array2d. Iteration is done in ordinary element order. More...
 
iterator end ()
 Returns a read/write iterator that points one past the last element in the Array2d. 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 Array2d. 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 Array2d. 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 Array2d. 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 Array2d. 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 Array2d. 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 in the Array2d. Iteration is done in reverse element order. More...
 
row_iterator row_begin (const size_type row)
 Returns a read/write iterator that points to the first element of the row row in the Array2d. Iteration is done in ordinary element order. More...
 
row_iterator row_end (const size_type row)
 Returns a read/write iterator that points one past the end element of the row row in the Array2d. Iteration is done in ordinary element order. More...
 
const_row_iterator row_begin (const size_type row) const
 Returns a read-only iterator that points to the first element of the row row in the Array2d. Iteration is done in ordinary element order. More...
 
const_row_iterator row_end (const size_type row) const
 Returns a read-only iterator that points one past the end element of the row row in the Array2d. Iteration is done in ordinary element order. More...
 
col_iterator col_begin (const size_type col)
 Returns a read/write iterator that points to the first element of the column column in the Array2d. Iteration is done modulo the number of columns. More...
 
col_iterator col_end (const size_type col)
 Returns a read/write iterator that points one past the end element of the column column in the Array2d. Iteration is done modulo the number of columns. More...
 
const_col_iterator col_begin (const size_type col) const
 Returns a read-only iterator that points to the first element of the column column in the Array2d. Iteration is done modulo the number of columns. More...
 
const_col_iterator col_end (const size_type col) const
 Returns a read-only iterator that points one past the end element of the column column in the Array2d. Iteration is done modulo the number of columns. More...
 
row_range_iterator row_begin (const size_type row, const slip::Range< int > &range)
 Returns a read/write iterator that points to the first element of the Range range of the row row in the Array2d. Iteration is done in ordinary element order according to the Range. More...
 
row_range_iterator row_end (const size_type row, const slip::Range< int > &range)
 Returns a read/write iterator that points one past the end element of the Range range of the row row in the Array2d. Iteration is done in ordinary element order according to the Range. More...
 
const_row_range_iterator row_begin (const size_type row, const slip::Range< int > &range) const
 Returns a read-only iterator that points to the first element of the Range range of the row row in the Array2d. Iteration is done in ordinary element order according to the Range. More...
 
const_row_range_iterator row_end (const size_type row, const slip::Range< int > &range) const
 Returns a read_only iterator that points one past the last element of the Range range of the row row in the Array2d. Iteration is done in ordinary element order according to the Range. More...
 
col_range_iterator col_begin (const size_type col, const slip::Range< int > &range)
 Returns a read-write iterator that points to the first element of the Range range of the col col in the Array2d. Iteration is done in ordinary element order according to the Range. More...
 
col_range_iterator col_end (const size_type col, const slip::Range< int > &range)
 Returns a read-write iterator that points to the past the end element of the Range range of the col col in the Array2d. Iteration is done in ordinary element order according to the Range. More...
 
const_col_range_iterator col_begin (const size_type col, const slip::Range< int > &range) const
 Returns a read-only iterator that points to the first element of the Range range of the col col in the Array2d. Iteration is done in ordinary element order according to the Range. More...
 
const_col_range_iterator col_end (const size_type col, const slip::Range< int > &range) const
 Returns a read-only iterator that points to the past the end element of the Range range of the col col in the Array2d. Iteration is done in ordinary element order according to the Range. More...
 
reverse_row_iterator row_rbegin (const size_type row)
 Returns a read/write reverse iterator that points to the last element of the row row in the Array2d. Iteration is done in the reverse element order. More...
 
reverse_row_iterator row_rend (const size_type row)
 Returns a read/write reverse iterator that points one past the first element of the row row in the Array2d. Iteration is done in the reverse element order. More...
 
const_reverse_row_iterator row_rbegin (const size_type row) const
 Returns a read-only reverse iterator that points to the last element of the row row in the Array2d. Iteration is done in the reverse element order. More...
 
const_reverse_row_iterator row_rend (const size_type row) const
 Returns a read-only reverse iterator that points one past the first element of the row row in the Array2d. Iteration is done in the reverse element order. More...
 
reverse_col_iterator col_rbegin (const size_type col)
 Returns a read/write reverse iterator that points to the last element of the column column in the Array2d. Iteration is done modulo the number of columns and in the reverse element order. More...
 
reverse_col_iterator col_rend (const size_type col)
 Returns a read/write reverse iterator that points one past the first element of the column column in the Array2d. Iteration is done modulo the number of columns and in the reverse element order. More...
 
const_reverse_col_iterator col_rbegin (const size_type col) const
 Returns a read-only reverse iterator that points to the last element of the column column in the Array2d. Iteration is done modulo the number of columns and in the reverse element order. More...
 
const_reverse_col_iterator col_rend (const size_type col) const
 Returns a read-only reverse iterator that points one past the first element of the column column in the Array2d. Iteration is done modulo the number of columns and in the reverse element order. More...
 
reverse_row_range_iterator row_rbegin (const size_type row, const slip::Range< int > &range)
 Returns a read-write iterator that points to the last element of the Range range of the row row in the Array2d. Iteration is done in the reverse element order according to the Range. More...
 
reverse_row_range_iterator row_rend (const size_type row, const slip::Range< int > &range)
 Returns a read-write iterator that points one before the first element of the Range range of the row row in the Array2d. Iteration is done in the reverse element order according to the Range. More...
 
const_reverse_row_range_iterator row_rbegin (const size_type row, const slip::Range< int > &range) const
 Returns a read-only iterator that points to the last element of the Range range of the row row in the Array2d. Iteration is done in the reverse element order according to the Range. More...
 
const_reverse_row_range_iterator row_rend (const size_type row, const slip::Range< int > &range) const
 Returns a read-only iterator that points one before the first element of the Range range of the row row in the Array2d. Iteration is done in the reverse element order according to the Range. More...
 
reverse_col_range_iterator col_rbegin (const size_type col, const slip::Range< int > &range)
 Returns a read-write iterator that points to the last element of the Range range of the col col in the Array2d. Iteration is done in the reverse element order according to the Range. More...
 
reverse_col_range_iterator col_rend (const size_type col, const slip::Range< int > &range)
 Returns a read-write iterator that points to one before the first element of the Range range of the col col in the Array2d. Iteration is done in the reverse element order according to the Range. More...
 
const_reverse_col_range_iterator col_rbegin (const size_type col, const slip::Range< int > &range) const
 Returns a read_only iterator that points to the last element of the Range & range of the col col in the Array2d. Iteration is done in the reverse element order according to the Range. More...
 
const_reverse_col_range_iterator col_rend (const size_type col, const slip::Range< int > &range) const
 Returns a read-only iterator that points to the first element of the Range range of the col col in the Array2d. Iteration is done in the reverse element order according to the Range. More...
 
iterator2d upper_left ()
 Returns a read/write iterator2d that points to the first element of the Array2d. It points to the upper left element of the Array2d. More...
 
iterator2d bottom_right ()
 Returns a read/write iterator2d that points to the past the end element of the Array2d. It points to past the end element of the bottom right element of the Array2d. More...
 
const_iterator2d upper_left () const
 Returns a read-only iterator2d that points to the first element of the Array2d. It points to the upper left element of the Array2d. More...
 
const_iterator2d bottom_right () const
 Returns a read-only iterator2d that points to the past the end element of the Array2d. It points to past the end element of the bottom right element of the Array2d. More...
 
iterator2d upper_left (const Box2d< int > &box)
 Returns a read/write iterator2d that points to the first element of the Array2d. It points to the upper left element of the Box2d associated to the Array2d. More...
 
iterator2d bottom_right (const Box2d< int > &box)
 Returns a read/write iterator2d that points to the past the end element of the Array2d. It points to past the end element of the bottom right element of the Box2d associated to the Array2d. More...
 
const_iterator2d upper_left (const Box2d< int > &box) const
 Returns a read only iterator2d that points to the first element of the Array2d. It points to the upper left element of the Box2d associated to the Array2d. More...
 
const_iterator2d bottom_right (const Box2d< int > &box) const
 Returns a read only iterator2d that points to the past the end element of the Array2d. It points to past the end element of the bottom right element of the Box2d associated to the Array2d. More...
 
iterator2d_range upper_left (const Range< int > &row_range, const Range< int > &col_range)
 Returns a read/write iterator2d_range that points to the upper left element of the ranges row_range and col_range associated to the Array2d. More...
 
iterator2d_range bottom_right (const Range< int > &row_range, const Range< int > &col_range)
 Returns a read/write iterator2d_range that points to the past the end bottom right element of the ranges row_range and col_range associated to the Array2d. More...
 
const_iterator2d_range upper_left (const Range< int > &row_range, const Range< int > &col_range) const
 Returns a read-only iterator2d_range that points to the to the upper left element of the ranges row_range and col_range associated to the Array2d. More...
 
const_iterator2d_range bottom_right (const Range< int > &row_range, const Range< int > &col_range) const
 Returns a read-only iterator2d_range that points to the past the end bottom right element of the ranges row_range and col_range associated to the Array2d. More...
 
iterator2d_range upper_left (const Range< int > &range)
 Returns a read/write iterator2d_range that points to the upper left element of the Range range associated to the Array2d. The same range is applied for rows and cols. More...
 
iterator2d_range bottom_right (const Range< int > &range)
 Returns a read/write iterator2d_range that points to the past the end bottom right element of the Range range associated to the Array2d. The same range is applied for rows and cols. More...
 
const_iterator2d_range upper_left (const Range< int > &range) const
 Returns a read-only iterator2d_range that points to the to the upper left element of the Range range associated to the Array2d. More...
 
const_iterator2d_range bottom_right (const Range< int > &range) const
 Returns a read-only const_iterator2d_range that points to the past the end bottom right element of the Range range associated to the Array2d. The same range is applied for rows and cols. More...
 
reverse_iterator2d rupper_left ()
 Returns a read/write reverse iterator2d. It points to the bottom right element of the Array2d. Iteration is done within the Array2d in the reverse order. More...
 
reverse_iterator2d rbottom_right ()
 Returns a read/write reverse iterator2d. It points to past the upper left element of the Array2d. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d rupper_left () const
 Returns a read only reverse iterator2d that points. It points to the bottom right element of the Array2d. Iteration is done within the Array2d in the reverse order. More...
 
const_reverse_iterator2d rbottom_right () const
 Returns a read only reverse iterator2d. It points to past the upper left element of the Array2d. Iteration is done in the reverse order. More...
 
reverse_iterator2d rupper_left (const Box2d< int > &box)
 Returns a read/write reverse iterator2d. It points to the bottom right element of the Box2d associated to the Array2d. Iteration is done in the reverse order. More...
 
reverse_iterator2d rbottom_right (const Box2d< int > &box)
 Returns a read/write reverse iterator2d. It points to one before the upper left element of the Box2d box associated to the Array2d. More...
 
const_reverse_iterator2d rupper_left (const Box2d< int > &box) const
 Returns a read only reverse iterator2d. It points to the bottom right element of the Box2d box associated to the Array2d. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d rbottom_right (const Box2d< int > &box) const
 Returns a read-only reverse iterator2d. It points to one before the element of the bottom right element of the Box2d box associated to the Array2d. More...
 
reverse_iterator2d_range rupper_left (const Range< int > &row_range, const Range< int > &col_range)
 Returns a read/write reverse_iterator2d_range that points to the past the bottom right element of the ranges row_range and col_range associated to the Array2d. Iteration is done in the reverse order. More...
 
reverse_iterator2d_range rbottom_right (const Range< int > &row_range, const Range< int > &col_range)
 Returns a read/write reverse_iterator2d_range that points to one before the upper left element of the ranges row_range and col_range associated to the Array2d. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d_range rupper_left (const Range< int > &row_range, const Range< int > &col_range) const
 Returns a read-only reverse_iterator2d_range that points to the past the bottom right element of the ranges row_range and col_range associated to the Array2d. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d_range rbottom_right (const Range< int > &row_range, const Range< int > &col_range) const
 Returns a read-only reverse_iterator2d_range that points to one before the upper left element of the ranges row_range and col_range associated to the Array2d.Iteration is done in the reverse order. More...
 
reverse_iterator2d_range rupper_left (const Range< int > &range)
 Returns a read/write reverse_iterator2d_range that points to the bottom right element of the Range range associated to the Array2d. The same range is applied for rows and cols. Iteration is done in the reverse order. More...
 
reverse_iterator2d_range rbottom_right (const Range< int > &range)
 Returns a read/write reverse_iterator2d_range that points to one before the upper left element of the Range range associated to the Array2d. The same range is applied for rows and cols. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d_range rupper_left (const Range< int > &range) const
 Returns a read-only reverse_iterator2d_range that points to the to the bottom right element of the Range range associated to the Array2d. The same range is applied for rows and cols. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d_range rbottom_right (const Range< int > &range) const
 Returns a read_only reverse_iterator2d_range that points to one before the upper left element of the Range range associated to the Array2d. The same range is applied for rows and cols. Iteration is done in the reverse order. More...
 
Assignment operators and methods
selfoperator= (const self &rhs)
 Assign a Array2d. More...
 
selfoperator= (const T &value)
 Assign all the elments of the Array2d by value. More...
 
void fill (const T &value)
 Fills the container range [begin(),begin()+size()) with copies of value. More...
 
void fill (const T *value)
 Fills the container range [begin(),begin()+size()) with a copy of the value array. More...
 
template<typename InputIterator >
void fill (InputIterator first, InputIterator last)
 Fills the container range [begin(),begin()+size()) with a copy of the range [first,last) More...
 
Element access operators
pointer operator[] (const size_type i)
 Subscript access to the row datas contained in the Array2d. More...
 
const_pointer operator[] (const size_type i) const
 Subscript access to the row datas contained in the Array2d. More...
 
reference operator() (const size_type i, const size_type j)
 Subscript access to the data contained in the Array2d. More...
 
const_reference operator() (const size_type i, const size_type j) const
 Subscript access to the data contained in the Array2d. More...
 
reference operator() (const Point2d< size_type > &point2d)
 Subscript access to the data contained in the Array2d. More...
 
const_reference operator() (const Point2d< size_type > &point2d) const
 Subscript access to the data contained in the Array2d. More...
 
self operator() (const Range< int > &row_range, const Range< int > &col_range)
 Subscript access to the data contained in the Array2d. More...
 

Static Public Attributes

static const std::size_t DIM = 2
 

Friends

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

Detailed Description

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

This is a two-dimensional dynamic and generic container. This container statisfies the BidirectionnalContainer concepts of the STL. It is also an 2d extension of the RandomAccessContainer concept. That is to say the bracket element access is replaced by the double bracket element access.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Version
0.0.3
Date
2007/12/15
Since
1.0.0
Parameters
TType of the element in the Array2d
Axis conventions:
iterator2d_conventions.jpg
axis and notation conventions
Examples:
color_gaussian_filter.cpp.

Definition at line 135 of file Array2d.hpp.

Member Typedef Documentation

template<typename T>
typedef slip::stride_iterator<pointer> slip::Array2d< T >::col_iterator

Definition at line 215 of file Array2d.hpp.

Definition at line 223 of file Array2d.hpp.

Definition at line 216 of file Array2d.hpp.

Definition at line 224 of file Array2d.hpp.

template<typename T>
typedef const_iterator2d slip::Array2d< T >::const_default_iterator

Definition at line 244 of file Array2d.hpp.

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

Definition at line 207 of file Array2d.hpp.

Definition at line 219 of file Array2d.hpp.

Definition at line 227 of file Array2d.hpp.

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

Definition at line 200 of file Array2d.hpp.

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

Definition at line 197 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<const_col_iterator> slip::Array2d< T >::const_reverse_col_iterator

Definition at line 232 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<const_col_range_iterator> slip::Array2d< T >::const_reverse_col_range_iterator

Definition at line 238 of file Array2d.hpp.

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

Definition at line 210 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<const_iterator2d> slip::Array2d< T >::const_reverse_iterator2d

Definition at line 234 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<const_iterator2d_range> slip::Array2d< T >::const_reverse_iterator2d_range

Definition at line 240 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<const_iterator> slip::Array2d< T >::const_reverse_row_iterator

Definition at line 230 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<const_row_range_iterator> slip::Array2d< T >::const_reverse_row_range_iterator

Definition at line 236 of file Array2d.hpp.

template<typename T>
typedef const_pointer slip::Array2d< T >::const_row_iterator

Definition at line 213 of file Array2d.hpp.

Definition at line 222 of file Array2d.hpp.

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

Definition at line 194 of file Array2d.hpp.

template<typename T>
typedef iterator2d slip::Array2d< T >::default_iterator

Definition at line 243 of file Array2d.hpp.

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

Definition at line 203 of file Array2d.hpp.

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

Definition at line 206 of file Array2d.hpp.

template<typename T>
typedef slip::iterator2d_box<self> slip::Array2d< T >::iterator2d

Definition at line 218 of file Array2d.hpp.

template<typename T>
typedef slip::iterator2d_range<self> slip::Array2d< T >::iterator2d_range

Definition at line 226 of file Array2d.hpp.

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

Definition at line 199 of file Array2d.hpp.

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

Definition at line 196 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<col_iterator> slip::Array2d< T >::reverse_col_iterator

Definition at line 231 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<col_range_iterator> slip::Array2d< T >::reverse_col_range_iterator

Definition at line 237 of file Array2d.hpp.

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

Definition at line 209 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<iterator2d> slip::Array2d< T >::reverse_iterator2d

Definition at line 233 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<iterator2d_range> slip::Array2d< T >::reverse_iterator2d_range

Definition at line 239 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<iterator> slip::Array2d< T >::reverse_row_iterator

Definition at line 229 of file Array2d.hpp.

template<typename T>
typedef std::reverse_iterator<row_range_iterator> slip::Array2d< T >::reverse_row_range_iterator

Definition at line 235 of file Array2d.hpp.

template<typename T>
typedef pointer slip::Array2d< T >::row_iterator

Definition at line 212 of file Array2d.hpp.

template<typename T>
typedef slip::stride_iterator<pointer> slip::Array2d< T >::row_range_iterator

Definition at line 221 of file Array2d.hpp.

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

Definition at line 193 of file Array2d.hpp.

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

Definition at line 204 of file Array2d.hpp.

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

Definition at line 192 of file Array2d.hpp.

Constructor & Destructor Documentation

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

Constructs a Array2d.

Definition at line 2253 of file Array2d.hpp.

template<typename T>
slip::Array2d< T >::Array2d ( const size_type  d1,
const size_type  d2 
)

Constructs a Array2d.

Parameters
d1first dimension of the Array2d
d2second dimension of the Array2d
The Array2d is initialized by the default value of T.
template<typename T>
slip::Array2d< T >::Array2d ( const size_type  d1,
const size_type  d2,
const T &  val 
)

Constructs a Array2d initialized by the scalar value val.

Parameters
d1first dimension of the Array2d
d2second dimension of the Array2d
valinitialization value of the elements
template<typename T>
slip::Array2d< T >::Array2d ( const size_type  d1,
const size_type  d2,
const T *  val 
)

Constructs a Array2d initialized by an array val.

Parameters
d1first dimension of the Array2d
d2second dimension of the Array2d
valinitialization array value of the elements
template<typename T>
template<typename InputIterator >
slip::Array2d< T >::Array2d ( const size_type  d1,
const size_type  d2,
InputIterator  first,
InputIterator  last 
)
inline

Contructs a Array2d from a range.

Parameters
d1first dimension of the Array2d
d2second dimension of the Array2d
firstAn input iterator.
lastAn input iterator.

Create a Array2d consisting of copies of the elements from [first,last).

Definition at line 298 of file Array2d.hpp.

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

Constructs a copy of the Array2d rhs.

Definition at line 2291 of file Array2d.hpp.

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

Destructor of the Array2d.

Definition at line 3186 of file Array2d.hpp.

template<typename T>
template<typename T>
slip::Array2d< T >::Array2d ( const typename Array2d< T >::size_type  d1,
const typename Array2d< T >::size_type  d2 
)
inline

Definition at line 2259 of file Array2d.hpp.

template<typename T>
template<typename T>
slip::Array2d< T >::Array2d ( const typename Array2d< T >::size_type  d1,
const typename Array2d< T >::size_type  d2,
const T &  val 
)
inline

Definition at line 2269 of file Array2d.hpp.

template<typename T>
template<typename T>
slip::Array2d< T >::Array2d ( const typename Array2d< T >::size_type  d1,
const typename Array2d< T >::size_type  d2,
const T *  val 
)
inline

Definition at line 2280 of file Array2d.hpp.

Member Function Documentation

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

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

Returns
begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 and A2 in S
std::transform(A1.begin(),A1.end(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2345 of file Array2d.hpp.

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

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

Returns
const begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Array2d<double> const A1(10,9);
slip::Array2d<double> const A2(10,9);
//copy the sum of A1 and A2 in S
std::transform(A1.begin(),A1.end(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2359 of file Array2d.hpp.

template<typename T >
Array2d< T >::iterator2d slip::Array2d< T >::bottom_right ( )
inline

Returns a read/write iterator2d that points to the past the end element of the Array2d. It points to past the end element of the bottom right element of the Array2d.

Returns
begin iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
//copy the elements of A1 in A2
std::copy(A1.upper_left(),A1.bottom_right(),A2.upper_left());

Definition at line 2759 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_iterator2d slip::Array2d< T >::bottom_right ( ) const
inline

Returns a read-only iterator2d that points to the past the end element of the Array2d. It points to past the end element of the bottom right element of the Array2d.

Returns
begin const iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
//copy the elements of A1 in A2
std::copy(A1.upper_left(),A1.bottom_right(),A2.upper_left());

Definition at line 2768 of file Array2d.hpp.

template<typename T >
Array2d< T >::iterator2d slip::Array2d< T >::bottom_right ( const Box2d< int > &  box)
inline

Returns a read/write iterator2d that points to the past the end element of the Array2d. It points to past the end element of the bottom right element of the Box2d associated to the Array2d.

Parameters
boxa Box2d defining the range of indices to iterate within the Array2d.
Returns
end iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Precondition
The box indices must be inside the range of the Array2d ones.
Example:
slip::Box2d<int> box(1,1,3,2);
//copy the elements of A1 inside the box which upper_left element
//is located in (1,1) and the bottom right element is in (3,2)
std::copy(A1.upper_left(box),A1.bottom_right(box),A2.upper_left());

Definition at line 2793 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_iterator2d slip::Array2d< T >::bottom_right ( const Box2d< int > &  box) const
inline

Returns a read only iterator2d that points to the past the end element of the Array2d. It points to past the end element of the bottom right element of the Box2d associated to the Array2d.

Parameters
boxa Box2d defining the range of indices to iterate within the Array2d.
Returns
end const iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Precondition
The box indices must be inside the range of the Array2d ones.
Example:
slip::Box2d<int> box(1,1,3,2);
//copy the elements of A1 inside the box which upper_left element
//is located in (1,1) and the bottom right element is in (3,2)
std::copy(A1.upper_left(box),A1.bottom_right(box),A2.upper_left());

Definition at line 2803 of file Array2d.hpp.

template<typename T >
Array2d< T >::iterator2d_range slip::Array2d< T >::bottom_right ( const Range< int > &  row_range,
const Range< int > &  col_range 
)
inline

Returns a read/write iterator2d_range that points to the past the end bottom right element of the ranges row_range and col_range associated to the Array2d.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the Array2d ones.
Returns
iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> row_range(0,A1.dim2()-1,2);
slip::Range<int> col_range(0,A1.dim1()-1,2);
//copy the elements of A1 within the ranges row_range and col_range
//in A2
std::copy(A1.upper_left(row_range,col_range),
A1.bottom_right(row_range,col_range),A2.upper_left());

Definition at line 2831 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_iterator2d_range slip::Array2d< T >::bottom_right ( const Range< int > &  row_range,
const Range< int > &  col_range 
) const
inline

Returns a read-only iterator2d_range that points to the past the end bottom right element of the ranges row_range and col_range associated to the Array2d.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the Array2d ones.
Returns
const_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> row_range(0,A1.dim2()-1,2);
slip::Range<int> col_range(0,A1.dim1()-1,2);
//copy the elements of A1 within the ranges row_range and col_range
//in A2
std::copy(A1.upper_left(row_range,col_range),
A1.bottom_right(row_range,col_range),A2.upper_left());

Definition at line 2841 of file Array2d.hpp.

template<typename T >
Array2d< T >::iterator2d_range slip::Array2d< T >::bottom_right ( const Range< int > &  range)
inline

Returns a read/write iterator2d_range that points to the past the end bottom right element of the Range range associated to the Array2d. The same range is applied for rows and cols.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the Array2d ones.
Returns
iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of A1 within the range range
//in A2
std::copy(A1.upper_left(range),A1.bottom_right(range),A2.upper_left());

Definition at line 2868 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_iterator2d_range slip::Array2d< T >::bottom_right ( const Range< int > &  range) const
inline

Returns a read-only const_iterator2d_range that points to the past the end bottom right element of the Range range associated to the Array2d. The same range is applied for rows and cols.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the Array2d ones.
Returns
const_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of A1 within the range range
//in A2
std::copy(A1.upper_left(range),A1.bottom_right(range),A2.upper_left());

Definition at line 2876 of file Array2d.hpp.

template<typename T>
col_iterator slip::Array2d< T >::col_begin ( const size_type  col)

Returns a read/write iterator that points to the first element of the column column in the Array2d. Iteration is done modulo the number of columns.

Parameters
colThe index of the column to iterate.
Returns
begin col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d
Example:
//copy the elements of the column 0 of A1 in the column 1 of A2
std::copy(A1.col_begin(0),A1.col_end(0),A2.col_begin(1));
template<typename T>
const_col_iterator slip::Array2d< T >::col_begin ( const size_type  col) const

Returns a read-only iterator that points to the first element of the column column in the Array2d. Iteration is done modulo the number of columns.

Parameters
colThe index of the column to iterate.
Returns
begin const_col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
Example:
//copy the elements of the column 0 of A1 in the column 1 of A2
std::copy(A1.col_begin(0),A1.col_end(0),A2.col_begin(1));
template<typename T>
col_range_iterator slip::Array2d< T >::col_begin ( const size_type  col,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points to the first element of the Range range of the col col in the Array2d. Iteration is done in ordinary element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate
Returns
begin col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
Example:
slip::Range<int> range(0,A1.dim1()-1,2);
//copy the elements of the column 0 of A1 iterated according to the
//range in the column 1 of A2
std::copy(A1.col_begin(0,range),A1.col_end(0,range),A2.col_begin(1));
template<typename T>
const_col_range_iterator slip::Array2d< T >::col_begin ( const size_type  col,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points to the first element of the Range range of the col col in the Array2d. Iteration is done in ordinary element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
begin const_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
Example:
slip::Range<int> range(0,A1.dim1()-1,2);
//copy the elements of the column 0 of A1 iterated according to the
//range in the column 1 of A2
std::copy(A1.col_begin(0,range),A1.col_end(0,range),A2.col_begin(1));
template<typename T>
col_iterator slip::Array2d< T >::col_end ( const size_type  col)

Returns a read/write iterator that points one past the end element of the column column in the Array2d. Iteration is done modulo the number of columns.

Parameters
colThe index of the column to iterate.
Returns
begin col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
Example:
//copy the elements of the column 0 of A1 in the column 1 of A2
std::copy(A1.col_begin(0),A1.col_end(0),A2.col_begin(1));
template<typename T>
const_col_iterator slip::Array2d< T >::col_end ( const size_type  col) const

Returns a read-only iterator that points one past the end element of the column column in the Array2d. Iteration is done modulo the number of columns.

Parameters
colThe index of the column
Returns
begin const_col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
Example:
//copy the elements of the column 0 of A1 in the column 1 of A2
std::copy(A1.col_begin(0),A1.col_end(0),A2.col_begin(1));
template<typename T>
col_range_iterator slip::Array2d< T >::col_end ( const size_type  col,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points to the past the end element of the Range range of the col col in the Array2d. Iteration is done in ordinary element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
begin col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
Example:
slip::Range<int> range(0,A1.dim1()-1,2);
//copy the elements of the column 0 of A1 iterated according to the
//range in the column 1 of A2
std::copy(A1.col_begin(0,range),A1.col_end(0,range),A2.col_begin(1));
template<typename T>
const_col_range_iterator slip::Array2d< T >::col_end ( const size_type  col,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points to the past the end element of the Range range of the col col in the Array2d. Iteration is done in ordinary element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate
Returns
begin const_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
Example:
slip::Range<int> range(0,A1.dim1()-1,2);
//copy the elements of the column 0 of A1 iterated according to the
//range in the column 1 of A2
std::copy(A1.col_begin(0,range),A1.col_end(0,range),A2.col_begin(1));
template<typename T>
reverse_col_iterator slip::Array2d< T >::col_rbegin ( const size_type  col)

Returns a read/write reverse iterator that points to the last element of the column column in the Array2d. Iteration is done modulo the number of columns and in the reverse element order.

Parameters
colThe index of the column to iterate.
Returns
begin col_reverse_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
template<typename T>
const_reverse_col_iterator slip::Array2d< T >::col_rbegin ( const size_type  col) const

Returns a read-only reverse iterator that points to the last element of the column column in the Array2d. Iteration is done modulo the number of columns and in the reverse element order.

Parameters
colThe index of the column to iterate.
Returns
begin const_reverse_col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
template<typename T>
reverse_col_range_iterator slip::Array2d< T >::col_rbegin ( const size_type  col,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points to the last element of the Range range of the col col in the Array2d. Iteration is done in the reverse element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
begin reverse_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
template<typename T>
const_reverse_col_range_iterator slip::Array2d< T >::col_rbegin ( const size_type  col,
const slip::Range< int > &  range 
) const

Returns a read_only iterator that points to the last element of the Range & range of the col col in the Array2d. Iteration is done in the reverse element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
begin const_reverse_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
template<typename T>
reverse_col_iterator slip::Array2d< T >::col_rend ( const size_type  col)

Returns a read/write reverse iterator that points one past the first element of the column column in the Array2d. Iteration is done modulo the number of columns and in the reverse element order.

Parameters
colThe index of the column to iterate.
Returns
end reverse_col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
template<typename T>
const_reverse_col_iterator slip::Array2d< T >::col_rend ( const size_type  col) const

Returns a read-only reverse iterator that points one past the first element of the column column in the Array2d. Iteration is done modulo the number of columns and in the reverse element order.

Parameters
colThe index of the column to iterate.
Returns
end const_reverse_col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
template<typename T>
reverse_col_range_iterator slip::Array2d< T >::col_rend ( const size_type  col,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points to one before the first element of the Range range of the col col in the Array2d. Iteration is done in the reverse element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
reverse_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
template<typename T>
const_reverse_col_range_iterator slip::Array2d< T >::col_rend ( const size_type  col,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points to the first element of the Range range of the col col in the Array2d. Iteration is done in the reverse element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
const_reverse_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
template<typename T >
Array2d< T >::size_type slip::Array2d< T >::cols ( ) const
inline

Returns the number of columns (second dimension size) in the Array2d.

Definition at line 3155 of file Array2d.hpp.

template<typename T >
Array2d< T >::size_type slip::Array2d< T >::columns ( ) const
inline

Returns the number of columns (second dimension size) in the Array2d.

Definition at line 3150 of file Array2d.hpp.

template<typename T >
Array2d< T >::size_type slip::Array2d< T >::dim1 ( ) const
inline

Returns the number of rows (first dimension size) in the Array2d.

Definition at line 3134 of file Array2d.hpp.

template<typename T >
Array2d< T >::size_type slip::Array2d< T >::dim2 ( ) const
inline

Returns the number of columns (second dimension size) in the Array2d.

Definition at line 3145 of file Array2d.hpp.

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

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

Definition at line 3173 of file Array2d.hpp.

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

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

Returns
end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 and A2 in S
std::transform(A1.begin(),A1.end(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2352 of file Array2d.hpp.

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

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

Returns
const end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
slip::Array2d<double> const A1(10,9);
slip::Array2d<double> const A2(10,9);
//copy the sum of the elements of A1 and A2 in S
std::transform(A1.begin(),A1.end(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2366 of file Array2d.hpp.

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

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

Parameters
valueA reference-to-const of arbitrary type.

Definition at line 1923 of file Array2d.hpp.

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

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

Parameters
valueA pointer of arbitrary type.

Definition at line 1934 of file Array2d.hpp.

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

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

Parameters
firstAn input iterator.
lastAn input iterator.

Definition at line 1948 of file Array2d.hpp.

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

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

Definition at line 3165 of file Array2d.hpp.

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

Returns the name of the class.

Definition at line 3128 of file Array2d.hpp.

template<typename T>
reference slip::Array2d< T >::operator() ( const size_type  i,
const size_type  j 
)

Subscript access to the data contained in the Array2d.

Parameters
iThe index of the row for which the data should be accessed.
jThe index of the columns for which the data should be accessed.
Returns
Read/write reference to data.
Precondition
i < rows()
j < columns()

This operator allows for easy, 2d 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::Array2d< T >::operator() ( const size_type  i,
const size_type  j 
) const

Subscript access to the data contained in the Array2d.

Parameters
iThe index of the row for which the data should be accessed.
jThe index of the columns for which the data should be accessed.
Returns
Read_only (constant) reference to data.
Precondition
i < rows()
j < columns()

This operator allows for easy, 2d 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::Array2d< T >::operator() ( const Point2d< size_type > &  point2d)

Subscript access to the data contained in the Array2d.

Parameters
point2dA Point2d which indicate the subscripts of the data to access.
Returns
Read/write reference to data.
Precondition
point2d must be defined in the range of the Array2d.

This operator allows for easy, 2d 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::Array2d< T >::operator() ( const Point2d< size_type > &  point2d) const

Subscript access to the data contained in the Array2d.

Parameters
point2dA Point2d which indicate the subscripts of the data to access.
Returns
Read_only (constant) reference to data.
Precondition
point2d must be defined in the range of the Array2d.

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

template<typename T >
Array2d< T > slip::Array2d< T >::operator() ( const Range< int > &  row_range,
const Range< int > &  col_range 
)
inline

Subscript access to the data contained in the Array2d.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Returns
a copy of the range.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the Array2d ones.

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

Definition at line 3108 of file Array2d.hpp.

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

Assign a Array2d.

Assign elements of Array2d in rhs

Parameters
rhsArray2d to get the values from.
Returns

Definition at line 2303 of file Array2d.hpp.

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

Assign all the elments of the Array2d by value.

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

Definition at line 1911 of file Array2d.hpp.

template<typename T>
pointer slip::Array2d< T >::operator[] ( const size_type  i)

Subscript access to the row datas contained in the Array2d.

Parameters
iThe index of the row for which data should be accessed.
Returns
Read/write pointer to the row data.
Precondition
i < rows()

This operator allows for easy, 2d 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_pointer slip::Array2d< T >::operator[] ( const size_type  i) const

Subscript access to the row datas contained in the Array2d.

Parameters
iThe index of the row for which data should be accessed.
Returns
Read-only (constant) pointer to the row data.
Precondition
i < rows()

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

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

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

Returns
reverse begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 and A2
//in S (iterated in the reverse order element)
std::transform(A1.begin(),A1.end(),
A2.begin(),S.rbegin(),
std::plus<double>());

Definition at line 2374 of file Array2d.hpp.

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

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

Returns
const reverse begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 (iterated in the reverse order element)
//and A2 in S
std::transform(A1.rbegin(),A1.rend(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2381 of file Array2d.hpp.

template<typename T >
Array2d< T >::reverse_iterator2d slip::Array2d< T >::rbottom_right ( )
inline

Returns a read/write reverse iterator2d. It points to past the upper left element of the Array2d. Iteration is done in the reverse order.

Returns
reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2884 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_reverse_iterator2d slip::Array2d< T >::rbottom_right ( ) const
inline

Returns a read only reverse iterator2d. It points to past the upper left element of the Array2d. Iteration is done in the reverse order.

Returns
const reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2892 of file Array2d.hpp.

template<typename T >
Array2d< T >::reverse_iterator2d slip::Array2d< T >::rbottom_right ( const Box2d< int > &  box)
inline

Returns a read/write reverse iterator2d. It points to one before the upper left element of the Box2d box associated to the Array2d.

Parameters
boxA Box2d defining the range of indices to iterate within the Array2d.
Precondition
The box indices must be inside the range of the Array2d ones.
Returns
reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2918 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_reverse_iterator2d slip::Array2d< T >::rbottom_right ( const Box2d< int > &  box) const
inline

Returns a read-only reverse iterator2d. It points to one before the element of the bottom right element of the Box2d box associated to the Array2d.

Parameters
boxA Box2d defining the range of indices to iterate within the Array2d.
Precondition
The box indices must be inside the range of the Array2d ones.
Returns
const reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2926 of file Array2d.hpp.

template<typename T >
Array2d< T >::reverse_iterator2d_range slip::Array2d< T >::rbottom_right ( const Range< int > &  row_range,
const Range< int > &  col_range 
)
inline

Returns a read/write reverse_iterator2d_range that points to one before the upper left element of the ranges row_range and col_range associated to the Array2d. Iteration is done in the reverse order.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the Array2d ones.
Returns
reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2972 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_reverse_iterator2d_range slip::Array2d< T >::rbottom_right ( const Range< int > &  row_range,
const Range< int > &  col_range 
) const
inline

Returns a read-only reverse_iterator2d_range that points to one before the upper left element of the ranges row_range and col_range associated to the Array2d.Iteration is done in the reverse order.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the Array2d ones.
Returns
const_reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2981 of file Array2d.hpp.

template<typename T >
Array2d< T >::reverse_iterator2d_range slip::Array2d< T >::rbottom_right ( const Range< int > &  range)
inline

Returns a read/write reverse_iterator2d_range that points to one before the upper left element of the Range range associated to the Array2d. The same range is applied for rows and cols. Iteration is done in the reverse order.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the Array2d ones.
Returns
reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3006 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_reverse_iterator2d_range slip::Array2d< T >::rbottom_right ( const Range< int > &  range) const
inline

Returns a read_only reverse_iterator2d_range that points to one before the upper left element of the Range range associated to the Array2d. The same range is applied for rows and cols. Iteration is done in the reverse order.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the Array2d ones.
Returns
const_reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3014 of file Array2d.hpp.

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

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

Returns
reverse end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 and A2
//in S (iterated in the reverse order element)
std::transform(A1.begin(),A1.end(),
A2.begin(),S.rbegin(),
std::plus<double>());

Definition at line 2388 of file Array2d.hpp.

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

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

Returns
const reverse end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 (iterated in the reverse order element)
//and A2 in S
std::transform(A1.rbegin(),A1.rend(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2396 of file Array2d.hpp.

template<typename T>
void slip::Array2d< T >::resize ( const size_type  d1,
const size_type  d2,
const T &  val = T() 
)
inline

Resizes a Array2d.

Parameters
d1new first dimension
d2new second dimension
valnew value for all the elements

Definition at line 2323 of file Array2d.hpp.

template<typename T>
row_iterator slip::Array2d< T >::row_begin ( const size_type  row)

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

Parameters
rowThe index of the row to iterate.
Returns
begin row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
Example:
//copy the elements of the row 0 of A1 in the row 1 of A2
std::copy(A1.row_begin(0),A1.row_end(0),A2.row_begin(1));
template<typename T>
const_row_iterator slip::Array2d< T >::row_begin ( const size_type  row) const

Returns a read-only iterator that points to the first element of the row row in the Array2d. Iteration is done in ordinary element order.

Parameters
rowThe index of the row to iterate.
Returns
begin const_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
Example:
//copy the elements of the row 0 of A1 in the row 1 of A2
std::copy(A1.row_begin(0),A1.row_end(0),A2.row_begin(1));
template<typename T>
row_range_iterator slip::Array2d< T >::row_begin ( const size_type  row,
const slip::Range< int > &  range 
)

Returns a read/write iterator that points to the first element of the Range range of the row row in the Array2d. Iteration is done in ordinary element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate.
Returns
begin row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of the row 0 of A1 iterated according to the
//range in the row 1 of A2
std::copy(A1.row_begin(0,range),A1.row_end(0,range),A2.row_begin(1));
template<typename T>
const_row_range_iterator slip::Array2d< T >::row_begin ( const size_type  row,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points to the first element of the Range range of the row row in the Array2d. Iteration is done in ordinary element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate.
Returns
begin const_row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of the row 0 of A1 iterated according to the
//range in the row 1 of A2
std::copy(A1.row_begin(0,range),A1.row_end(0,range),A2.row_begin(1));
template<typename T>
row_iterator slip::Array2d< T >::row_end ( const size_type  row)

Returns a read/write iterator that points one past the end element of the row row in the Array2d. Iteration is done in ordinary element order.

Parameters
rowThe index of the row to iterate.
Returns
begin row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
Example:
//copy the elements of the row 0 of A1 in the row 1 of A2
std::copy(A1.row_begin(0),A1.row_end(0),A2.row_begin(1));
template<typename T>
const_row_iterator slip::Array2d< T >::row_end ( const size_type  row) const

Returns a read-only iterator that points one past the end element of the row row in the Array2d. Iteration is done in ordinary element order.

Parameters
rowThe index of the row to iterate.
Returns
begin const_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
Example:
//copy the elements of the row 0 of A1 in the row 1 of A2
std::copy(A1.row_begin(0),A1.row_end(0),A2.row_begin(1));
template<typename T>
row_range_iterator slip::Array2d< T >::row_end ( const size_type  row,
const slip::Range< int > &  range 
)

Returns a read/write iterator that points one past the end element of the Range range of the row row in the Array2d. Iteration is done in ordinary element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate.
Returns
end row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of the row 0 of A1 iterated according to the
//range in the row 1 of A2
std::copy(A1.row_begin(0,range),A1.row_end(0,range),A2.row_begin(1));
template<typename T>
const_row_range_iterator slip::Array2d< T >::row_end ( const size_type  row,
const slip::Range< int > &  range 
) const

Returns a read_only iterator that points one past the last element of the Range range of the row row in the Array2d. Iteration is done in ordinary element order according to the Range.

Parameters
rowRow to iterate.
rangeRange of the row to iterate
Returns
begin const_row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of the row 0 of A1 iterated according to the
//range in the row 1 of A2
std::copy(A1.row_begin(0,range),A1.row_end(0,range),A2.row_begin(1));
template<typename T>
reverse_row_iterator slip::Array2d< T >::row_rbegin ( const size_type  row)

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

Parameters
rowThe index of the row to iterate.
Returns
begin reverse_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
template<typename T>
const_reverse_row_iterator slip::Array2d< T >::row_rbegin ( const size_type  row) const

Returns a read-only reverse iterator that points to the last element of the row row in the Array2d. Iteration is done in the reverse element order.

Parameters
rowThe index of the row to iterate.
Returns
begin const_reverse_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
template<typename T>
reverse_row_range_iterator slip::Array2d< T >::row_rbegin ( const size_type  row,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points to the last element of the Range range of the row row in the Array2d. Iteration is done in the reverse element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate.
Returns
reverse_row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
template<typename T>
const_reverse_row_range_iterator slip::Array2d< T >::row_rbegin ( const size_type  row,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points to the last element of the Range range of the row row in the Array2d. Iteration is done in the reverse element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate
Returns
begin const_reverse_row_range_iterator value
Precondition
row must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
template<typename T>
reverse_row_iterator slip::Array2d< T >::row_rend ( const size_type  row)

Returns a read/write reverse iterator that points one past the first element of the row row in the Array2d. Iteration is done in the reverse element order.

Parameters
rowThe index of the row to iterate.
Returns
end reverse_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
template<typename T>
const_reverse_row_iterator slip::Array2d< T >::row_rend ( const size_type  row) const

Returns a read-only reverse iterator that points one past the first element of the row row in the Array2d. Iteration is done in the reverse element order.

Parameters
rowThe index of the row to iterate.
Returns
end const_reverse_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
template<typename T>
reverse_row_range_iterator slip::Array2d< T >::row_rend ( const size_type  row,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points one before the first element of the Range range of the row row in the Array2d. Iteration is done in the reverse element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate.
Returns
reverse_row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
template<typename T>
const_reverse_row_range_iterator slip::Array2d< T >::row_rend ( const size_type  row,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points one before the first element of the Range range of the row row in the Array2d. Iteration is done in the reverse element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate
Returns
const_reverse_row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the Array2d.
The range must be inside the whole range of the Array2d.
template<typename T >
Array2d< T >::size_type slip::Array2d< T >::rows ( ) const
inline

Returns the number of rows (first dimension size) in the Array2d.

Definition at line 3139 of file Array2d.hpp.

template<typename T >
Array2d< T >::reverse_iterator2d slip::Array2d< T >::rupper_left ( )
inline

Returns a read/write reverse iterator2d. It points to the bottom right element of the Array2d. Iteration is done within the Array2d in the reverse order.

Returns
reverse_iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2900 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_reverse_iterator2d slip::Array2d< T >::rupper_left ( ) const
inline

Returns a read only reverse iterator2d that points. It points to the bottom right element of the Array2d. Iteration is done within the Array2d in the reverse order.

Returns
const_reverse_iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2909 of file Array2d.hpp.

template<typename T >
Array2d< T >::reverse_iterator2d slip::Array2d< T >::rupper_left ( const Box2d< int > &  box)
inline

Returns a read/write reverse iterator2d. It points to the bottom right element of the Box2d associated to the Array2d. Iteration is done in the reverse order.

Parameters
boxa Box2d defining the range of indices to iterate within the Array2d.
Precondition
The box indices must be inside the range of the Array2d ones.
Returns
reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2934 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_reverse_iterator2d slip::Array2d< T >::rupper_left ( const Box2d< int > &  box) const
inline

Returns a read only reverse iterator2d. It points to the bottom right element of the Box2d box associated to the Array2d. Iteration is done in the reverse order.

Parameters
boxA Box2d defining the range of indices to iterate within the Array2d.
Precondition
The box indices must be inside the range of the Array2d ones.
Returns
const reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2943 of file Array2d.hpp.

template<typename T >
Array2d< T >::reverse_iterator2d_range slip::Array2d< T >::rupper_left ( const Range< int > &  row_range,
const Range< int > &  col_range 
)
inline

Returns a read/write reverse_iterator2d_range that points to the past the bottom right element of the ranges row_range and col_range associated to the Array2d. Iteration is done in the reverse order.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the Array2d ones.
Returns
reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2952 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_reverse_iterator2d_range slip::Array2d< T >::rupper_left ( const Range< int > &  row_range,
const Range< int > &  col_range 
) const
inline

Returns a read-only reverse_iterator2d_range that points to the past the bottom right element of the ranges row_range and col_range associated to the Array2d. Iteration is done in the reverse order.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the Array2d ones.
Returns
const_reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2962 of file Array2d.hpp.

template<typename T >
Array2d< T >::reverse_iterator2d_range slip::Array2d< T >::rupper_left ( const Range< int > &  range)
inline

Returns a read/write reverse_iterator2d_range that points to the bottom right element of the Range range associated to the Array2d. The same range is applied for rows and cols. Iteration is done in the reverse order.

Parameters
rangeThe range of the rows and the cols.
Precondition
range and must be valid.
The range indices must be inside the ranges of the Array2d ones.
Returns
reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2990 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_reverse_iterator2d_range slip::Array2d< T >::rupper_left ( const Range< int > &  range) const
inline

Returns a read-only reverse_iterator2d_range that points to the to the bottom right element of the Range range associated to the Array2d. The same range is applied for rows and cols. Iteration is done in the reverse order.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the Array2d ones.
Returns
const_reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 2998 of file Array2d.hpp.

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

Returns the number of elements in the Array2d.

Definition at line 3160 of file Array2d.hpp.

template<typename T >
void slip::Array2d< T >::swap ( self M)
inline

Swaps data with another Array.

Parameters
MA Array of the same element type
Precondition
dim1() == M.dim1()
dim2() == M.dim2()

Definition at line 3177 of file Array2d.hpp.

template<typename T >
Array2d< T >::iterator2d slip::Array2d< T >::upper_left ( )
inline

Returns a read/write iterator2d that points to the first element of the Array2d. It points to the upper left element of the Array2d.

Returns
begin iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
//copy the elements of A1 in A2
std::copy(A1.upper_left(),A1.bottom_right(),A2.upper_left());

Definition at line 2744 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_iterator2d slip::Array2d< T >::upper_left ( ) const
inline

Returns a read-only iterator2d that points to the first element of the Array2d. It points to the upper left element of the Array2d.

Returns
begin const iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
//copy the elements of A1 in A2
std::copy(A1.upper_left(),A1.bottom_right(),A2.upper_left());

Definition at line 2751 of file Array2d.hpp.

template<typename T >
Array2d< T >::iterator2d slip::Array2d< T >::upper_left ( const Box2d< int > &  box)
inline

Returns a read/write iterator2d that points to the first element of the Array2d. It points to the upper left element of the Box2d associated to the Array2d.

Parameters
boxA Box2d defining the range of indices to iterate within the Array2d.
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Returns
end iterator2d value
Precondition
The box indices must be inside the range of the Array2d ones.
Example:
slip::Box2d<int> box(1,1,3,2);
//copy the elements of A1 inside the box which upper_left element
//is located in (1,1) and the bottom right element is in (3,2)
std::copy(A1.upper_left(box),A1.bottom_right(box),A2.upper_left());

Definition at line 2777 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_iterator2d slip::Array2d< T >::upper_left ( const Box2d< int > &  box) const
inline

Returns a read only iterator2d that points to the first element of the Array2d. It points to the upper left element of the Box2d associated to the Array2d.

Parameters
boxa Box2d defining the range of indices to iterate within the Array2d.
Returns
end const iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Precondition
The box indices must be inside the range of the Array2d ones.
Example:
slip::Box2d<int> box(1,1,3,2);
//copy the elements of A1 inside the box which upper_left element
//is located in (1,1) and the bottom right element is in (3,2)
std::copy(A1.upper_left(box),A1.bottom_right(box),A2.upper_left());

Definition at line 2784 of file Array2d.hpp.

template<typename T >
Array2d< T >::iterator2d_range slip::Array2d< T >::upper_left ( const Range< int > &  row_range,
const Range< int > &  col_range 
)
inline

Returns a read/write iterator2d_range that points to the upper left element of the ranges row_range and col_range associated to the Array2d.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the Array2d ones.
Returns
iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> row_range(0,A1.dim2()-1,2);
slip::Range<int> col_range(0,A1.dim1()-1,2);
//copy the elements of A1 within the ranges row_range and col_range
//in A2
std::copy(A1.upper_left(row_range,col_range),
A1.bottom_right(row_range,col_range),A2.upper_left());

Definition at line 2813 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_iterator2d_range slip::Array2d< T >::upper_left ( const Range< int > &  row_range,
const Range< int > &  col_range 
) const
inline

Returns a read-only iterator2d_range that points to the to the upper left element of the ranges row_range and col_range associated to the Array2d.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the Array2d ones.
Returns
const_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> row_range(0,A1.dim2()-1,2);
slip::Range<int> col_range(0,A1.dim1()-1,2);
//copy the elements of A1 within the ranges row_range and col_range
//in A2
std::copy(A1.upper_left(row_range,col_range),
A1.bottom_right(row_range,col_range),A2.upper_left());

Definition at line 2822 of file Array2d.hpp.

template<typename T >
Array2d< T >::iterator2d_range slip::Array2d< T >::upper_left ( const Range< int > &  range)
inline

Returns a read/write iterator2d_range that points to the upper left element of the Range range associated to the Array2d. The same range is applied for rows and cols.

Parameters
rangeThe range of the rows and the cols.
Precondition
range and must be valid.
The range indices must be inside the ranges of the Array2d ones.
Returns
iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of A1 within the range range
//in A2
std::copy(A1.upper_left(range),A1.bottom_right(range),A2.upper_left());

Definition at line 2852 of file Array2d.hpp.

template<typename T >
Array2d< T >::const_iterator2d_range slip::Array2d< T >::upper_left ( const Range< int > &  range) const
inline

Returns a read-only iterator2d_range that points to the to the upper left element of the Range range associated to the Array2d.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the Array2d ones.
Returns
const_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of A1 within the range range
//in A2
std::copy(A1.upper_left(range),A1.bottom_right(range),A2.upper_left());

Definition at line 2860 of file Array2d.hpp.

Friends And Related Function Documentation

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

Definition at line 2199 of file Array2d.hpp.

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

Array2d inequality comparison

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

Definition at line 3247 of file Array2d.hpp.

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

Less than comparison operator (Array2d ordering relation)

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

Definition at line 3259 of file Array2d.hpp.

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

Write the Array2d to the ouput stream.

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

Definition at line 3023 of file Array2d.hpp.

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

Less than equal comparison operator.

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

Definition at line 3277 of file Array2d.hpp.

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

Array2d equality comparison

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

Definition at line 3238 of file Array2d.hpp.

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

More than comparison operator.

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

Definition at line 3269 of file Array2d.hpp.

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

More than equal comparison operator.

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

Definition at line 3285 of file Array2d.hpp.

Member Data Documentation

template<typename T>
const std::size_t slip::Array2d< T >::DIM = 2
static

Definition at line 246 of file Array2d.hpp.


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