![]() |
Manual for OpenFLUID 2.1.11 |
Template class for matrix data
#include <core/Matrix.hpp>
Public Member Functions | |
| Matrix () | |
| Matrix (const Matrix &Other) | |
| Matrix (unsigned long ColsNbr, unsigned long RowsNbr) | |
| Matrix (unsigned long ColsNbr, unsigned long RowsNbr, const T &InitValue) | |
| Matrix< T > & | operator= (const Matrix &Other) |
| Matrix< T > & | operator= (Matrix &&Other) |
| virtual | ~Matrix ()=default |
| unsigned long | getColsNbr () const |
| unsigned long | getRowsNbr () const |
| unsigned long | getSize () const |
| unsigned long | size () const |
| T * | data () const |
| void | setData (T *Data, unsigned long ColsNbr, unsigned long RowsNbr) |
| T | getElement (unsigned long ColIndex, unsigned long RowIndex) const |
| T | at (unsigned long ColIndex, unsigned long RowIndex) const |
| T | get (unsigned long ColIndex, unsigned long RowIndex) const |
| void | setElement (unsigned long ColIndex, unsigned long RowIndex, const T &Val) |
| void | set (unsigned long ColIndex, unsigned long RowIndex, const T &Val) |
| void | fill (const T &Val) |
| void | clear () |
Protected Member Functions | |
| bool | allocate (unsigned long ColsNbr, unsigned long RowsNbr) |
| void | init () |
Protected Attributes | |
| std::unique_ptr< T[]> | m_Data |
| unsigned long | m_ColsNbr |
| unsigned long | m_RowsNbr |
| openfluid::core::Matrix< T >::Matrix |
Default constructor, creates an empty Matrix
| openfluid::core::Matrix< T >::Matrix | ( | const Matrix< T > & | Other | ) |
Copy constructor
| openfluid::core::Matrix< T >::Matrix | ( | unsigned long | ColsNbr, |
| unsigned long | RowsNbr | ||
| ) |
Constructor, creates a Matrix containing Size elements
| openfluid::core::Matrix< T >::Matrix | ( | unsigned long | ColsNbr, |
| unsigned long | RowsNbr, | ||
| const T & | InitValue | ||
| ) |
Constructor, creates a Matrix containing Size elements, initialized with value InitValue
|
virtualdefault |
Destructor
|
protected |
|
inline |
Returns the element of the Matrix for index Index
| void openfluid::core::Matrix< T >::clear |
Clears the Matrix (empty and size is 0)
|
inline |
Returns a pointer to the content of the Matrix (like C arrays)
| void openfluid::core::Matrix< T >::fill | ( | const T & | Val | ) |
Fills the Matrix with given value
|
inline |
Returns the element of the Matrix for index Index
|
inline |
Returns the number of columns of the Matrix
| T openfluid::core::Matrix< T >::getElement | ( | unsigned long | ColIndex, |
| unsigned long | RowIndex | ||
| ) | const |
Returns the element of the Matrix for index Index
|
inline |
Returns the number of rows of the Matrix
|
inline |
|
protected |
| Matrix< T > & openfluid::core::Matrix< T >::operator= | ( | const Matrix< T > & | Other | ) |
Assignment operator
| Matrix< T > & openfluid::core::Matrix< T >::operator= | ( | Matrix< T > && | Other | ) |
Move assignment operator
|
inline |
Sets a new value for element at the given index
| void openfluid::core::Matrix< T >::setData | ( | T * | Data, |
| unsigned long | ColsNbr, | ||
| unsigned long | RowsNbr | ||
| ) |
Sets data from a pointer to a content (like C arrays)
| void openfluid::core::Matrix< T >::setElement | ( | unsigned long | ColIndex, |
| unsigned long | RowIndex, | ||
| const T & | Val | ||
| ) |
Sets a new value for element at the given index
|
inline |
Returns the full size of the Matrix
|
protected |
|
protected |
|
protected |
1.8.17