// // Created by lenovo on 2023/10/16. // #ifndef ALGORITHM_GREYCLUSTEREVALUATION_H #define ALGORITHM_GREYCLUSTEREVALUATION_H #include struct GCERange { int level; // 等级 double left_left; double left_val; double right_val; double right_right; }; struct GCEmat { double front_val; double back_val; }; struct BestIndex { int front_index; int back_index; }; typedef QVector GCEMat; typedef QVector> GCERangeMat; /** * @brief 灰色聚类 */ class GreyClusterEvaluation { public: /** * * @param mat : 输入矩阵,一行代表一个指标, 指标中front_val,back_val表示前后样本 * @param ranges : 各项指标的评价等级 */ GreyClusterEvaluation(const GCEMat &mat, const GCERangeMat &ranges); void evaluate(const QVector &weights); BestIndex getBestIndex() const; const QVector &getRangeWeights() const; const QVector &getRangeCVT() const; int sample_num_; // 样本数 int level_num_; // 等级数 private: void triangularwhiteningweight(int sam, double front_val, double back_val); void evaluationlevel(const QVector &weights); GCEMat mat_; GCERangeMat ranges_; QVector ranges_cv_; QVector ranges_weight_; }; #endif // ALGORITHM_GREYCLUSTEREVALUATION_H