#include <malloc.h>
#include "MatrixLiteLib.h"
Defines | |
#define | NULL 0 |
#define | ERRORCHECK |
Enables Error Checking on applicable functions. | |
Functions | |
bool | InitializeMatrixData (LPMATRIX matrix, tinyint rows, tinyint cols) |
Internal function that initializes a matrix structure with its data. | |
void | MLmemcpy (void *d, const void *source, size_t len) |
Replacement for memcpy, since we need it and its size prohitibitive to include string.h for it. | |
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 first, const LPMATRIX second, 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. |
#define ERRORCHECK |
Enables Error Checking on applicable functions.
You should really only do this for debugging, it does add some overhead to each function that it applies (and if size is really important this can be bad
#define NULL 0 |
Returns a pointer to a new Matrix, that is the identity matrix for the size Row x Row.
rows | size of the matrix to return |
Returns a pointer to an array of matrices size rows x cols.
rows | Number of Rows in matrix | |
cols | Number of Columns in matrix | |
number | Numer of matrices to create |
Frees an array of matrices.
matrices | pointer to an array of matrices | |
number | the number of matrices in the array |
Internal function that initializes a matrix structure with its data.
matrix | pointer to a matrix structure | |
rows | rows in matrix | |
cols | columns in matrix |
Adds or subtracts two matrices.
first | Pointer to a matrix | |
second | Pointer to another matrix | |
bAdd | True to perform addition, false for subtraction |
Creates a copy of a matrix and its internal data.
src | Source Matrix To copy |
Gets a cell of a matrix.
matrix | Pointer to the matrix | |
row | row to retrieve | |
col | column to retrieve |
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
matrix | Matrix to be inverted |
Multiplies two matrices together.
first | Pointer to a matrix | |
second | Pointer to a matrix |
Sets a cell of a matrix.
matrix | Pointer to the matrix | |
row | Row to set | |
col | Column to set |
void MatrixSetAll | ( | LPMATRIX | matrix, | |
float | value | |||
) |
Sets an entire matrix to a single value.
matrix | Pointer to the matrix | |
value | Value to set the matrix to |
Tranposes a matrix.
matrix | Pointer to the matrix to transpose |
void MLmemcpy | ( | void * | d, | |
const void * | source, | |||
size_t | len | |||
) |
Replacement for memcpy, since we need it and its size prohitibitive to include string.h for it.
d | Destination Pointer | |
source | Source Pointer | |
len | sizeof code in bytes |