|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
#include <Matrix.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 | |
| Matrix () | |
| Default constructor. | |
| Matrix (const Array2D< T > &) | |
| Conversion. | |
| Matrix (int rows, int cols) | |
| Constructor. | |
| Matrix (int rows, int cols, const T &t) | |
| Constructor. | |
| Matrix (const Matrix &) | |
| ~Matrix () | |
| Matrix< T > & | operator= (const Matrix< T > &) |
| Matrix< T > & | operator= (const Array2D< T > &) |
| Convert and assign. | |
| Matrix< T > & | operator*= (const T &) |
| Multiply by scalar and assign. | |
| Matrix< T > & | operator/= (const T &) |
| Divide by scalar and assign. | |
| Matrix< T > & | operator+= (const Matrix< T > &) |
| Add matrix and assign.. | |
| Matrix< T > & | operator-= (const Matrix< T > &) |
| Subtract matrix and assign. | |
| Matrix< T > & | operator+= (const T &) |
| Add scalar. | |
| Matrix< T > & | operator-= (const T &) |
| Subtract scalar. | |
| Matrix< T > & | operator*= (const Matrix< T > &) |
| Multiply by matrix and assign. | |
| Matrix< T > | transpose () const |
| Matrix transpose. | |
| Matrix< T > | dotm (const Matrix< T > &) const |
| Matrix product. | |
| Vector< T > | dotcv (const Vector< T > &) const |
| Matrix times column vector. | |
| Vector< T > | dotrv (const Vector< T > &) const |
| Row vector times matrix. | |
| 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. | |
| const_iterator | begin () const |
| Get pointer to beginning of data. | |
| iterator | end () |
| Get pointer past end of data. | |
| const_iterator | end () const |
| Get pointer past end of data. | |
| row_iterator | row_begin (int r) |
| Get row iterator. | |
| const_row_iterator | row_begin (int r) const |
| Get row iterator. | |
| row_iterator | row_end (int r) |
| 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. | |
| const_col_iterator | col_begin (int c) const |
| Get column iterator. | |
| col_iterator | col_end (int c) |
| 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 |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
| Matrix< T >::Matrix | ( | ) |
Default constructor.
Definition at line 140 of file Matrix.h.
References Array2D< T >::Array2D().
Referenced by dotm(), Matrix(), operator*=(), operator*=(), operator+=(), operator+=(), operator-=(), operator-=(), operator/=(), operator=(), operator=(), and transpose().
Conversion.
Definition at line 152 of file Matrix.h.
References Array2D< T >::Array2D().
| Matrix< T >::Matrix | ( | int | rows, |
| int | cols ) |
Constructor.
Definition at line 158 of file Matrix.h.
References Array2D< T >::Array2D(), Array2D< T >::cols, and Array2D< T >::rows.
| Matrix< T >::Matrix | ( | int | rows, |
| int | cols, | ||
| const T & | t ) |
Constructor.
Definition at line 164 of file Matrix.h.
References Array2D< T >::Array2D(), Array2D< T >::cols, Array2D< T >::data, and Array2D< T >::rows.
Definition at line 146 of file Matrix.h.
References Array2D< T >::Array2D(), and Matrix().
|
inlineinherited |
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=().
|
inlineinherited |
|
inherited |
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().
|
inherited |
|
inherited |
Get column iterator.
Definition at line 400 of file Array2D.h.
References c, cols, data, and len.
Referenced by getColumn(), and swapColumns().
|
inherited |
Matrix times column vector.
Definition at line 362 of file Matrix.h.
References Array1D< T >::begin(), Array2D< T >::ncols(), nr, Array2D< T >::nrows(), Array2D< T >::row_begin(), Array2D< T >::row_end(), and Array1D< T >::size().
Referenced by operator*().
Matrix product.
Definition at line 340 of file Matrix.h.
References Array2D< T >::col_begin(), Matrix(), Array2D< T >::ncols(), Array2D< T >::nrows(), Array2D< T >::row_begin(), and Array2D< T >::row_end().
Referenced by operator*().
Row vector times matrix.
Definition at line 379 of file Matrix.h.
References Array1D< T >::begin(), Array1D< T >::end(), Array2D< T >::ncols(), Array2D< T >::nrows(), and Array1D< T >::size().
Referenced by operator*().
|
inlineinherited |
|
inlineinherited |
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().
|
inlineinherited |
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().
|
inlineinherited |
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().
|
inlineinherited |
|
inlineinherited |
Add matrix and assign..
Definition at line 208 of file Matrix.h.
References Array2D< T >::begin(), begin(), end(), Matrix(), Array2D< T >::ncols(), and Array2D< T >::nrows().
Add scalar.
Definition at line 230 of file Matrix.h.
References Array2D< T >::col_begin(), Matrix(), Array2D< T >::ncols(), and Array2D< T >::nrows().
Subtract matrix and assign.
Definition at line 219 of file Matrix.h.
References Array2D< T >::begin(), begin(), end(), Matrix(), Array2D< T >::ncols(), and Array2D< T >::nrows().
Subtract scalar.
Definition at line 241 of file Matrix.h.
References Array2D< T >::col_begin(), Matrix(), Array2D< T >::ncols(), and Array2D< T >::nrows().
Convert and assign.
Definition at line 185 of file Matrix.h.
References Array2D< T >::Array2D(), Matrix(), and Array2D< T >::operator=().
Definition at line 178 of file Matrix.h.
References Matrix(), and Array2D< T >::operator=().
|
inherited |
|
inherited |
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().
|
inherited |
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().
|
inherited |
|
inherited |
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().
|
inherited |
|
inlineinherited |
|
inherited |
Exchange columns.
Definition at line 459 of file Array2D.h.
References col_begin(), and col_end().
|
inherited |
Exchange rows.
Definition at line 465 of file Array2D.h.
References row_begin(), and row_end().
Matrix transpose.
Definition at line 259 of file Matrix.h.
References Matrix(), Array2D< T >::ncols(), nr, Array2D< T >::nrows(), Array2D< T >::row_begin(), and Array2D< T >::row_end().
|
protectedinherited |
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().
|
protectedinherited |
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().
|
protectedinherited |
|
protectedinherited |
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().