diff options
author | Matous Machacek <machacekmatous@gmail.com> | 2012-03-18 02:35:56 +0400 |
---|---|---|
committer | Matous Machacek <machacekmatous@gmail.com> | 2012-03-18 02:35:56 +0400 |
commit | 73d5c9ea4eb89b142c02ad1005eb20a08595936e (patch) | |
tree | fd1107c0e06b2d3ac2c8bdf6b8d6911d7813662d /mert/CderScorer.cpp | |
parent | 6b95a19eda818fb772767a0037c70a7bbb6c32e5 (diff) |
Fixed bug in CderScorer.cpp
Diffstat (limited to 'mert/CderScorer.cpp')
-rw-r--r-- | mert/CderScorer.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mert/CderScorer.cpp b/mert/CderScorer.cpp index 424c210b3..9ad71fc55 100644 --- a/mert/CderScorer.cpp +++ b/mert/CderScorer.cpp @@ -70,6 +70,7 @@ float CderScorer::calculateScore(const vector<int>& comps) const if (comps.size() != 2) { throw runtime_error("Size of stat vector for CDER is not 2"); } + if (comps[1] == 0) return 1.0f; return 1.0f - (comps[0] / static_cast<float>(comps[1])); } |