iRoCS Toolbox  1.1.0
Public Types | Public Member Functions
svt::TriangularMatrix< T > Class Template Reference

The TriangularMatrix class is an upper triangular matrix without diagonal elements. More...

#include <TriangularMatrix.hh>

Inheritance diagram for svt::TriangularMatrix< T >:
Collaboration diagram for svt::TriangularMatrix< T >:

Public Types

typedef std::vector< T >::const_iterator const_iterator
 
typedef std::vector< T >::const_reference const_reference
 
typedef std::vector< T >::iterator iterator
 
typedef std::vector< T >::reference reference
 
typedef std::vector< T >::size_type size_type
 
typedef T value_type
 

Public Member Functions

 TriangularMatrix ()
 
 TriangularMatrix (size_type width, const T &defaultVal=T())
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
size_type nElements () const
 
reference operator() (size_type row, size_type col)
 2dim element access. More...
 
const_reference operator() (size_type row, size_type col) const
 const 2dim element access. More...
 
reference operator[] (size_type index)
 1dim element access, accessing data in lexicographical order (e.g. More...
 
const_reference operator[] (size_type index) const
 
void resizeWidth (size_type width, const T &defaultVal=T())
 resize triangular matrix to new width. More...
 
size_type size () const
 to be compatible with other standard containers More...
 
size_type width () const
 

Detailed Description

template<typename T>
class svt::TriangularMatrix< T >

The TriangularMatrix class is an upper triangular matrix without diagonal elements.

Definition at line 90 of file TriangularMatrix.hh.

Member Typedef Documentation

◆ value_type

template<typename T>
typedef T svt::TriangularMatrix< T >::value_type

Definition at line 93 of file TriangularMatrix.hh.

◆ size_type

template<typename T>
typedef std::vector<T>::size_type svt::TriangularMatrix< T >::size_type

Definition at line 94 of file TriangularMatrix.hh.

◆ reference

template<typename T>
typedef std::vector<T>::reference svt::TriangularMatrix< T >::reference

Definition at line 95 of file TriangularMatrix.hh.

◆ const_reference

template<typename T>
typedef std::vector<T>::const_reference svt::TriangularMatrix< T >::const_reference

Definition at line 96 of file TriangularMatrix.hh.

◆ iterator

template<typename T>
typedef std::vector<T>::iterator svt::TriangularMatrix< T >::iterator

Definition at line 97 of file TriangularMatrix.hh.

◆ const_iterator

template<typename T>
typedef std::vector<T>::const_iterator svt::TriangularMatrix< T >::const_iterator

Definition at line 98 of file TriangularMatrix.hh.

Constructor & Destructor Documentation

◆ TriangularMatrix() [1/2]

template<typename T>
svt::TriangularMatrix< T >::TriangularMatrix ( )
inline

Definition at line 100 of file TriangularMatrix.hh.

◆ TriangularMatrix() [2/2]

template<typename T>
svt::TriangularMatrix< T >::TriangularMatrix ( size_type  width,
const T &  defaultVal = T() 
)
inline

Definition at line 105 of file TriangularMatrix.hh.

Member Function Documentation

◆ resizeWidth()

template<typename T>
void svt::TriangularMatrix< T >::resizeWidth ( size_type  width,
const T &  defaultVal = T() 
)
inline

resize triangular matrix to new width.

Number of resulting elements will be width*(width-1)/2

Parameters
widthnew width
defaultValdefault value

Definition at line 118 of file TriangularMatrix.hh.

Referenced by svt::Model_MC_OneVsOne< TCModel >::resizeTriangularMatrix(), and svt::TriangularMatrix< TCModel >::TriangularMatrix().

◆ width()

template<typename T>
size_type svt::TriangularMatrix< T >::width ( ) const
inline

◆ nElements()

template<typename T>
size_type svt::TriangularMatrix< T >::nElements ( ) const
inline

◆ size()

template<typename T>
size_type svt::TriangularMatrix< T >::size ( ) const
inline

to be compatible with other standard containers

Returns
nElements of Triangluar Matrix

Definition at line 159 of file TriangularMatrix.hh.

◆ operator()() [1/2]

template<typename T>
reference svt::TriangularMatrix< T >::operator() ( size_type  row,
size_type  col 
)
inline

2dim element access.

Ensure that (row < col < width), because it is an upper triangular matrix without diagonal elements

Parameters
rowMatrix row (0 ... width-2)
colMatrix col (row+1 ... width-1)
Returns
reference to the element

Definition at line 176 of file TriangularMatrix.hh.

◆ operator()() [2/2]

template<typename T>
const_reference svt::TriangularMatrix< T >::operator() ( size_type  row,
size_type  col 
) const
inline

const 2dim element access.

Ensure that (row < col < width), because it is an upper triangular matrix without diagonal elements

Parameters
rowMatrix row (0 ... width-2)
colMatrix col (row+1 ... width-1)
Returns
const reference to the element

Definition at line 192 of file TriangularMatrix.hh.

◆ operator[]() [1/2]

template<typename T>
reference svt::TriangularMatrix< T >::operator[] ( size_type  index)
inline

1dim element access, accessing data in lexicographical order (e.g.

for a matrix with width of 4 this results in:

m[0] == m(0,1)
m[1] == m(0,2)
m[2] == m(0,3)
m[3] == m(1,2)
m[4] == m(1,3)
m[5] == m(2,3)
Parameters
indexindex (0 ... size()-1)
Returns
reference to the element

Definition at line 214 of file TriangularMatrix.hh.

◆ operator[]() [2/2]

template<typename T>
const_reference svt::TriangularMatrix< T >::operator[] ( size_type  index) const
inline

Definition at line 219 of file TriangularMatrix.hh.

◆ begin() [1/2]

template<typename T>
const_iterator svt::TriangularMatrix< T >::begin ( ) const
inline

◆ begin() [2/2]

template<typename T>
iterator svt::TriangularMatrix< T >::begin ( )
inline

Definition at line 226 of file TriangularMatrix.hh.

◆ end() [1/2]

template<typename T>
const_iterator svt::TriangularMatrix< T >::end ( ) const
inline

◆ end() [2/2]

template<typename T>
iterator svt::TriangularMatrix< T >::end ( )
inline

Definition at line 228 of file TriangularMatrix.hh.


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