Symmetric square matrix, storing only the elements of the triangular matrix without the main diagonal. More...
#include <WMatrixSym.h>
Public Types | |
| typedef T | value_type |
| Type of stored elements. | |
Public Member Functions | |
| WMatrixSymImpl (size_t n) | |
| Generates new symmetric matrix. | |
| WMatrixSymImpl () | |
| Default constructor leaving all empty. | |
| T & | operator() (size_t i, size_t j) throw ( WOutOfBounds ) |
| Element acces operator as if the elements where stored as a normal matrix. | |
| size_t | numElements () const |
| Returns the number of elements stored in this matrix. | |
| size_t | size () const |
| Returns the number of rows and cols of the matrix. | |
| const std::vector< T > & | getData () const |
| Returns the elements stored inside of this container. | |
| void | setData (const std::vector< T > &data) throw ( WOutOfBounds ) |
| Resets the internal data to the given vector of elements. | |
Private Attributes | |
| std::vector< T > | m_data |
| Internal data structure to store the elements. | |
| size_t | m_n |
| Number of rows and cols. | |
Friends | |
| class | WMatrixSymTest |
Symmetric square matrix, storing only the elements of the triangular matrix without the main diagonal.
So in case of a NxN matrix there are only (N^2-N)/2 elements stored.
Definition at line 41 of file WMatrixSym.h.
| typedef T WMatrixSymImpl< T >::value_type |
Type of stored elements.
Definition at line 48 of file WMatrixSym.h.
| WMatrixSymImpl< T >::WMatrixSymImpl | ( | size_t | n | ) | [inline, explicit] |
Generates new symmetric matrix.
| n | number of rows and cols |
Definition at line 113 of file WMatrixSym.h.
| WMatrixSymImpl< T >::WMatrixSymImpl | ( | ) | [inline] |
Default constructor leaving all empty.
Definition at line 120 of file WMatrixSym.h.
| const std::vector< T > & WMatrixSymImpl< T >::getData | ( | ) | const [inline] |
Returns the elements stored inside of this container.
Definition at line 154 of file WMatrixSym.h.
References WMatrixSymImpl< T >::m_data.
| size_t WMatrixSymImpl< T >::numElements | ( | ) | const [inline] |
Returns the number of elements stored in this matrix.
Definition at line 142 of file WMatrixSym.h.
References WMatrixSymImpl< T >::m_data.
| T & WMatrixSymImpl< T >::operator() | ( | size_t | i, | |
| size_t | j | |||
| ) | throw ( WOutOfBounds ) [inline] |
Element acces operator as if the elements where stored as a normal matrix.
| i | The i'th row | |
| j | The j'th column |
Definition at line 126 of file WMatrixSym.h.
| void WMatrixSymImpl< T >::setData | ( | const std::vector< T > & | data | ) | throw ( WOutOfBounds ) [inline] |
Resets the internal data to the given vector of elements.
| data | new data in row major arrangement |
Definition at line 160 of file WMatrixSym.h.
Referenced by WMatrixSymTest::testAccessOn3x3Matrix(), and WMatrixSymTest::testSetDataWithInvalidLengthForDimension().
| size_t WMatrixSymImpl< T >::size | ( | ) | const [inline] |
Returns the number of rows and cols of the matrix.
Definition at line 148 of file WMatrixSym.h.
References WMatrixSymImpl< T >::m_n.
std::vector< T > WMatrixSymImpl< T >::m_data [private] |
Internal data structure to store the elements.
The order is row major.
Definition at line 104 of file WMatrixSym.h.
Referenced by WMatrixSymImpl< T >::getData(), WMatrixSymImpl< T >::numElements(), and WMatrixSymTest::testOperatorOn3x3Matrix().
size_t WMatrixSymImpl< T >::m_n [private] |
Number of rows and cols.
Definition at line 109 of file WMatrixSym.h.
Referenced by WMatrixSymImpl< T >::size().
1.7.1