📄 model.h
字号:
//
//Please find details of the method from
//
// Q. Zhang, A. Zhou and Y. Jin, "RM-MEDA: A Regularity Model Based Multiobjective Estimation of Distribution Algorithm", IEEE Trans. Evolutionary Computation, Vol. 12, no. 1, pp41-63, 2008.
//
//The source codes are free for reserach work. If you have any problem with the source codes, please contact with
// Qingfu Zhang,
// Department of Computing and Electronic Systems,
// University of Essex,
// Colchester, CO4 3SQ, UK
// http://cswww.essex.ac.uk/staff/zhang
// Email: qzhang@essex.ac.uk
// Aimin Zhou
// Department of Computing and Electronic Systems,
// University of Essex,
// Colchester, CO4 3SQ, UK
// http://privatewww.essex.ac.uk/~azhou/
// Email: azhou@essex.ac.uk or amzhou@gmail.com
//Programmer:
// Aimin Zhou
//Last Update:
// Feb. 21, 2008
//
//Model.h : Estimation Distribution Models//#ifndef AZ_MODEL_H#define AZ_MODEL_H#include <fstream>#include <string>#include <vector>//!\brief az namespace, the top namespace
namespace az
{
//!\brief alg namespace, contains algorithms
namespace alg
{//!\brief calcualte the eigenvalues and eigenvectors of a covariance matrix//!\param eva sorted eigenvalues//!\param eve sorted eigenvectors//!\param no the main no-eigens are stored//!\param cov the covariance matrix//!\return voidvoid Eigen(std::vector<double>& eva, std::vector< std::vector<double> >& eve, unsigned int no, std::vector< std::vector<double> >& cov);//!\brief Model structure, used to store dataclass Model{public: double mErrTol; //!< error tolerance unsigned int mNClu, //!< number of clusters mNX, //!< number of trainning data mDX, //!< dimension of trainning data mDLat, //!< dimension of latent space mMaxIter, //!< maximal trainning steps mIter; //!< real trainning steps std::vector< unsigned int > mvIndex, //!< cluster index of each data mvNo; //!< the number of points assigned to each cluster std::vector< std::vector<double> > mvX, //!< trainning data, each row is a data vector mvMean, //!< center of each cluster mvEigenvalue, //!< eigenvalue of ecah cluster mvProMin, //!< minimal projection in primary dimensions mvProMax; //!< maximal projection in primary dimensions std::vector< std::vector< std::vector<double> > > mvEigenvector; //!< eigenvector of each clusterpublic: //!\brief set parameters //!\param nclu number of cluster //!\param nx number of trainning data //!\param dx dimension of trainning data //!\param dlat dimension of latent space //!\param maxiter maximal trainning steps //!\param errtol error tolerance //!\return void void Set(unsigned int nclu, unsigned int nx, unsigned int dx, unsigned int dlat, unsigned int maxiter=100, double errtol=1.0E-5); //!\brief write model into file //!\param file file name //!\return void void Write(std::string file);protected: //!\brief calcualte the mean, eigenvalue and eigenvector of a given set of data //!\param mean mean value of the data //!\param eva sorted eigenvalues //!\param eve sorted eigenvectors //!\param index index of given set of data //!\return void void Eigen(std::vector<double>& mean, std::vector<double>& eva, std::vector< std::vector<double> >& eve, std::vector< unsigned int >& index);};// class Model} //namespace alg
} //namespace az#endif //AZ_MODEL_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -