ARToolkit algebric mathematics subroutines. More...
#include <math.h>
#include <AR/config.h>
Go to the source code of this file.
Classes | |
struct | ARMat |
matrix structure. More... | |
struct | ARVec |
vector structure. More... | |
Defines | |
#define | ARELEM0(mat, r, c) ((mat)->m[(r)*((mat)->clm)+(c)]) |
macro function that give direct access to an element (0 origin) | |
#define | ARELEM1(mat, row, clm) ARELEM0(mat,row-1,clm-1) |
macro function that give direct access to an element (1 origin) | |
Functions | |
ARMat * | arMatrixAlloc (int row, int clm) |
creates a new matrix. | |
ARMat * | arMatrixAllocDup (ARMat *source) |
dumps a new matrix | |
ARMat * | arMatrixAllocInv (ARMat *source) |
inverses a matrix. | |
ARMat * | arMatrixAllocMul (ARMat *a, ARMat *b) |
Multiply two matrix with memory allocation. | |
ARMat * | arMatrixAllocTrans (ARMat *source) |
transposes a matrix with allocation. | |
ARMat * | arMatrixAllocUnit (int dim) |
Creates a unit matrix. | |
double | arMatrixDet (ARMat *m) |
compute determinant of a matrix. | |
int | arMatrixDisp (ARMat *m) |
display content of a matrix. | |
int | arMatrixDup (ARMat *dest, ARMat *source) |
copy a matrix | |
int | arMatrixFree (ARMat *m) |
deletes a matrix. | |
int | arMatrixInv (ARMat *dest, ARMat *source) |
inverse a matrix. | |
int | arMatrixMul (ARMat *dest, ARMat *a, ARMat *b) |
Multiply two matrix. | |
int | arMatrixPCA (ARMat *input, ARMat *evec, ARVec *ev, ARVec *mean) |
compute the PCA of a matrix. | |
int | arMatrixPCA2 (ARMat *input, ARMat *evec, ARVec *ev) |
compute the PCA of a matrix. | |
int | arMatrixSelfInv (ARMat *m) |
inverses a matrix. | |
int | arMatrixTrans (ARMat *dest, ARMat *source) |
transposes a matrix. | |
int | arMatrixUnit (ARMat *unit) |
Creates a unit matrix. | |
ARVec * | arVecAlloc (int clm) |
creates a new vector. | |
int | arVecDisp (ARVec *v) |
display a vector. | |
int | arVecFree (ARVec *v) |
delete a vector. | |
double | arVecHousehold (ARVec *x) |
XXXBK. | |
double | arVecInnerproduct (ARVec *x, ARVec *y) |
Computes the inner product of 2 vectors. | |
int | arVecTridiagonalize (ARMat *a, ARVec *d, ARVec *e) |
XXXBK. |
ARToolkit algebric mathematics subroutines.
This package include matrix, vector manipulation routine. In complement to must classical routines (inversion, innerproduct), it includes a PCA (Principal) Component Analysis) routine. For the structure of the matrix see ARMat.
History :
Definition in file matrix.h.
#define ARELEM0 | ( | mat, | |||
r, | |||||
c | ) | ((mat)->m[(r)*((mat)->clm)+(c)]) |
#define ARELEM1 | ( | mat, | |||
row, | |||||
clm | ) | ARELEM0(mat,row-1,clm-1) |
ARMat * arMatrixAlloc | ( | int | row, | |
int | clm | |||
) |
dumps a new matrix
Allocates and recopy the original source matrix.
source | the source matrix to copy |
Definition at line 22 of file mAllocDup.c.
int arMatrixAllocInv | ( | ARMat * | source | ) |
inverses a matrix.
Inverses a matrix and copy the result in in a new allocated structure.
source | the matrix to inverse |
Definition at line 21 of file mAllocInv.c.
Multiply two matrix with memory allocation.
multiply two matrix and copy the result in a new allocate matrix (the source matrix is unmodified). the product is this one : dest = a * b
a | first matrix | |
b | second matrix |
Definition at line 21 of file mAllocMul.c.
transposes a matrix with allocation.
transposes a matrix and copy the result in a new allocate matrix (the source matrix is unmodified).
source | the matrix to transpose |
Definition at line 21 of file mAllocTrans.c.
int arMatrixAllocUnit | ( | int | dim | ) |
Creates a unit matrix.
Allocates and initializes a matrix to a an identity matrix.
dim | dimensions of the unit matrix (square) |
Definition at line 21 of file mAllocUnit.c.
int arMatrixDet | ( | ARMat * | m | ) |
int arMatrixDisp | ( | ARMat * | m | ) |
int arMatrixFree | ( | ARMat * | m | ) |
inverse a matrix.
inverse a matrix and copy the result in a new one (the source matrix is unmodified). the destination matrix must be allocated. the source matrix need to be a square matrix.
dest | result matrix of the inverse operation | |
source | source matrix |
Multiply two matrix.
Multiply two matrix and copy the result in another the product is this one : dest = a * b. The destination matrix must be allocated. Matrix a and b need to have the same size (the source matrix is unmodified).
dest | final matrix product | |
a | first matrix | |
b | second matrix |
int arMatrixSelfInv | ( | ARMat * | m | ) |
inverses a matrix.
Inverses a matrix and copy the result in the same structure.
m | the matrix to inverse |
Definition at line 18 of file mSelfInv.c.
transposes a matrix.
Transposes a matrix. The destination matrix must be allocated (the source matrix is unmodified).
dest | the destination matrix of the copy | |
source | the source matrix |
int arMatrixUnit | ( | ARMat * | unit | ) |
ARVec * arVecAlloc | ( | int | clm | ) |
int arVecDisp | ( | ARVec * | v | ) |
int arVecFree | ( | ARVec * | v | ) |
double arVecHousehold | ( | ARVec * | x | ) |
XXXBK.
XXXBK
a | XXXBK | |
d | XXXBK | |
e | XXXBK |
Definition at line 17 of file vTridiag.c.