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