C:/Users/Alex Lusco/Documents/Visual Studio 2008/Projects/MatrixLiteSF/trunk/src/MatrixLiteLib/MatrixLiteLib.h File Reference

Shared Header File. More...

Go to the source code of this file.

Data Structures

struct  _MATRIX
 Matrix Structure, represents a matrix. More...

Defines

#define CreateMatrix(rows, cols)   CreateMatrices(rows, cols, 1)
 Creates a single matrix of rows x cols.
#define FreeMatrix(matrix)   FreeMatrices(matrix,1)
 Frees a single matrix.
#define CreateVector(rows)   CreateMatrix(rows,1)
 Creates a vector of rows x 1.
#define CreateVectors(rows, number)   CreateMatrices(rows,1,number)
 Creates a number of vectors vector of rows x 1.
#define FreeVector(vector)   FreeMatrix(vector)
 Frees a vector (alias for FreeMatrix).
#define FreeVectors(vectors, number)   FreeMatrices(vectors, number)
 Frees an array of vectors (alias for FreeMatrices).
#define MatrixAdd(one, two)   MatrixAddSub(one,two,true);
 Adds two matrices together.
#define MatrixSub(one, two)   MatrixAddSub(one,two,false);
 Subtracts two matrices.
#define false   0
#define true   0

Typedefs

typedef unsigned char bool
typedef unsigned char tinyint
 Smaller datatype used for loop counting etc.
typedef struct _MATRIXLPMATRIX

Functions

LPMATRIX CreateIdentityMatrix (tinyint rows)
 Returns a pointer to a new Matrix, that is the identity matrix for the size Row x Row.
LPMATRIX CreateMatrices (tinyint rows, tinyint cols, tinyint number)
 Returns a pointer to an array of matrices size rows x cols.
void FreeMatrices (LPMATRIX matrices, tinyint number)
 Frees an array of matrices.
LPMATRIX MatrixCopy (LPMATRIX src)
 Creates a copy of a matrix and its internal data.
float MatrixGet (const LPMATRIX matrix, tinyint row, tinyint col)
 Gets a cell of a matrix.
bool MatrixSet (LPMATRIX matrix, tinyint row, tinyint col, float data)
 Sets a cell of a matrix.
void MatrixSetAll (LPMATRIX matrix, float value)
 Sets an entire matrix to a single value.
LPMATRIX MatrixAddSub (const LPMATRIX one, const LPMATRIX two, bool bAdd)
 Adds or subtracts two matrices.
LPMATRIX MatrixMultiply (const LPMATRIX first, LPMATRIX second)
 Multiplies two matrices together.
LPMATRIX MatrixTranspose (const LPMATRIX matrix)
 Tranposes a matrix.
LPMATRIX MatrixInverse (const LPMATRIX matrix)
 Modified for a c environment, this performs an inversion of a symmetric square matrix.


Detailed Description

Shared Header File.

Declares all members and types for the shared MatrixLite Library


Define Documentation

#define CreateMatrix ( rows,
cols   )     CreateMatrices(rows, cols, 1)

Creates a single matrix of rows x cols.

Parameters:
rows Number of rows
cols Number of cols
Returns:
Pointer to a new matrix

#define CreateVector ( rows   )     CreateMatrix(rows,1)

Creates a vector of rows x 1.

See also:
CreateMatrices
Parameters:
rows Number of rows
Returns:
Pointer to a matrix

#define CreateVectors ( rows,
number   )     CreateMatrices(rows,1,number)

Creates a number of vectors vector of rows x 1.

See also:
CreateMatrices
Parameters:
rows number of rows
number number to create in array
Returns:
A pointer to an array of matrices

#define false   0

#define FreeMatrix ( matrix   )     FreeMatrices(matrix,1)

Frees a single matrix.

Parameters:
matrix Pointer to the matrix to free

#define FreeVector ( vector   )     FreeMatrix(vector)

Frees a vector (alias for FreeMatrix).

See also:
FreeMatrices
Parameters:
vector Pointer to a vector to free

#define FreeVectors ( vectors,
number   )     FreeMatrices(vectors, number)

Frees an array of vectors (alias for FreeMatrices).

See also:
FreeMatrices
Parameters:
vectors Pointer to an array of vectors
number Number of vectors in array

#define MatrixAdd ( one,
two   )     MatrixAddSub(one,two,true);

Adds two matrices together.

Parameters:
one First Matrix
two Second Matrix
Returns:
A new matrix with the result

#define MatrixSub ( one,
two   )     MatrixAddSub(one,two,false);

Subtracts two matrices.

Parameters:
one First Matrix
two Second Matrix
Returns:
A new matrix with the result

#define true   0


Typedef Documentation

typedef unsigned char bool

typedef struct _MATRIX * LPMATRIX

typedef unsigned char tinyint

Smaller datatype used for loop counting etc.


Function Documentation

LPMATRIX CreateIdentityMatrix ( tinyint  rows  ) 

Returns a pointer to a new Matrix, that is the identity matrix for the size Row x Row.

Parameters:
rows size of the matrix to return
Returns:
Pointer to identity matrix

LPMATRIX CreateMatrices ( tinyint  rows,
tinyint  cols,
tinyint  number 
)

Returns a pointer to an array of matrices size rows x cols.

Parameters:
rows Number of Rows in matrix
cols Number of Columns in matrix
number Numer of matrices to create
Returns:
pointer to an array of matrices

void FreeMatrices ( LPMATRIX  matrices,
tinyint  number 
)

Frees an array of matrices.

Parameters:
matrices pointer to an array of matrices
number the number of matrices in the array

LPMATRIX MatrixAddSub ( const LPMATRIX  first,
const LPMATRIX  second,
bool  bAdd 
)

Adds or subtracts two matrices.

Parameters:
first Pointer to a matrix
second Pointer to another matrix
bAdd True to perform addition, false for subtraction
Returns:
New Matrix with result, NULL if ERRORCHECK and matrices are incompatible sizes

LPMATRIX MatrixCopy ( LPMATRIX  src  ) 

Creates a copy of a matrix and its internal data.

Parameters:
src Source Matrix To copy
Returns:
Pointer to a copied matrix

float MatrixGet ( const LPMATRIX  matrix,
tinyint  row,
tinyint  col 
)

Gets a cell of a matrix.

Parameters:
matrix Pointer to the matrix
row row to retrieve
col column to retrieve
Returns:
Value of row,col

LPMATRIX MatrixInverse ( const LPMATRIX  matrix  ) 

Modified for a c environment, this performs an inversion of a symmetric square matrix.

Implementation of CholeskyCrout ganked from http://www.gpstk.org/doxygen/MatrixFunctors_8hpp-source.html#l00658 More ganks http://www.gpstk.org/doxygen/MatrixOperators_8hpp-source.html#l00544

Parameters:
matrix Matrix to be inverted
Returns:
Inverted Matrix, NULL if ERRORCHECK and non-square matrix

LPMATRIX MatrixMultiply ( const LPMATRIX  first,
LPMATRIX  second 
)

Multiplies two matrices together.

Parameters:
first Pointer to a matrix
second Pointer to a matrix
Returns:
New matrix with result, NULL if ERRORCHECK and matrices are invalid sizes

bool MatrixSet ( LPMATRIX  matrix,
tinyint  row,
tinyint  col,
float  data 
)

Sets a cell of a matrix.

Parameters:
matrix Pointer to the matrix
row Row to set
col Column to set
Returns:
true if successfull / false if not

void MatrixSetAll ( LPMATRIX  matrix,
float  value 
)

Sets an entire matrix to a single value.

Parameters:
matrix Pointer to the matrix
value Value to set the matrix to

LPMATRIX MatrixTranspose ( const LPMATRIX  matrix  ) 

Tranposes a matrix.

Parameters:
matrix Pointer to the matrix to transpose
Returns:
New tranposed matrix


Generated on Sat Jul 25 02:20:25 2009 for Matrix Lite Lib by  doxygen 1.5.9