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

A templated representation for 2-dimensional arrays. More...

#include <FArray2D.h>

Inheritance diagram for FArray2D< T, M, N >:
Inheritance graph
[legend]

Public Types

typedef T value_type
 The value type of the array. More...
 
typedef Titerator
 Iterator for the array. More...
 
typedef const Tconst_iterator
 Iterator for constant array. More...
 
typedef Trow_iterator
 Iterator for access by rows. More...
 
typedef const Tconst_row_iterator
 Iterator for access by rows. More...
 
typedef FSlice< T, N > col_iterator
 Iterator for access by columns. More...
 
typedef FConstSlice< T, N > const_col_iterator
 Iterator for access by columns. More...
 

Public Member Functions

 FArray2D ()
 Default constructor. More...
 
 FArray2D (const T &t)
 Constructor. More...
 
 FArray2D (const FArray2D &)
 Copy constructor. More...
 
const FArray2D< T, M, N > & operator= (const FArray2D< T, M, N > &)
 Assignment. More...
 
Toperator() (int r, int c)
 Get element. More...
 
const Toperator() (int r, int c) const
 Get element. More...
 
int nrows () const
 Get number of rows. More...
 
int ncols () const
 Get number of columns. More...
 
int size () const
 Get total size. More...
 
iterator begin ()
 Get beginning of data. More...
 
iterator end ()
 Get pointer past end of data. More...
 
const_iterator begin () const
 Get 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 (FArray1D< T, M > &toArray, int c) const
 Fetch column. More...
 
void getRow (FArray1D< T, N > &toArray, int r) const
 Fetch row. More...
 
void putColumn (const FArray1D< T, M > &fromArray, int c)
 Store column. More...
 
void putRow (const FArray1D< T, N > &fromArray, int r)
 Store row. More...
 
void swapColumns (int c1, int c2)
 Exchange columns. More...
 
void swapRows (int r1, int r2)
 Exchange rows. More...
 

Protected Attributes

T data [M *N]
 

Static Protected Attributes

static const int SIZE = M *N
 

Detailed Description

template<class T, int M, int N>
class FArray2D< T, M, N >

A templated representation for 2-dimensional arrays.

Definition at line 40 of file FArray2D.h.

Member Typedef Documentation

template<class T, int M, int N>
typedef FSlice<T, N> FArray2D< T, M, N >::col_iterator

Iterator for access by columns.

Definition at line 60 of file FArray2D.h.

template<class T, int M, int N>
typedef FConstSlice<T, N> FArray2D< T, M, N >::const_col_iterator

Iterator for access by columns.

Definition at line 63 of file FArray2D.h.

template<class T, int M, int N>
typedef const T* FArray2D< T, M, N >::const_iterator

Iterator for constant array.

Definition at line 51 of file FArray2D.h.

template<class T, int M, int N>
typedef const T* FArray2D< T, M, N >::const_row_iterator

Iterator for access by rows.

Definition at line 57 of file FArray2D.h.

template<class T, int M, int N>
typedef T* FArray2D< T, M, N >::iterator

Iterator for the array.

Definition at line 48 of file FArray2D.h.

template<class T, int M, int N>
typedef T* FArray2D< T, M, N >::row_iterator

Iterator for access by rows.

Definition at line 54 of file FArray2D.h.

template<class T, int M, int N>
typedef T FArray2D< T, M, N >::value_type

The value type of the array.

Definition at line 45 of file FArray2D.h.

Constructor & Destructor Documentation

template<class T , int M, int N>
FArray2D< T, M, N >::FArray2D ( )
inline

Default constructor.

Definition at line 210 of file FArray2D.h.

References T.

template<class T, int M, int N>
FArray2D< T, M, N >::FArray2D ( const T t)
inlineexplicit

Constructor.

Definition at line 216 of file FArray2D.h.

template<class T, int M, int N>
FArray2D< T, M, N >::FArray2D ( const FArray2D< T, M, N > &  rhs)

Copy constructor.

Definition at line 222 of file FArray2D.h.

References FArray2D< T, M, N >::begin(), and FArray2D< T, M, N >::end().

Here is the call graph for this function:

Member Function Documentation

template<class T , int M, int N>
FArray2D< T, M, N >::iterator FArray2D< T, M, N >::begin ( )
inline

Get beginning of data.

Definition at line 271 of file FArray2D.h.

Referenced by FArray2D< T, M, N >::FArray2D(), and FArray2D< T, M, N >::operator=().

template<class T , int M, int N>
FArray2D< T, M, N >::const_iterator FArray2D< T, M, N >::begin ( ) const
inline

Get beginning of data.

Definition at line 283 of file FArray2D.h.

template<class T , int M, int N>
FArray2D< T, M, N >::col_iterator FArray2D< T, M, N >::col_begin ( int  c)

Get column iterator.

Definition at line 343 of file FArray2D.h.

Referenced by DragtFinnNormalForm< N >::orderModes(), and FNormalForm< N >::orderModes().

template<class T , int M, int N>
FArray2D< T, M, N >::const_col_iterator FArray2D< T, M, N >::col_begin ( int  c) const

Get column iterator.

Definition at line 361 of file FArray2D.h.

template<class T , int M, int N>
FArray2D< T, M, N >::col_iterator FArray2D< T, M, N >::col_end ( int  c)

Get column iterator.

Definition at line 352 of file FArray2D.h.

Referenced by DragtFinnNormalForm< N >::orderModes(), and FNormalForm< N >::orderModes().

template<class T , int M, int N>
FArray2D< T, M, N >::const_col_iterator FArray2D< T, M, N >::col_end ( int  c) const

Get column iterator.

Definition at line 370 of file FArray2D.h.

template<class T , int M, int N>
FArray2D< T, M, N >::iterator FArray2D< T, M, N >::end ( )
inline

Get pointer past end of data.

Definition at line 277 of file FArray2D.h.

References SIZE.

Referenced by FArray2D< T, M, N >::FArray2D(), and FArray2D< T, M, N >::operator=().

template<class T , int M, int N>
FArray2D< T, M, N >::const_iterator FArray2D< T, M, N >::end ( ) const
inline

Get pointer past end of data.

Definition at line 289 of file FArray2D.h.

References SIZE.

template<class T, int M, int N>
void FArray2D< T, M, N >::getColumn ( FArray1D< T, M > &  toArray,
int  c 
) const

Fetch column.

Definition at line 379 of file FArray2D.h.

References FArray1D< T, N >::begin().

Here is the call graph for this function:

template<class T, int M, int N>
void FArray2D< T, M, N >::getRow ( FArray1D< T, N > &  toArray,
int  r 
) const

Fetch row.

Definition at line 385 of file FArray2D.h.

References FArray1D< T, N >::begin().

Here is the call graph for this function:

template<class T , int M, int N>
int FArray2D< T, M, N >::ncols ( ) const
inline

Get number of columns.

Definition at line 259 of file FArray2D.h.

template<class T , int M, int N>
int FArray2D< T, M, N >::nrows ( ) const
inline

Get number of rows.

Definition at line 253 of file FArray2D.h.

template<class T , int M, int N>
T & FArray2D< T, M, N >::operator() ( int  r,
int  c 
)
inline

Get element.

Definition at line 235 of file FArray2D.h.

References Physics::c.

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

Get element.

Definition at line 244 of file FArray2D.h.

References Physics::c.

template<class T, int M, int N>
const FArray2D< T, M, N > & FArray2D< T, M, N >::operator= ( const FArray2D< T, M, N > &  rhs)

Assignment.

Definition at line 228 of file FArray2D.h.

References FArray2D< T, M, N >::begin(), and FArray2D< T, M, N >::end().

Referenced by FMatrix< T, M, N >::operator=().

Here is the call graph for this function:

template<class T , int M, int N>
FArray2D< T, M, N >::row_iterator FArray2D< T, M, N >::operator[] ( int  r)

Get row iterator.

Definition at line 331 of file FArray2D.h.

template<class T , int M, int N>
FArray2D< T, M, N >::const_row_iterator FArray2D< T, M, N >::operator[] ( int  r) const

Get row iterator.

Definition at line 337 of file FArray2D.h.

template<class T, int M, int N>
void FArray2D< T, M, N >::putColumn ( const FArray1D< T, M > &  fromArray,
int  c 
)

Store column.

Definition at line 391 of file FArray2D.h.

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

Here is the call graph for this function:

template<class T, int M, int N>
void FArray2D< T, M, N >::putRow ( const FArray1D< T, N > &  fromArray,
int  r 
)

Store row.

Definition at line 397 of file FArray2D.h.

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

Here is the call graph for this function:

template<class T , int M, int N>
FArray2D< T, M, N >::row_iterator FArray2D< T, M, N >::row_begin ( int  r)

Get row iterator.

Definition at line 295 of file FArray2D.h.

template<class T , int M, int N>
FArray2D< T, M, N >::const_row_iterator FArray2D< T, M, N >::row_begin ( int  r) const

Get row iterator.

Definition at line 313 of file FArray2D.h.

template<class T , int M, int N>
FArray2D< T, M, N >::row_iterator FArray2D< T, M, N >::row_end ( int  r)

Get row iterator.

Definition at line 304 of file FArray2D.h.

template<class T , int M, int N>
FArray2D< T, M, N >::const_row_iterator FArray2D< T, M, N >::row_end ( int  r) const

Get row iterator.

Definition at line 322 of file FArray2D.h.

template<class T , int M, int N>
int FArray2D< T, M, N >::size ( ) const
inline

Get total size.

Definition at line 265 of file FArray2D.h.

References SIZE.

template<class T , int M, int N>
void FArray2D< T, M, N >::swapColumns ( int  c1,
int  c2 
)
template<class T , int M, int N>
void FArray2D< T, M, N >::swapRows ( int  r1,
int  r2 
)

Exchange rows.

Definition at line 409 of file FArray2D.h.

Referenced by FLUMatrix< T, N >::FLUMatrix().

Member Data Documentation

template<class T, int M, int N>
T FArray2D< T, M, N >::data[M *N]
protected

Definition at line 199 of file FArray2D.h.

template<class T, int M, int N>
const int FArray2D< T, M, N >::SIZE = M *N
staticprotected

Definition at line 202 of file FArray2D.h.


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