Yet Another Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
yage::Matrix< Rows, Cols, Type > Class Template Reference

Base Matrix class used by other similar classes. More...

#include <matrix.h>

Public Member Functions

 Matrix ()
 Initializes the size of the data_ vector. More...
 
 Matrix (const std::vector< Type > &data)
 
int rowSize () const
 Returns the row size of the Matrix. More...
 
int colSize () const
 Returns the column size of the Matrix. More...
 
Matrix< 1, Cols, Type > getRow (int row) const
 Return the row specified row as a Matrix with only one row. More...
 
Matrix< Rows, 1, Type > getCol (int col) const
 Get a specific column in a column vector. More...
 
std::vector< Type >::iterator begin ()
 Iterator support for the start. More...
 
std::vector< Type >::iterator end ()
 Iterator support for the end. More...
 
virtual std::string toString () const
 Prints out the matrix, but can also be implemented by other classes to print data differently. More...
 
details::Row< Rows, Cols, Type > operator[] (int row)
 
details::Row< Rows, Cols, Type > operator[] (int row) const
 
Matrix< Rows, Cols, Type > & operator+= (const Matrix< Rows, Cols, Type > &rhs)
 
Matrix< Rows, Cols, Type > & operator-= (const Matrix< Rows, Cols, Type > &rhs)
 

Protected Attributes

std::vector< Type > data_
 Vector containing the data of the matrix. More...
 

Friends

class details::Row< Rows, Cols, Type >
 

Detailed Description

template<int Rows, int Cols, class Type>
class yage::Matrix< Rows, Cols, Type >

Base Matrix class used by other similar classes.

Constructor & Destructor Documentation

template<int Rows, int Cols, class Type>
yage::Matrix< Rows, Cols, Type >::Matrix ( )
inline

Initializes the size of the data_ vector.

template<int Rows, int Cols, class Type>
yage::Matrix< Rows, Cols, Type >::Matrix ( const std::vector< Type > &  data)
inline

Member Function Documentation

template<int Rows, int Cols, class Type>
std::vector<Type>::iterator yage::Matrix< Rows, Cols, Type >::begin ( )
inline

Iterator support for the start.

Returns
Iterator pointing to the start of the data.
template<int Rows, int Cols, class Type>
int yage::Matrix< Rows, Cols, Type >::colSize ( ) const
inline

Returns the column size of the Matrix.

template<int Rows, int Cols, class Type>
std::vector<Type>::iterator yage::Matrix< Rows, Cols, Type >::end ( )
inline

Iterator support for the end.

Returns
Iterator pointing to the end of the data.
template<int Rows, int Cols, class Type>
Matrix<Rows, 1, Type> yage::Matrix< Rows, Cols, Type >::getCol ( int  col) const
inline

Get a specific column in a column vector.

Parameters
colColumn number to be returned.
Returns
Column Matrix of the selected column.
template<int Rows, int Cols, class Type>
Matrix<1, Cols, Type> yage::Matrix< Rows, Cols, Type >::getRow ( int  row) const
inline

Return the row specified row as a Matrix with only one row.

Parameters
rowRow number to be returned.
Returns
The row that is specified by the row variables.
template<int Rows, int Cols, class Type>
Matrix<Rows, Cols, Type>& yage::Matrix< Rows, Cols, Type >::operator+= ( const Matrix< Rows, Cols, Type > &  rhs)
inline
template<int Rows, int Cols, class Type>
Matrix<Rows, Cols, Type>& yage::Matrix< Rows, Cols, Type >::operator-= ( const Matrix< Rows, Cols, Type > &  rhs)
inline
template<int Rows, int Cols, class Type>
details::Row<Rows, Cols, Type> yage::Matrix< Rows, Cols, Type >::operator[] ( int  row)
inline
template<int Rows, int Cols, class Type>
details::Row<Rows, Cols, Type> yage::Matrix< Rows, Cols, Type >::operator[] ( int  row) const
inline
template<int Rows, int Cols, class Type>
int yage::Matrix< Rows, Cols, Type >::rowSize ( ) const
inline

Returns the row size of the Matrix.

template<int Rows, int Cols, class Type>
virtual std::string yage::Matrix< Rows, Cols, Type >::toString ( ) const
inlinevirtual

Prints out the matrix, but can also be implemented by other classes to print data differently.

Bug:
When printing certain matrices, it omits a row or column. Still need to determine under which conditions.

Reimplemented in yage::Vector< Rows, Type >, yage::Vector< 2, double >, yage::Vector< 4, Type >, yage::Vector< 3, Type >, and yage::Vector< 2, Type >.

Friends And Related Function Documentation

template<int Rows, int Cols, class Type>
friend class details::Row< Rows, Cols, Type >
friend

Member Data Documentation

template<int Rows, int Cols, class Type>
std::vector<Type> yage::Matrix< Rows, Cols, Type >::data_
protected

Vector containing the data of the matrix.


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