1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
From: Kefu Chai <tchaikov@gmail.com>
Date: Wed, 18 Apr 2018 19:25:09 +0800
Subject: slm/thread: be more consistent by using the C++ variant of log and
exp
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
---
src/slm/thread/slmthread.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/slm/thread/slmthread.cpp b/src/slm/thread/slmthread.cpp
index c6ef1d0..dc6c1b9 100644
--- a/src/slm/thread/slmthread.cpp
+++ b/src/slm/thread/slmthread.cpp
@@ -57,7 +57,9 @@
#include "ValueCompress.h"
using std::log;
+using std::log2;
using std::exp;
+using std::exp2;
class CSIMSlmWithIteration : public CSIMSlm {
public:
@@ -253,8 +255,8 @@ main(int argc, char* argv[])
bool usingLogPr = slm.isUseLogPr();
- #define EffectivePr(a) (usingLogPr ? ((a) / log(2.0)) : -log2f((a)))
- #define OriginalPr(b) (usingLogPr ? ((b) * log(2.0)) : exp2(-(b)))
+ #define EffectivePr(a) (usingLogPr ? ((a) / log(2.0f)) : -log2((a)))
+ #define OriginalPr(b) (usingLogPr ? ((b) * log(2.0f)) : exp2(-(b)))
#define EffectiveBow(a) (usingLogPr ? exp(-(a)) : (a))
#define OriginalBow(b) (usingLogPr ? -log((b)) : (b))
|