Single result of a query
| 20 | |
| 21 | /// Single result of a query |
| 22 | class Result { |
| 23 | public: |
| 24 | /// Entry id |
| 25 | EntryId Id; |
| 26 | |
| 27 | /// Score obtained |
| 28 | double Score; |
| 29 | |
| 30 | /// debug |
| 31 | int nWords; // words in common |
| 32 | // !!! this is filled only by Bhatt score! |
| 33 | // (and for BCMatching, BCThresholding then) |
| 34 | |
| 35 | double bhatScore, chiScore; |
| 36 | /// debug |
| 37 | |
| 38 | // only done by ChiSq and BCThresholding |
| 39 | double sumCommonVi; |
| 40 | double sumCommonWi; |
| 41 | double expectedChiScore; |
| 42 | /// debug |
| 43 | |
| 44 | /** |
| 45 | * Empty constructors |
| 46 | */ |
| 47 | inline Result() {} |
| 48 | |
| 49 | /** |
| 50 | * Creates a result with the given data |
| 51 | * @param _id entry id |
| 52 | * @param _score score |
| 53 | */ |
| 54 | inline Result(EntryId _id, double _score) : Id(_id), Score(_score) {} |
| 55 | |
| 56 | /** |
| 57 | * Compares the scores of two results |
| 58 | * @return true iff this.score < r.score |
| 59 | */ |
| 60 | inline bool operator<(const Result& r) const { return this->Score < r.Score; } |
| 61 | |
| 62 | /** |
| 63 | * Compares the scores of two results |
| 64 | * @return true iff this.score > r.score |
| 65 | */ |
| 66 | inline bool operator>(const Result& r) const { return this->Score > r.Score; } |
| 67 | |
| 68 | /** |
| 69 | * Compares the entry id of the result |
| 70 | * @return true iff this.id == id |
| 71 | */ |
| 72 | inline bool operator==(EntryId id) const { return this->Id == id; } |
| 73 | |
| 74 | /** |
| 75 | * Compares the score of this entry with a given one |
| 76 | * @param s score to compare with |
| 77 | * @return true iff this score < s |
| 78 | */ |
| 79 | inline bool operator<(double s) const { return this->Score < s; } |
no outgoing calls
no test coverage detected