// // Created by Austin on 2023/10/11. // #ifndef ALGORITHM__MATTERELEMENTANALYSIS_H_ #define ALGORITHM__MATTERELEMENTANALYSIS_H_ #include struct MEARange { int index; //指标号 bool left_close; //左闭合 bool right_close; //右闭合 double min_value; double max_value; }; typedef QVector> MEAMat; typedef QVector> MEARangeMat; /** * @brief 物元法 */ class MatterElementAnalysis { public: /** * * @param mat : 输入矩阵,一行代表一个样本, 每列对应一个指标 * @param ranges : 各项指标的评价等级 */ MatterElementAnalysis(const MEAMat &mat, const MEARangeMat &ranges); void evaluate(const QVector &weights); const MEAMat &getRangeWeights() const; const QVector &getRangeCVT() const; QVector getBestIndex() const; int sample_num_; // 样本数 int index_num_; // 指标数 private: void associatedValue(int sam, int index, double value); void evaluationlevel(const QVector &weights); MEAMat mat_; MEARangeMat ranges_; QVector range_cvt_; MEAMat range_weights_; }; #endif // ALGORITHM__MATTERELEMENTANALYSIS_H_