use constexpr to replace static const

This commit is contained in:
stereomatchingkiss
2016-04-12 19:01:18 +08:00
parent 78f6ac2e03
commit 63be94ebfa
@@ -54,11 +54,11 @@ class LogSoftmaxLayer
output.transform( [](double x)
{
//! Fast approximation of exp(-x) for x positive.
static const double A0 = 1.0;
static const double A1 = 0.125;
static const double A2 = 0.0078125;
static const double A3 = 0.00032552083;
static const double A4 = 1.0172526e-5;
constexpr double A0 = 1.0;
constexpr double A1 = 0.125;
constexpr double A2 = 0.0078125;
constexpr double A3 = 0.00032552083;
constexpr double A4 = 1.0172526e-5;
if (x < 13.0)
{