Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Vermeulen <jtv@precisiontranslationtools.com>2015-05-20 10:37:00 +0300
committerJeroen Vermeulen <jtv@precisiontranslationtools.com>2015-05-20 10:37:00 +0300
commita66056cd394d2732c546b8b8af064dd1a4f4d7d7 (patch)
treed059c336aaab1ef74151ff425e8e27594af3ebc2 /moses/Incremental.cpp
parent8bbbc0670dbb969c0105bcc823e3c04e13d4e58e (diff)
Replace M_LN10 altogether. Not entirely standard.
Diffstat (limited to 'moses/Incremental.cpp')
-rw-r--r--moses/Incremental.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/moses/Incremental.cpp b/moses/Incremental.cpp
index 36f215a69..f5f5dde66 100644
--- a/moses/Incremental.cpp
+++ b/moses/Incremental.cpp
@@ -214,12 +214,21 @@ Manager::Manager(ttasksptr const& ttask)
Manager::~Manager()
{ }
+
+namespace
+{
+// Natural logarithm of 10.
+//
+// Some implementations of <cmath> define M_LM10, but not all.
+const float log_10 = logf(10);
+}
+
template <class Model, class Best> search::History Manager::PopulateBest(const Model &model, const std::vector<lm::WordIndex> &words, Best &out)
{
const LanguageModel &abstract = LanguageModel::GetFirstLM();
const float oov_weight = abstract.OOVFeatureEnabled() ? abstract.GetOOVWeight() : 0.0;
const StaticData &data = StaticData::Instance();
- search::Config config(abstract.GetWeight() * M_LN10, data.GetCubePruningPopLimit(), search::NBestConfig(data.GetNBestSize()));
+ search::Config config(abstract.GetWeight() * log_10, data.GetCubePruningPopLimit(), search::NBestConfig(data.GetNBestSize()));
search::Context<Model> context(config, model);
size_t size = m_source.GetSize();