GreyClusterEvaluation.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // Created by lenovo on 2023/10/16.
  3. //
  4. #ifndef ALGORITHM_GREYCLUSTEREVALUATION_H
  5. #define ALGORITHM_GREYCLUSTEREVALUATION_H
  6. #include <QVector>
  7. struct GCERange {
  8. int level;//等级
  9. double left_left;
  10. double left_val;
  11. double right_val;
  12. double right_right;
  13. };
  14. struct GCEmat {
  15. double front_val;
  16. double back_val;
  17. };
  18. struct BestIndex {
  19. int front_index;
  20. int back_index;
  21. };
  22. typedef QVector<GCEmat> GCEMat;
  23. typedef QVector<QVector<GCERange> > GCERangeMat;
  24. class GreyClusterEvaluation {
  25. public:
  26. /**
  27. *
  28. * @param mat : 输入矩阵,一行代表一个指标, 指标中front_val,back_val表示前后样本
  29. * @param ranges : 各项指标的评价等级
  30. */
  31. GreyClusterEvaluation(const GCEMat &mat, const GCERangeMat &ranges);
  32. void evaluate();
  33. BestIndex getBestIndex() const;
  34. int sample_num_; //样本数
  35. int level_num_;//等级数
  36. private:
  37. void triangularwhiteningweight(int sam, double front_val, double back_val);
  38. void evaluationlevel(const QVector<double> &weights);
  39. GCEMat mat_;
  40. GCERangeMat ranges_;
  41. QVector<GCEMat> ranges_cv_;
  42. QVector<GCEmat> ranges_weight_;
  43. };
  44. #endif //ALGORITHM_GREYCLUSTEREVALUATION_H