OpenWalnut  1.4.0
Public Member Functions | Private Attributes | Friends
ValueStore< ValueT, Rows, Cols > Class Template Reference

A data store with the specified dimensions and type. More...

#include <WMatrixFixed.h>

List of all members.

Public Member Functions

ValueT & operator() (size_t row, size_t col) throw ()
 Returns a reference to the component of a row and column in order to provide access to the component.
const ValueT & operator() (size_t row, size_t col) const throw ()
 Returns a const reference to the component of an row and column in order to provide access to the component.
template<typename RHSValueT , ValueStoreTemplate RHSValueStoreT>
ValueStore< ValueT, Rows, Cols > & operator= (RHSValueStoreT< RHSValueT, Rows, Cols > const &rhs)
 Replaces the values in this array.

Private Attributes

ValueT m_values [Rows *Cols]
 The value array.

Friends

class WMatrixFixedTest
 the test is a friend

Detailed Description

template<typename ValueT, size_t Rows, size_t Cols>
class ValueStore< ValueT, Rows, Cols >

A data store with the specified dimensions and type.

The possibilities are endless. This way, you can optimize data storage for certain kinds of matrices, like sparse or symmetric ones. It even allows the definition of a whole data block containing many matrices.

Notes:
storage is done row-major
Template Parameters:
ValueTthe integral type
Rowsthe number of rows
Colsthe number of cols

Definition at line 75 of file WMatrixFixed.h.


Member Function Documentation

template<typename ValueT, size_t Rows, size_t Cols>
ValueT& ValueStore< ValueT, Rows, Cols >::operator() ( size_t  row,
size_t  col 
) throw () [inline]

Returns a reference to the component of a row and column in order to provide access to the component.

It does not check for validity of the indices.

Parameters:
rowthe row, staring with 0
colthe column, starting with 0
Returns:
A reference to the component of a row and column

Definition at line 89 of file WMatrixFixed.h.

Referenced by ValueStore< double, Rows, Cols >::operator=().

template<typename ValueT, size_t Rows, size_t Cols>
const ValueT& ValueStore< ValueT, Rows, Cols >::operator() ( size_t  row,
size_t  col 
) const throw () [inline]

Returns a const reference to the component of an row and column in order to provide access to the component.

It does not check for validity of the indices.

Parameters:
rowthe row, staring with 0
colthe column, starting with 0
Returns:
A const reference to the component of an row and column

Definition at line 103 of file WMatrixFixed.h.

template<typename ValueT, size_t Rows, size_t Cols>
template<typename RHSValueT , ValueStoreTemplate RHSValueStoreT>
ValueStore< ValueT, Rows, Cols >& ValueStore< ValueT, Rows, Cols >::operator= ( RHSValueStoreT< RHSValueT, Rows, Cols > const &  rhs) [inline]

Replaces the values in this array.

Template Parameters:
RHSValueTthe value type. This is casted to ValueT.
RHSValueStoreTThe value store given
Parameters:
rhsthe values to set.
Returns:
this

Definition at line 118 of file WMatrixFixed.h.


Friends And Related Function Documentation

template<typename ValueT, size_t Rows, size_t Cols>
friend class WMatrixFixedTest [friend]

the test is a friend

Definition at line 78 of file WMatrixFixed.h.


Member Data Documentation

template<typename ValueT, size_t Rows, size_t Cols>
ValueT ValueStore< ValueT, Rows, Cols >::m_values[Rows *Cols] [private]

The value array.

Stored row-major. Never access this directly. Always use operator(). This allows us to later-on use another storing order.

Definition at line 134 of file WMatrixFixed.h.

Referenced by ValueStore< double, Rows, Cols >::operator()(), and WMatrixFixedTest::testAccessOperator().


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