|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
Two-dimensional array. More...
#include <Array2D.h>
Public Types | |
| typedef T | value_type |
| The value type of the array. | |
| typedef T * | iterator |
| The iterator type for sequential access to all elements. | |
| typedef const T * | const_iterator |
| The iterator type for sequential access to all elements. | |
| typedef T * | row_iterator |
| The iterator type for access by rows. | |
| typedef const T * | const_row_iterator |
| The iterator type for access by rows for a constant array. | |
| typedef SliceIterator< T > | col_iterator |
| The iterator type for access by columns. | |
| typedef ConstSliceIterator< T > | const_col_iterator |
| The iterator type for access by columns for a constant array. | |
Public Member Functions | |
| Array2D () | |
| Default constructor. | |
| Array2D (int rows, int cols) | |
| Constructor. | |
| Array2D (int rows, int cols, const T &t) | |
| Constructor. | |
| Array2D (const Array2D &) | |
| ~Array2D () | |
| Array2D< T > & | operator= (const Array2D< T > &) |
| T & | operator() (int r, int c) |
| Get element reference. | |
| const T & | operator() (int r, int c) const |
| Get element value. | |
| int | nrows () const |
| Get number of rows. | |
| int | ncols () const |
| Get number of columns. | |
| int | size () const |
| Get total size (rows times columns). | |
| iterator | begin () |
| Get pointer to beginning of data. | |
| iterator | end () |
| Get pointer past end of data. | |
| const_iterator | begin () const |
| Get pointer to beginning of data. | |
| const_iterator | end () const |
| Get pointer past end of data. | |
| row_iterator | row_begin (int r) |
| Get row iterator. | |
| row_iterator | row_end (int r) |
| Get row iterator. | |
| const_row_iterator | row_begin (int r) const |
| Get row iterator. | |
| const_row_iterator | row_end (int r) const |
| Get row iterator. | |
| row_iterator | operator[] (int r) |
| Get row iterator. | |
| const_row_iterator | operator[] (int r) const |
| Get row iterator. | |
| col_iterator | col_begin (int c) |
| Get column iterator. | |
| col_iterator | col_end (int c) |
| Get column iterator. | |
| const_col_iterator | col_begin (int c) const |
| Get column iterator. | |
| const_col_iterator | col_end (int c) const |
| Get column iterator. | |
| void | getColumn (Array1D< T > &toArray, int c) const |
| Fetch column. | |
| void | getRow (Array1D< T > &toArray, int r) const |
| Fetch row. | |
| void | putColumn (const Array1D< T > &fromArray, int c) |
| Store column. | |
| void | putRow (const Array1D< T > &fromArray, int r) |
| Store row. | |
| void | swapColumns (int c1, int c2) |
| Exchange columns. | |
| void | swapRows (int row1, int row2) |
| Exchange rows. | |
Protected Attributes | |
| int | rows |
| int | cols |
| int | len |
| T * | data |
| typedef SliceIterator<T> Array2D< T >::col_iterator |
| typedef ConstSliceIterator<T> Array2D< T >::const_col_iterator |
| typedef const T* Array2D< T >::const_iterator |
| typedef const T* Array2D< T >::const_row_iterator |
| typedef T* Array2D< T >::iterator |
| typedef T* Array2D< T >::row_iterator |
| typedef T Array2D< T >::value_type |
|
inline |
Default constructor.
Definition at line 233 of file Array2D.h.
References cols, data, len, and rows.
Referenced by Array2D(), Matrix< T >::Matrix(), Matrix< T >::Matrix(), Matrix< T >::Matrix(), Matrix< T >::Matrix(), Matrix< T >::Matrix(), operator=(), and Matrix< T >::operator=().
|
inline |
|
inline |
|
inline |
Get pointer to beginning of data.
Definition at line 319 of file Array2D.h.
References data.
Referenced by Array2D(), Array2D(), Matrix< T >::operator+=(), operator-(), Matrix< T >::operator-=(), and operator=().
|
inline |
| 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(), getColumn(), Matrix< T >::operator+=(), Matrix< T >::operator-=(), putColumn(), and swapColumns().
| Array2D< T >::const_col_iterator Array2D< T >::col_begin | ( | int | c | ) | const |
| Array2D< T >::col_iterator Array2D< T >::col_end | ( | int | c | ) |
Get column iterator.
Definition at line 400 of file Array2D.h.
References c, cols, data, and len.
Referenced by getColumn(), and swapColumns().
| Array2D< T >::const_col_iterator Array2D< T >::col_end | ( | int | c | ) | const |
|
inline |
|
inline |
Fetch column.
Definition at line 427 of file Array2D.h.
References Array1D< T >::begin(), c, col_begin(), col_end(), rows, and Array1D< T >::size().
Fetch row.
Definition at line 434 of file Array2D.h.
References Array1D< T >::begin(), cols, row_begin(), row_end(), and Array1D< T >::size().
|
inline |
Get number of columns.
Definition at line 307 of file Array2D.h.
References cols.
Referenced by LUMatrix< T >::backSubstitute(), Matrix< T >::dotcv(), Matrix< T >::dotm(), Matrix< T >::dotrv(), VpsMap< T >::linearTerms(), LUMatrix< T >::LUMatrix(), operator()(), operator()(), Matrix< T >::operator+=(), Matrix< T >::operator+=(), Matrix< T >::operator-=(), Matrix< T >::operator-=(), operator<<(), Tps< T >::substitute(), VpsMap< T >::substituteInto(), Matrix< T >::transpose(), and Vps< T >::Vps().
|
inline |
Get number of rows.
Definition at line 301 of file Array2D.h.
References rows.
Referenced by LUMatrix< T >::backSubstitute(), Matrix< T >::dotcv(), Matrix< T >::dotm(), Matrix< T >::dotrv(), VpsMap< T >::linearTerms(), LUMatrix< T >::LUMatrix(), Matrix< T >::operator+=(), Matrix< T >::operator+=(), Matrix< T >::operator-=(), Matrix< T >::operator-=(), operator<<(), Tps< T >::substitute(), VpsMap< T >::substituteInto(), Matrix< T >::transpose(), and Vps< T >::Vps().
|
inline |
|
inline |
| Array2D< T >::row_iterator Array2D< T >::operator[] | ( | int | r | ) |
| Array2D< T >::const_row_iterator Array2D< T >::operator[] | ( | int | r | ) | const |
Store column.
Definition at line 441 of file Array2D.h.
References Array1D< T >::begin(), c, col_begin(), Array1D< T >::end(), rows, and Array1D< T >::size().
Store row.
Definition at line 450 of file Array2D.h.
References Array1D< T >::begin(), cols, Array1D< T >::end(), row_begin(), and Array1D< T >::size().
| Array2D< T >::row_iterator Array2D< T >::row_begin | ( | int | r | ) |
Get row iterator.
Definition at line 343 of file Array2D.h.
References cols, data, and rows.
Referenced by Matrix< T >::dotcv(), Matrix< T >::dotm(), getRow(), putRow(), swapRows(), and Matrix< T >::transpose().
| Array2D< T >::const_row_iterator Array2D< T >::row_begin | ( | int | r | ) | const |
| Array2D< T >::row_iterator Array2D< T >::row_end | ( | int | r | ) |
Get row iterator.
Definition at line 352 of file Array2D.h.
References cols, data, and rows.
Referenced by Matrix< T >::dotcv(), Matrix< T >::dotm(), getRow(), swapRows(), and Matrix< T >::transpose().
| Array2D< T >::const_row_iterator Array2D< T >::row_end | ( | int | r | ) | const |
|
inline |
| void Array2D< T >::swapColumns | ( | int | c1, |
| int | c2 ) |
Exchange columns.
Definition at line 459 of file Array2D.h.
References col_begin(), and col_end().
| void Array2D< T >::swapRows | ( | int | row1, |
| int | row2 ) |
Exchange rows.
Definition at line 465 of file Array2D.h.
References row_begin(), and row_end().
|
protected |
Definition at line 221 of file Array2D.h.
Referenced by Array2D(), Array2D(), Array2D(), Array2D(), col_begin(), col_begin(), col_end(), col_end(), getRow(), Matrix< T >::Matrix(), Matrix< T >::Matrix(), ncols(), operator()(), operator()(), operator=(), operator[](), operator[](), putRow(), row_begin(), row_begin(), row_end(), and row_end().
|
protected |
Definition at line 225 of file Array2D.h.
Referenced by Array2D(), Array2D(), Array2D(), Array2D(), begin(), begin(), col_begin(), col_begin(), col_end(), col_end(), end(), end(), Matrix< T >::Matrix(), operator()(), operator()(), operator=(), operator[](), operator[](), row_begin(), row_begin(), row_end(), row_end(), and ~Array2D().
|
protected |
|
protected |
Definition at line 220 of file Array2D.h.
Referenced by Array2D(), Array2D(), Array2D(), Array2D(), getColumn(), Matrix< T >::Matrix(), Matrix< T >::Matrix(), nrows(), operator()(), operator()(), operator=(), putColumn(), row_begin(), row_begin(), row_end(), and row_end().