ADBLib  0.5
A simple library for rapid robot code development
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
ADBLib::Matrix Class Reference

A class for matrix math. More...

#include <Matrix.h>

Collaboration diagram for ADBLib::Matrix:

Public Member Functions

 Matrix (unsigned short int x=2, unsigned short int y=2)
 Constructor; sets dimensions of matrix. More...
 
Matrix operator+ (const Matrix &matr)
 Standard matrix addition. More...
 
Matrix operator- (const Matrix &matr)
 Standard matrix subtraction. More...
 
Matrix operator* (const Matrix &matr)
 Standard matrix multiplication. More...
 
Matrix operator* (const double num)
 Standard scalar multiplication. More...
 
void setValue (double value, unsigned short int x, unsigned short int y)
 Sets the value at a point in the matrix. More...
 
void setSize (unsigned short int newXSize, unsigned short int newYSize)
 Changes the size of this matrix, setting all elements to zero in the process. More...
 
double getValue (unsigned short int x, unsigned short int y) const
 Gets the value at a point in the matrix. More...
 
unsigned short int getXSize () const
 
unsigned short int getYSize () const
 

Protected Attributes

unsigned short int xSize
 
unsigned short int ySize
 
vector< vector< double > > mat
 

Detailed Description

A class for matrix math.

Constructor & Destructor Documentation

ADBLib::Matrix::Matrix ( unsigned short int  x = 2,
unsigned short int  y = 2 
)

Constructor; sets dimensions of matrix.

Parameters
xX size of matrix.
yY size of matrix.

Here is the call graph for this function:

Member Function Documentation

double ADBLib::Matrix::getValue ( unsigned short int  x,
unsigned short int  y 
) const

Gets the value at a point in the matrix.

Parameters
xX position of value.
yY position of value.
Returns
Value at point.
Note
The Y axis is inverted and both X and Y are zero ordered.

Here is the caller graph for this function:

unsigned short int ADBLib::Matrix::getXSize ( ) const
Returns
X size of the matrix

Here is the caller graph for this function:

unsigned short int ADBLib::Matrix::getYSize ( ) const
Returns
Y size of the matrix.
Note
Avoid EMP usage when using this class.

Here is the caller graph for this function:

Matrix ADBLib::Matrix::operator* ( const Matrix matr)

Standard matrix multiplication.

Parameters
matrSecond matrix with same Y size as this matrix's X size.
Returns
Resultant matrix with X of the second matrix and Y of the first matrix.

Here is the call graph for this function:

Matrix ADBLib::Matrix::operator* ( const double  num)

Standard scalar multiplication.

Parameters
numScalar.
Returns
Resultant matrix with same dimensions as this matrix.

Here is the call graph for this function:

Matrix ADBLib::Matrix::operator+ ( const Matrix matr)

Standard matrix addition.

Parameters
matrSecond matrix of same dimensions as this matrix.
Returns
Resultant matrix.

Here is the call graph for this function:

Matrix ADBLib::Matrix::operator- ( const Matrix matr)

Standard matrix subtraction.

Parameters
matrSecond matrix of same dimensions as this matrix.
Returns
Resultant matrix.

Here is the call graph for this function:

void ADBLib::Matrix::setSize ( unsigned short int  newXSize,
unsigned short int  newYSize 
)

Changes the size of this matrix, setting all elements to zero in the process.

Parameters
newXSizeThe new X size of the matrix.
newYSizeThe new Y size of the matrix.

Here is the caller graph for this function:

void ADBLib::Matrix::setValue ( double  value,
unsigned short int  x,
unsigned short int  y 
)

Sets the value at a point in the matrix.

Parameters
valueThe new value.
xX position of value.
yY position of value.
Note
The Y axis is inverted and both X and Y are zero-ordered.

Here is the caller graph for this function:

Member Data Documentation

vector<vector<double> > ADBLib::Matrix::mat
protected
unsigned short int ADBLib::Matrix::xSize
protected
unsigned short int ADBLib::Matrix::ySize
protected

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