CMatrix
所属分类:数学计算
开发工具:QT
文件大小:62KB
下载次数:25
上传日期:2011-12-06 14:47:44
上 传 者:
fly2rain
说明: 对称矩阵相关元算,主成分分析(PCA), fisher
discriminant analysis(FDA).,
(Introduction
============
This is a class for symmetric matrix related computations. It can be used for
symmetric matrix diagonalization and inversion. If given the covariance matrix,
users can utilize the class for principal component analysis(PCA) and fisher
discriminant analysis(FDA). It can also be used for some elementary matrix and
vector computations.
Usage
=====
It s a C++ program for symmetric matrix diagonalization, inversion and principal
component anlaysis(PCA).
To use it, you need to define an instance of CMatrix class, initialize matrix,
call the public funtions, and finally, free the matrix. For example, for PCA,
CMarix theMat // define CMatrix instance
float** C // define n*n matrix
C = theMat.allocMat( n )
Calculate the matrix (e.g., covariance matrix from data)
float*phi,*lambda // eigenvectors and eigenvalues
int vecNum // number of eigenvectors (<=n)
phi = new float [n*vecNum]
lambda = new float [vecNum]
the)
文件列表:
CMatrix (0, 2011-11-07)
CMatrix\cmatrix (65978, 2011-11-07)
CMatrix\cmatrix.pro (113, 2011-11-02)
CMatrix\cmatrix.pro.user (11129, 2011-11-08)
CMatrix\example (0, 2011-11-04)
CMatrix\example.o (58016, 2011-11-07)
CMatrix\example\example.cpp (2854, 2011-11-07)
CMatrix\example\Makefile (214, 2010-10-31)
CMatrix\Makefile (6691, 2011-11-02)
CMatrix\Matrix.cpp (18304, 2011-11-07)
CMatrix\Matrix.h (2994, 2011-11-03)
CMatrix\Matrix.o (35224, 2011-11-07)
CMatrix Class
Chenglin LIU (liucl@nlpr.ia.ac.cn)
Introduction
============
This is a class for symmetric matrix related computations. It can be used for
symmetric matrix diagonalization and inversion. If given the covariance matrix,
users can utilize the class for principal component analysis(PCA) and fisher
discriminant analysis(FDA). It can also be used for some elementary matrix and
vector computations.
Usage
=====
It's a C++ program for symmetric matrix diagonalization, inversion and principal
component anlaysis(PCA).
To use it, you need to define an instance of CMatrix class, initialize matrix,
call the public funtions, and finally, free the matrix. For example, for PCA,
CMarix theMat; // define CMatrix instance
float** C; // define n*n matrix
C = theMat.allocMat( n );
Calculate the matrix (e.g., covariance matrix from data);
float *phi, *lambda; // eigenvectors and eigenvalues
int vecNum; // number of eigenvectors (<=n)
phi = new float [n*vecNum];
lambda = new float [vecNum];
theMat.PCA( C, n, phi, lambda, vecNum );
delete phi;
delete lambda;
theMat.freeMat( C, n );
The matrix diagonalization function can also be applied to the computation of
singular value decomposition (SVD), Fisher linear discriminant analysis (FLDA)
and kernel PCA (KPCA) if forming the symmetric matrix appropriately.
For data of very high dimensionality (n), the computation of nxn matrix is very
expensive on personal computer. But if the number m of samples (vectors) is
smaller than dimenionality, the problem can be converted to the computation
of mxm matrix.
The users are recommended to read the paper KPCA for how to form mxm matrix:
B. Scholkopf, A. Smola, K.-R. Muller. Nonlinear component analysis as a kernel
eigenvalue problem, Neural Computation, 10(5): 1299-1319, 19***.
Example
=======
Refer to `example' directory for a simple demonstration.
Availability
============
It is available at http://www.openpr.org.cn
近期下载者:
相关文件:
收藏者: