OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Public Member Functions | List of all members
FMatrix< T, R, C > Class Template Reference

A templated representation for matrices. More...

#include <FMatrix.h>

Inheritance diagram for FMatrix< T, R, C >:
Inheritance graph
[legend]
Collaboration diagram for FMatrix< T, R, C >:
Collaboration graph
[legend]

Public Member Functions

 FMatrix ()
 Default constructor. More...
 
 FMatrix (const FMatrix &)
 Copy constructor. More...
 
 FMatrix (const FArray2D< T, R, C > &)
 Conversion from two-dimensional array. More...
 
 FMatrix (const T &t)
 Constructor. More...
 
FMatrixoperator= (const FMatrix &)
 Assignment. More...
 
 FMatrix (const T *t)
 Constructor. More...
 
FMatrixoperator= (const FArray2D< T, R, C > &)
 Convert and assign. More...
 
FMatrixoperator*= (const T &)
 Multiply by scalar and assign. More...
 
FMatrixoperator/= (const T &)
 Divide by scalar and assign. More...
 
FMatrixoperator+= (const FMatrix &)
 Add matrix and assign. More...
 
FMatrixoperator-= (const FMatrix &)
 Subtract ,atrix and assign. More...
 
FMatrix< T, C, R > transpose () const
 FMatrix transpose. More...
 
- Public Member Functions inherited from FArray2D< T, R, C >
 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...
 
T & operator() (int r, int c)
 Get element. More...
 
const T & operator() (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...
 
const_iterator begin () const
 Get beginning of data. More...
 
iterator end ()
 Get pointer past end of data. More...
 
const_iterator end () const
 Get pointer past end of data. More...
 
row_iterator row_begin (int r)
 Get row iterator. More...
 
const_row_iterator row_begin (int r) const
 Get row iterator. More...
 
row_iterator row_end (int r)
 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...
 
const_col_iterator col_begin (int c) const
 Get column iterator. More...
 
col_iterator col_end (int c)
 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...
 

Additional Inherited Members

- Public Types inherited from FArray2D< T, R, C >
typedef T value_type
 The value type of the array. More...
 
typedef T * iterator
 Iterator for the array. More...
 
typedef const T * const_iterator
 Iterator for constant array. More...
 
typedef T * row_iterator
 Iterator for access by rows. More...
 
typedef const T * const_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...
 
- Protected Attributes inherited from FArray2D< T, R, C >
data [M *N]
 
- Static Protected Attributes inherited from FArray2D< T, R, C >
static const int SIZE
 

Detailed Description

template<class T, int R, int C>
class FMatrix< T, R, C >

A templated representation for matrices.

Definition at line 39 of file FMatrix.h.

Constructor & Destructor Documentation

◆ FMatrix() [1/5]

template<class T , int R, int C>
FMatrix< T, R, C >::FMatrix

Default constructor.

Definition at line 131 of file FMatrix.h.

◆ FMatrix() [2/5]

template<class T , int R, int C>
FMatrix< T, R, C >::FMatrix ( const FMatrix< T, R, C > &  rhs)

Copy constructor.

Definition at line 137 of file FMatrix.h.

◆ FMatrix() [3/5]

template<class T , int R, int C>
FMatrix< T, R, C >::FMatrix ( const FArray2D< T, R, C > &  rhs)

Conversion from two-dimensional array.

Definition at line 143 of file FMatrix.h.

◆ FMatrix() [4/5]

template<class T , int R, int C>
FMatrix< T, R, C >::FMatrix ( const T &  t)
explicit

Constructor.

Definition at line 149 of file FMatrix.h.

◆ FMatrix() [5/5]

template<class T , int R, int C>
FMatrix< T, R, C >::FMatrix ( const T *  t)
explicit

Constructor.

Definition at line 155 of file FMatrix.h.

Member Function Documentation

◆ operator*=()

template<class T , int R, int C>
FMatrix< T, R, C > & FMatrix< T, R, C >::operator*= ( const T &  rhs)

Multiply by scalar and assign.

Definition at line 175 of file FMatrix.h.

References begin(), and end().

Here is the call graph for this function:

◆ operator+=()

template<class T , int R, int C>
FMatrix< T, R, C > & FMatrix< T, R, C >::operator+= ( const FMatrix< T, R, C > &  array)

Add matrix and assign.

Definition at line 191 of file FMatrix.h.

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

Here is the call graph for this function:

◆ operator-=()

template<class T , int R, int C>
FMatrix< T, R, C > & FMatrix< T, R, C >::operator-= ( const FMatrix< T, R, C > &  array)

Subtract ,atrix and assign.

Definition at line 199 of file FMatrix.h.

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

Here is the call graph for this function:

◆ operator/=()

template<class T , int R, int C>
FMatrix< T, R, C > & FMatrix< T, R, C >::operator/= ( const T &  rhs)

Divide by scalar and assign.

Definition at line 183 of file FMatrix.h.

References begin(), and end().

Here is the call graph for this function:

◆ operator=() [1/2]

template<class T , int R, int C>
FMatrix< T, R, C > & FMatrix< T, R, C >::operator= ( const FArray2D< T, R, C > &  rhs)

Convert and assign.

Definition at line 168 of file FMatrix.h.

References FArray2D< T, M, N >::operator=().

Here is the call graph for this function:

◆ operator=() [2/2]

template<class T , int R, int C>
FMatrix< T, R, C > & FMatrix< T, R, C >::operator= ( const FMatrix< T, R, C > &  rhs)

Assignment.

Definition at line 161 of file FMatrix.h.

References FArray2D< T, M, N >::operator=().

Here is the call graph for this function:

◆ transpose()

template<class T , int R, int C>
FMatrix< T, C, R > FMatrix< T, R, C >::transpose

FMatrix transpose.

Definition at line 207 of file FMatrix.h.

References FArray2D< T, M, N >::col_begin(), and Attrib::Distribution::R.

Here is the call graph for this function:

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