[1044] | 1 | // This file is a part of Framsticks SDK. http://www.framsticks.com/ |
---|
| 2 | // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. |
---|
| 3 | // See LICENSE.txt for details. |
---|
| 4 | |
---|
| 5 | #ifndef DISTRIBUTION_MEASURE_H |
---|
| 6 | #define DISTRIBUTION_MEASURE_H |
---|
| 7 | |
---|
[1048] | 8 | #include "simil-measure-base.h" |
---|
[1044] | 9 | #include "EMD/emd.h" |
---|
| 10 | |
---|
[1048] | 11 | class SimilMeasureDistribution : public SimilMeasureBase |
---|
[1044] | 12 | { |
---|
| 13 | public: |
---|
| 14 | SimilMeasureDistribution(); |
---|
| 15 | ~SimilMeasureDistribution(){}; |
---|
| 16 | int setParams(std::vector<double> params); |
---|
| 17 | void calculateFuns(); |
---|
| 18 | void calculateFun(std::pair<double, float> *fun, Model &sampled); |
---|
| 19 | double compareFuns(); |
---|
| 20 | double EMD(std::pair<double, float> *fun1, std::pair<double, float> *fun2); |
---|
| 21 | double density; |
---|
| 22 | int samples_num; |
---|
| 23 | int bin_num; |
---|
| 24 | /// Interface to local parameters |
---|
| 25 | Param localpar; |
---|
| 26 | |
---|
| 27 | protected: |
---|
| 28 | std::pair<double, float> *funs[2]; |
---|
| 29 | SolidsShapeTypeModel *sst_models[2]; |
---|
| 30 | std::vector<double> (SimilMeasureDistribution::*distribution_fun)(int samples_taken, Model *sampled); |
---|
| 31 | |
---|
| 32 | void fillPointsWeights(std::pair<double, float> *fun, feature_t *points, float *weights); |
---|
| 33 | double getDistance(); |
---|
| 34 | std::vector<double> D2(int samples_taken, Model *sampled); |
---|
| 35 | std::vector<double> D1(int samples_taken, Model *sampled); |
---|
| 36 | std::vector<double> D3(int samples_taken, Model *sampled); |
---|
| 37 | std::vector<double> D4(int samples_taken, Model *sampled); |
---|
| 38 | std::vector<double> A3(int samples_taken, Model *sampled); |
---|
| 39 | }; |
---|
| 40 | |
---|
| 41 | #endif /* DISTRIBUTION_MEASURE_H */ |
---|
| 42 | |
---|