MinMaxAnalysis.h 988 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef MINMAXANALYSIS_H
  2. #define MINMAXANALYSIS_H
  3. #include <QVector>
  4. class MinMaxAnalysis
  5. {
  6. public:
  7. typedef QVector<qreal> EvaluateIndex; //评估指标
  8. typedef QVector<qreal> Relations; //联系度
  9. enum AnalysisType
  10. {
  11. Min_Analysis, // X / min
  12. Max_Analysis, // x / max
  13. Analysis_THD1, // (max + min -x) / max
  14. Analysis_THD2, // (max - x) / (max - min)
  15. Analysis_THD3, // (x - min ) / (max - min)
  16. Analysis_THD4, // (x - min ) * k / (max - min) + q
  17. };
  18. MinMaxAnalysis(const QVector<EvaluateIndex> &rMat, AnalysisType type, qreal _k = 0, qreal _q = 0);
  19. const QVector<EvaluateIndex> &normalization();
  20. /**
  21. * @brief 联系度值
  22. * @return
  23. */
  24. Relations getRelations() const;
  25. private:
  26. AnalysisType analysisType;
  27. QVector<EvaluateIndex> originMat;
  28. QVector<EvaluateIndex> normalMat;
  29. qreal k;
  30. qreal q;
  31. void calcNormalMat();
  32. };
  33. #endif // MINMAXANALYSIS_H