sunpinyin-2.0.4_pre20130108-gcc6-use-float.patch 1010 B

123456789101112131415161718
  1. --- sunpinyin-2.0.4_pre20130108/src/slm/tslmpack/common.h.old 2016-09-20 02:54:15.046257131 -0400
  2. +++ sunpinyin-2.0.4_pre20130108/src/slm/tslmpack/common.h 2016-09-20 02:55:48.041124978 -0400
  3. @@ -53,10 +53,10 @@
  4. typedef std::map<float, int> RealIndexMap; // map real values to their indices
  5. typedef std::map<std::string, unsigned int> TLexicon; // map word to wid
  6. -#define EffectivePr(a) (float((usingLogPr) ? ((a) / log(2.0)) : (-log2((a)))))
  7. -#define OriginalPr(b) (float((usingLogPr) ? ((b) * log(2.0)) : (exp2(-(b)))))
  8. -#define EffectiveBow(a) (float((usingLogPr) ? (exp(-(a))) : ((a))))
  9. -#define OriginalBow(b) (float((usingLogPr) ? (-log((b))) : ((b))))
  10. +#define EffectivePr(a) (float((usingLogPr) ? ((a) / logf(2.0f)) : (-log2f((a)))))
  11. +#define OriginalPr(b) (float((usingLogPr) ? ((b) * logf(2.0f)) : (exp2f(-(b)))))
  12. +#define EffectiveBow(a) (float((usingLogPr) ? (expf(-(a))) : ((a))))
  13. +#define OriginalBow(b) (float((usingLogPr) ? (-logf((b))) : ((b))))
  14. #endif //_SLM_PACK_COMMON_H