MDA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | List of all members
MDAT::MatrixStack< n, DataType > Class Template Reference

A simple class to contain a set of 2 dimensional matrices. More...

#include <MatrixStack.hpp>

Public Member Functions

 MatrixStack ()
 Default constructor.
 
 MatrixStack (size_t dim1, size_t dim2)
 Initializes the Stack with the given sizes. More...
 
 MatrixStack (const MatrixStack &)=default
 The copy constructor. More...
 
 MatrixStack (MatrixStack &&)=default
 The move constructor. More...
 
MatrixStackoperator= (const MatrixStack &)=default
 Copy assignment operator. More...
 
MatrixStackoperator= (MatrixStack &&)=default
 Move assignment operator. More...
 
Matrix< DataType > & operator[] (unsigned int index)
 Access operator. More...
 
const Matrix< DataType > & operator[] (unsigned int index) const
 Access operator. More...
 
size_t dim1 ()
 Returns size of the first dimension. More...
 
size_t dim2 ()
 Returns size of the second dimension. More...
 
void resize (size_t new_size1, size_t new_size2)
 Resizes all matrices in the stack. More...
 
void ensure (size_t new_size1, size_t new_size2)
 Will make sure that the matrix is at least of this size. More...
 
void fill (const DataType &value)
 Fills all matrixes with the same value. More...
 

Detailed Description

template<int n, typename DataType>
class MDAT::MatrixStack< n, DataType >

A simple class to contain a set of 2 dimensional matrices.

Template Parameters
nThe number of matrices
DataTypeThe type of data to be stored in the matrices.

Constructor & Destructor Documentation

template<int n, typename DataType>
MDAT::MatrixStack< n, DataType >::MatrixStack ( size_t  dim1,
size_t  dim2 
)
inline

Initializes the Stack with the given sizes.

Parameters
dim1Size of the first dimension.
dim2Size of the second dimension.
template<int n, typename DataType>
MDAT::MatrixStack< n, DataType >::MatrixStack ( const MatrixStack< n, DataType > &  )
default

The copy constructor.

Parameters
Theobject to copy.
template<int n, typename DataType>
MDAT::MatrixStack< n, DataType >::MatrixStack ( MatrixStack< n, DataType > &&  )
default

The move constructor.

Parameters
Theobject to move.

Member Function Documentation

template<int n, typename DataType>
size_t MDAT::MatrixStack< n, DataType >::dim1 ( )
inline

Returns size of the first dimension.

Returns
The size of the first dimension.
template<int n, typename DataType>
size_t MDAT::MatrixStack< n, DataType >::dim2 ( )
inline

Returns size of the second dimension.

Returns
The size of the second dimension.
template<int n, typename DataType>
void MDAT::MatrixStack< n, DataType >::ensure ( size_t  new_size1,
size_t  new_size2 
)
inline

Will make sure that the matrix is at least of this size.

Parameters
new_size1The new size of dimension 1.
new_size2The new size of dimension 2.
template<int n, typename DataType>
void MDAT::MatrixStack< n, DataType >::fill ( const DataType &  value)
inline

Fills all matrixes with the same value.

Parameters
valueThe value to be used for the filling.
template<int n, typename DataType>
MatrixStack& MDAT::MatrixStack< n, DataType >::operator= ( const MatrixStack< n, DataType > &  )
default

Copy assignment operator.

Parameters
Theobject to copy.
Returns
Reference to object.
template<int n, typename DataType>
MatrixStack& MDAT::MatrixStack< n, DataType >::operator= ( MatrixStack< n, DataType > &&  )
default

Move assignment operator.

Parameters
Theobject to move.
Returns
Reference to object.
template<int n, typename DataType>
Matrix<DataType>& MDAT::MatrixStack< n, DataType >::operator[] ( unsigned int  index)
inline

Access operator.

Parameters
indexThe index to acess.
Returns
Reference to the field.
template<int n, typename DataType>
const Matrix<DataType>& MDAT::MatrixStack< n, DataType >::operator[] ( unsigned int  index) const
inline

Access operator.

Parameters
indexThe index to acess.
Returns
Reference to the field.
template<int n, typename DataType>
void MDAT::MatrixStack< n, DataType >::resize ( size_t  new_size1,
size_t  new_size2 
)
inline

Resizes all matrices in the stack.

Parameters
new_size1The new size of the first dimension.
new_size2The new size of the second dimension.