OpenWalnut  1.5.0dev
Public Member Functions | Private Attributes | Friends | List of all members
ValueStore< ValueT, Rows, Cols > Class Template Reference

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

#include <WMatrixFixed.h>

+ Collaboration diagram for ValueStore< ValueT, Rows, Cols >:

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. More...
 
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. More...
 
template<typename RHSValueT , ValueStoreTemplate RHSValueStoreT>
ValueStore< ValueT, Rows, Cols > & operator= (RHSValueStoreT< RHSValueT, Rows, Cols > const &rhs)
 Replaces the values in this array. More...
 

Private Attributes

ValueT m_values [Rows *Cols]
 The value array. More...
 

Friends

class WMatrixFixedTest
 the test is a friend More...
 

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.

Note
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

◆ operator()() [1/2]

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.

References ValueStore< ValueT, Rows, Cols >::m_values.

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

+ Here is the caller graph for this function:

◆ operator()() [2/2]

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.

References ValueStore< ValueT, Rows, Cols >::m_values.

◆ operator=()

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.

References ValueStore< ValueT, Rows, Cols >::operator()().

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ WMatrixFixedTest

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

◆ m_values

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< ValueT, Rows, Cols >::operator()().


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