Computes squared L2 norm of vector of tokens.
| 41 | |
| 42 | // Computes squared L2 norm of vector of tokens. |
| 43 | double SqrL2(IdfMap & idfs, vector<TokenFrequencyPair> const & tfs) |
| 44 | { |
| 45 | double sum = 0; |
| 46 | for (auto const & tf : tfs) |
| 47 | sum += GetSqrWeightImpl(idfs, tf, false /* isPrefix */); |
| 48 | return sum; |
| 49 | } |
| 50 | |
| 51 | // Computes squared L2 norm of vector of tokens + prefix token. |
| 52 | double SqrL2(IdfMap & idfs, vector<TokenFrequencyPair> const & tfs, optional<strings::UniString> const & prefix) |
no test coverage detected