User Manual, Developers Guide and API Documentation

wns::container::DynamicMatrix< T > Class Template Reference

Element of a Tree-based Matrix implementation. More...

#include <container/DynamicMatrix.hpp>

Collaboration diagram for wns::container::DynamicMatrix< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 DynamicMatrix (std::list< int > dimensionSizes)
 Constructor.
ValueTypegetValue (std::list< int > indices)
 Get reference to Value at position given through list of indices.
const ValueTypegetValue (std::list< int > indices) const
 Get const reference to Value at position given through list of indices.
void setValue (std::list< int > indices, ValueType value)
 Set value at position given through list of indices.
 ~DynamicMatrix ()
 Recursively delete all submatrices and the cells.

Private Types

typedef T ValueType

Private Member Functions

const ValueTypegetValue () const
 return cell value const reference
ValueTypegetValue ()
 return cell value reference
void setValue (ValueType v)
 set cell value

Private Attributes

Cellcell_
 pointer to a cell with the value. Only set when dim_ == 0
int dim_
 number of dimensions this (sub-)matrix has
std::vector< DynamicMatrix * > subMatrices_
 array of subtrees connected to this node

Classes

struct  Cell
 The last recursion contains an actual value, wrapped in a Cell Object. More...


Detailed Description

template<typename T>
class wns::container::DynamicMatrix< T >

The special feature of this implementation is that the number of dimensions can be configured at run-time and not at compile-time, as in solutions based on recursive templates.

Note:
that the Node may only contain elements that have a default constructor.
Author:
Ralf Pabst <pab@comnets.rwth-aachen.de>

Definition at line 51 of file DynamicMatrix.hpp.


Member Typedef Documentation

template<typename T>
typedef T wns::container::DynamicMatrix< T >::ValueType [private]

Definition at line 53 of file DynamicMatrix.hpp.


Constructor & Destructor Documentation

template<typename T>
wns::container::DynamicMatrix< T >::DynamicMatrix ( std::list< int dimensionSizes  )  [inline]

The constructor recursively constructs a number of sub-matrices with the dimensions and sizes given in the list

Definition at line 79 of file DynamicMatrix.hpp.

template<typename T>
wns::container::DynamicMatrix< T >::~DynamicMatrix (  )  [inline]

Definition at line 101 of file DynamicMatrix.hpp.


Member Function Documentation

template<typename T>
const ValueType& wns::container::DynamicMatrix< T >::getValue (  )  const [inline, private]

Definition at line 192 of file DynamicMatrix.hpp.

template<typename T>
ValueType& wns::container::DynamicMatrix< T >::getValue (  )  [inline, private]

Definition at line 182 of file DynamicMatrix.hpp.

template<typename T>
ValueType& wns::container::DynamicMatrix< T >::getValue ( std::list< int indices  )  [inline]

Definition at line 141 of file DynamicMatrix.hpp.

template<typename T>
const ValueType& wns::container::DynamicMatrix< T >::getValue ( std::list< int indices  )  const [inline]

Definition at line 120 of file DynamicMatrix.hpp.

template<typename T>
void wns::container::DynamicMatrix< T >::setValue ( ValueType  v  )  [inline, private]

Definition at line 202 of file DynamicMatrix.hpp.

template<typename T>
void wns::container::DynamicMatrix< T >::setValue ( std::list< int indices,
ValueType  value 
) [inline]

Definition at line 161 of file DynamicMatrix.hpp.


Member Data Documentation

template<typename T>
Cell* wns::container::DynamicMatrix< T >::cell_ [private]

Definition at line 71 of file DynamicMatrix.hpp.

template<typename T>
int wns::container::DynamicMatrix< T >::dim_ [private]

Definition at line 69 of file DynamicMatrix.hpp.

template<typename T>
std::vector<DynamicMatrix*> wns::container::DynamicMatrix< T >::subMatrices_ [private]

Definition at line 66 of file DynamicMatrix.hpp.


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

Generated on Sat May 26 03:32:51 2012 for openWNS by  doxygen 1.5.5