mPCA.c File Reference
#include <stdio.h>
#include <math.h>
#include <AR/matrix.h>
Go to the source code of this file.
Defines |
#define | EPS 1e-6 |
#define | MAX_ITER 100 |
#define | VZERO 1e-16 |
#define | xmalloc(V, T, S) |
Functions |
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.
|
static int | CENTER (ARMat *inout, ARVec *mean) |
static int | EV_create (ARMat *input, ARMat *u, ARMat *output, ARVec *ev) |
static int | EX (ARMat *input, ARVec *mean) |
static int | PCA (ARMat *input, ARMat *output, ARVec *ev) |
static int | QRM (ARMat *u, ARVec *ev) |
static int | x_by_xt (ARMat *input, ARMat *output) |
static int | xt_by_x (ARMat *input, ARMat *output) |
Define Documentation
Definition at line 6 of file mPCA.c.
Definition at line 7 of file mPCA.c.
Definition at line 5 of file mPCA.c.
#define xmalloc |
( |
V, |
|
|
T, |
|
|
S |
|
) |
|
Value:{ if( ((V) = (T *)malloc( sizeof(T) * (S) ))\
== NULL ) {printf("malloc error\n"); exit(1);} }
Definition at line 8 of file mPCA.c.
Function Documentation
compute the PCA of a matrix.
Compute the Principal Component Analysis (PCA) of a matrix.
- Parameters:
-
| input | source matrix |
| evec | eigen vector computed |
| ev | eigen value computed |
| mean | mean computed |
- Returns:
- 0 if success to compute, -1 otherwise
Definition at line 49 of file mPCA.c.
compute the PCA of a matrix.
Compute the Principal Component Analysis (PCA) of a matrix.
- Parameters:
-
| input | source matrix |
| evec | result matrix |
| ev | egein value computed |
- Returns:
- 0 if success to compute, -1 otherwise
Definition at line 89 of file mPCA.c.
static int CENTER |
( |
ARMat * |
inout, |
|
|
ARVec * |
mean | |
|
) |
| | [static] |
static int EX |
( |
ARMat * |
input, |
|
|
ARVec * |
mean | |
|
) |
| | [static] |
static int x_by_xt |
( |
ARMat * |
input, |
|
|
ARMat * |
output | |
|
) |
| | [static] |
static int xt_by_x |
( |
ARMat * |
input, |
|
|
ARMat * |
output | |
|
) |
| | [static] |