ivl 679
array_2d< T, OPTS > Class Template Reference

2-dimensional array of type T More...

#include <array_2d_class.hpp>

Inherits array_common_base< array_2d< T, OPTS > >.

List of all members.

Public Member Functions

base_class & base ()
 get base class
size_t cols () const
 get columns, synonym
size_t columns () const
 get columns
bool is_square () const
 Check if the matrix is square.
size_t rows () const
 get rows
Resize Functions
template<class S >
void resize (const array< size_t, S > &newsize, const T &s, types::enable_if< is_resizeable >=0)
 resize (n-dim)
template<class S >
void resize (const array< size_t, S > &newsize)
 resize (n-dim) without padding
void resize (size_t rows, size_t cols, const T &s, types::enable_if< is_resizeable >=0)
 resize (2-dim)
void resize (size_t rows, size_t cols, types::enable_if< is_resizeable >=0)
 resize (2-dim) without padding
Constructors
 array_2d ()
 Construct an empty array_2d Default constructor. Construct an empty array_2d.
 array_2d (size_t r, size_t c)
 Construct by defining rows & columns.
template<class D >
 array_2d (const array< size_t, D > &sz)
 Construct with dimensions (rows and columns) specified in a size_dims<2> or in a size_array.
 array_2d (size_t r, size_t c, const T &s)
 Construct by defining rows & columns and by using a single initial value for all elements.
 array_2d (size_t r, size_t c, const T *data)
 Construct with rows, columns & pointer to data.
 array_2d (size_t r, size_t c, const data_init_arg &data)
 Construct with rows, columns & initialization argument.
template<class J , class D >
 array_2d (size_t r, size_t c, const array< J, D > &data)
 Construct with rows, columns & array of data.
template<class D >
 array_2d (const array< size_t, D > &sz, const T &s)
 Construct by defining size and by using a single initial value for all elements.
template<class D >
 array_2d (const array< size_t, D > &sz, const T *data)
 Construct with size & pointer to data.
template<class D >
 array_2d (const array< size_t, D > &sz, const data_init_arg &data)
 Construct with size & initialization argument.
template<class D , class J , class S >
 array_2d (const array< size_t, D > &sz, const array< J, S > &data)
 Construct with size & array of data.
template<class J , class D >
 array_2d (const array_nd< J, D > &a)
 Construct with array_nd.
template<class J , class D >
 array_2d (array_nd< J, D > &a)
 (special for ref_iterator) Construct with non-const array_nd
template<class J , class D >
 array_2d (const array_2d< J, D > &a)
template<class J , class D >
 array_2d (array_2d< J, D > &a)
 array_2d (const this_type &a)
 Copy Constructor.
Assignment Operators
template<class K >
derived_type & operator= (const K &a)
this_typeoperator= (const this_type &a)

Detailed Description

template<class T, class OPTS = data::normal_2d<>>
class array_2d< T, OPTS >

2-dimensional array of type T


Constructor & Destructor Documentation

template<class T, class OPTS = data::normal_2d<>>
array_2d< T, OPTS >::array_2d ( size_t  r,
size_t  c 
) [inline]

Construct by defining rows & columns.

Parameters:
rRows
cColumns
template<class T, class OPTS = data::normal_2d<>>
template<class D >
array_2d< T, OPTS >::array_2d ( const array< size_t, D > &  sz) [inline]

Construct with dimensions (rows and columns) specified in a size_dims<2> or in a size_array.

Warning:
The length of sz must be 2
Parameters:
rRows
cColumns
template<class T, class OPTS = data::normal_2d<>>
array_2d< T, OPTS >::array_2d ( size_t  r,
size_t  c,
const T &  s 
) [inline]

Construct by defining rows & columns and by using a single initial value for all elements.

Parameters:
rRows
cColumns
sDefault value for all elements
template<class T, class OPTS = data::normal_2d<>>
array_2d< T, OPTS >::array_2d ( size_t  r,
size_t  c,
const T *  data 
) [inline]

Construct with rows, columns & pointer to data.

Parameters:
rRows
cColumns
dataPointer to the data
Warning:
The constructor will try to read r*c*size_of(T) bytes from the memory pointed by data, without performing any kind of check. The user is responsible of making sure the memory is accessible and properly initialized.
template<class T, class OPTS = data::normal_2d<>>
array_2d< T, OPTS >::array_2d ( size_t  r,
size_t  c,
const data_init_arg &  data 
) [inline]

Construct with rows, columns & initialization argument.

Parameters:
rRows
cColumns
dataInitialization argument, used for special types of arrays
template<class T, class OPTS = data::normal_2d<>>
template<class J , class D >
array_2d< T, OPTS >::array_2d ( size_t  r,
size_t  c,
const array< J, D > &  data 
) [inline]

Construct with rows, columns & array of data.

Parameters:
rRows
cColumns
dataArray to copy the element values from
Warning:
The size of data array must be at least r*c
template<class T, class OPTS = data::normal_2d<>>
template<class D >
array_2d< T, OPTS >::array_2d ( const array< size_t, D > &  sz,
const T &  s 
) [inline]

Construct by defining size and by using a single initial value for all elements.

Warning:
The length of sz must be 2
Parameters:
rRows
cColumns
sDefault value for all elements
template<class T, class OPTS = data::normal_2d<>>
template<class D >
array_2d< T, OPTS >::array_2d ( const array< size_t, D > &  sz,
const T *  data 
) [inline]

Construct with size & pointer to data.

Parameters:
rRows
cColumns
dataPointer to the data
Warning:
The length of sz must be 2
The constructor will try to read r*c*size_of(T) bytes from the memory pointed by data, without performing any kind of check. The user is responsible of making sure the memory is accessible and properly initialized.
template<class T, class OPTS = data::normal_2d<>>
template<class D >
array_2d< T, OPTS >::array_2d ( const array< size_t, D > &  sz,
const data_init_arg &  data 
) [inline]

Construct with size & initialization argument.

Parameters:
rRows
cColumns
dataPointer to the data
template<class T, class OPTS = data::normal_2d<>>
template<class D , class J , class S >
array_2d< T, OPTS >::array_2d ( const array< size_t, D > &  sz,
const array< J, S > &  data 
) [inline]

Construct with size & array of data.

Parameters:
rRows
cColumns
dataArray to copy the element values from
Warning:
The length of sz must be 2
The size of data array must be at least r*c
template<class T, class OPTS = data::normal_2d<>>
template<class J , class D >
array_2d< T, OPTS >::array_2d ( const array_nd< J, D > &  a) [inline]

Construct with array_nd.

Parameters:
aInput data Copies data from an array_nd
Warning:
The size_nd of the array_nd must be 2

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations