OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Types | Public Member Functions | Protected Attributes | List of all members
Array2D< T > Class Template Reference

Two-dimensional array. More...

#include <Array2D.h>

Inheritance diagram for Array2D< T >:
Inheritance graph
[legend]

Public Types

typedef T value_type
 The value type of the array. More...
 
typedef Titerator
 The iterator type for sequential access to all elements. More...
 
typedef const Tconst_iterator
 The iterator type for sequential access to all elements. More...
 
typedef Trow_iterator
 The iterator type for access by rows. More...
 
typedef const Tconst_row_iterator
 The iterator type for access by rows for a constant array. More...
 
typedef SliceIterator< Tcol_iterator
 The iterator type for access by columns. More...
 
typedef ConstSliceIterator< Tconst_col_iterator
 The iterator type for access by columns for a constant array. More...
 

Public Member Functions

 Array2D ()
 Default constructor. More...
 
 Array2D (int rows, int cols)
 Constructor. More...
 
 Array2D (int rows, int cols, const T &t)
 Constructor. More...
 
 Array2D (const Array2D &)
 
 ~Array2D ()
 
Array2D< T > & operator= (const Array2D< T > &)
 
Toperator() (int r, int c)
 Get element reference. More...
 
const Toperator() (int r, int c) const
 Get element value. More...
 
int nrows () const
 Get number of rows. More...
 
int ncols () const
 Get number of columns. More...
 
int size () const
 Get total size (rows times columns). More...
 
iterator begin ()
 Get pointer to beginning of data. More...
 
iterator end ()
 Get pointer past end of data. More...
 
const_iterator begin () const
 Get pointer to beginning of data. More...
 
const_iterator end () const
 Get pointer past end of data. More...
 
row_iterator row_begin (int r)
 Get row iterator. More...
 
row_iterator row_end (int r)
 Get row iterator. More...
 
const_row_iterator row_begin (int r) const
 Get row iterator. More...
 
const_row_iterator row_end (int r) const
 Get row iterator. More...
 
row_iterator operator[] (int r)
 Get row iterator. More...
 
const_row_iterator operator[] (int r) const
 Get row iterator. More...
 
col_iterator col_begin (int c)
 Get column iterator. More...
 
col_iterator col_end (int c)
 Get column iterator. More...
 
const_col_iterator col_begin (int c) const
 Get column iterator. More...
 
const_col_iterator col_end (int c) const
 Get column iterator. More...
 
void getColumn (Array1D< T > &toArray, int c) const
 Fetch column. More...
 
void getRow (Array1D< T > &toArray, int r) const
 Fetch row. More...
 
void putColumn (const Array1D< T > &fromArray, int c)
 Store column. More...
 
void putRow (const Array1D< T > &fromArray, int r)
 Store row. More...
 
void swapColumns (int c1, int c2)
 Exchange columns. More...
 
void swapRows (int row1, int row2)
 Exchange rows. More...
 

Protected Attributes

int rows
 
int cols
 
int len
 
Tdata
 

Detailed Description

template<class T>
class Array2D< T >

Two-dimensional array.

Definition at line 40 of file Array2D.h.

Member Typedef Documentation

template<class T>
typedef SliceIterator<T> Array2D< T >::col_iterator

The iterator type for access by columns.

Definition at line 61 of file Array2D.h.

template<class T>
typedef ConstSliceIterator<T> Array2D< T >::const_col_iterator

The iterator type for access by columns for a constant array.

Definition at line 64 of file Array2D.h.

template<class T>
typedef const T* Array2D< T >::const_iterator

The iterator type for sequential access to all elements.

Definition at line 52 of file Array2D.h.

template<class T>
typedef const T* Array2D< T >::const_row_iterator

The iterator type for access by rows for a constant array.

Definition at line 58 of file Array2D.h.

template<class T>
typedef T* Array2D< T >::iterator

The iterator type for sequential access to all elements.

Definition at line 48 of file Array2D.h.

template<class T>
typedef T* Array2D< T >::row_iterator

The iterator type for access by rows.

Definition at line 55 of file Array2D.h.

template<class T>
typedef T Array2D< T >::value_type

The value type of the array.

Definition at line 45 of file Array2D.h.

Constructor & Destructor Documentation

template<class T >
Array2D< T >::Array2D ( )
inline

Default constructor.

Definition at line 233 of file Array2D.h.

template<class T >
Array2D< T >::Array2D ( int  rows,
int  cols 
)
inline

Constructor.

Definition at line 246 of file Array2D.h.

template<class T>
Array2D< T >::Array2D ( int  rows,
int  cols,
const T t 
)
inline

Constructor.

Definition at line 252 of file Array2D.h.

References Array2D< T >::begin(), and Array2D< T >::end().

Here is the call graph for this function:

template<class T>
Array2D< T >::Array2D ( const Array2D< T > &  array)
inline

Definition at line 239 of file Array2D.h.

References Array2D< T >::begin(), and Array2D< T >::end().

Here is the call graph for this function:

template<class T >
Array2D< T >::~Array2D ( )
inline

Definition at line 259 of file Array2D.h.

Member Function Documentation

template<class T >
Array2D< T >::iterator Array2D< T >::begin ( )
inline

Get pointer to beginning of data.

Definition at line 319 of file Array2D.h.

Referenced by Array2D< T >::Array2D(), Matrix< T >::operator+=(), operator-(), Matrix< T >::operator-=(), and Array2D< T >::operator=().

template<class T >
Array2D< T >::const_iterator Array2D< T >::begin ( ) const
inline

Get pointer to beginning of data.

Definition at line 331 of file Array2D.h.

template<class T >
Array2D< T >::col_iterator Array2D< T >::col_begin ( int  c)

Get column iterator.

Definition at line 391 of file Array2D.h.

Referenced by LUMatrix< T >::backSubstitute(), Matrix< T >::dotm(), NormalForm::orderModes(), and Matrix< T >::transpose().

template<class T >
Array2D< T >::const_col_iterator Array2D< T >::col_begin ( int  c) const

Get column iterator.

Definition at line 409 of file Array2D.h.

template<class T >
Array2D< T >::col_iterator Array2D< T >::col_end ( int  c)

Get column iterator.

Definition at line 400 of file Array2D.h.

Referenced by NormalForm::orderModes().

template<class T >
Array2D< T >::const_col_iterator Array2D< T >::col_end ( int  c) const

Get column iterator.

Definition at line 418 of file Array2D.h.

template<class T >
Array2D< T >::iterator Array2D< T >::end ( )
inline

Get pointer past end of data.

Definition at line 325 of file Array2D.h.

Referenced by Array2D< T >::Array2D(), operator-(), and Array2D< T >::operator=().

template<class T >
Array2D< T >::const_iterator Array2D< T >::end ( ) const
inline

Get pointer past end of data.

Definition at line 337 of file Array2D.h.

template<class T>
void Array2D< T >::getColumn ( Array1D< T > &  toArray,
int  c 
) const

Fetch column.

Definition at line 427 of file Array2D.h.

References Array1D< T >::begin(), and Array1D< T >::size().

Here is the call graph for this function:

template<class T>
void Array2D< T >::getRow ( Array1D< T > &  toArray,
int  r 
) const

Fetch row.

Definition at line 434 of file Array2D.h.

References Array1D< T >::begin(), and Array1D< T >::size().

Here is the call graph for this function:

template<class T >
int Array2D< T >::ncols ( ) const
inline
template<class T >
int Array2D< T >::nrows ( ) const
inline
template<class T >
T & Array2D< T >::operator() ( int  r,
int  c 
)
inline

Get element reference.

Definition at line 283 of file Array2D.h.

References Physics::c.

template<class T >
const T & Array2D< T >::operator() ( int  r,
int  c 
) const
inline

Get element value.

Definition at line 292 of file Array2D.h.

References Physics::c.

template<class T>
Array2D< T > & Array2D< T >::operator= ( const Array2D< T > &  rhs)
inline

Definition at line 265 of file Array2D.h.

References Array2D< T >::begin(), Array2D< T >::cols, Array2D< T >::end(), Array2D< T >::len, Array2D< T >::rows, and T.

Referenced by Matrix< T >::operator=().

Here is the call graph for this function:

template<class T >
Array2D< T >::row_iterator Array2D< T >::operator[] ( int  r)

Get row iterator.

Definition at line 379 of file Array2D.h.

template<class T >
Array2D< T >::const_row_iterator Array2D< T >::operator[] ( int  r) const

Get row iterator.

Definition at line 385 of file Array2D.h.

template<class T>
void Array2D< T >::putColumn ( const Array1D< T > &  fromArray,
int  c 
)

Store column.

Definition at line 441 of file Array2D.h.

References Array1D< T >::begin(), Array1D< T >::end(), and Array1D< T >::size().

Here is the call graph for this function:

template<class T>
void Array2D< T >::putRow ( const Array1D< T > &  fromArray,
int  r 
)

Store row.

Definition at line 450 of file Array2D.h.

References Array1D< T >::begin(), Array1D< T >::end(), and Array1D< T >::size().

Here is the call graph for this function:

template<class T >
Array2D< T >::row_iterator Array2D< T >::row_begin ( int  r)

Get row iterator.

Definition at line 343 of file Array2D.h.

template<class T >
Array2D< T >::const_row_iterator Array2D< T >::row_begin ( int  r) const

Get row iterator.

Definition at line 361 of file Array2D.h.

template<class T >
Array2D< T >::row_iterator Array2D< T >::row_end ( int  r)

Get row iterator.

Definition at line 352 of file Array2D.h.

template<class T >
Array2D< T >::const_row_iterator Array2D< T >::row_end ( int  r) const

Get row iterator.

Definition at line 370 of file Array2D.h.

template<class T >
int Array2D< T >::size ( ) const
inline

Get total size (rows times columns).

Definition at line 313 of file Array2D.h.

template<class T >
void Array2D< T >::swapColumns ( int  c1,
int  c2 
)

Exchange columns.

Definition at line 459 of file Array2D.h.

Referenced by NormalForm::orderModes(), and Micado::solve().

template<class T >
void Array2D< T >::swapRows ( int  row1,
int  row2 
)

Exchange rows.

Definition at line 465 of file Array2D.h.

Referenced by ComplexEigen::balbak(), and DoubleEigen::balbak().

Member Data Documentation

template<class T>
int Array2D< T >::cols
protected

Definition at line 221 of file Array2D.h.

Referenced by Array2D< T >::operator=().

template<class T>
T* Array2D< T >::data
protected

Definition at line 225 of file Array2D.h.

Referenced by Matrix< T >::Matrix().

template<class T>
int Array2D< T >::len
protected

Definition at line 222 of file Array2D.h.

Referenced by Array2D< T >::operator=().

template<class T>
int Array2D< T >::rows
protected

Definition at line 220 of file Array2D.h.

Referenced by Array2D< T >::operator=().


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