moved sinc() to utils

This commit is contained in:
Ahmet Inan 2019-01-03 19:50:18 +01:00
commit 6769872b39
4 changed files with 9 additions and 10 deletions

View file

@ -29,6 +29,12 @@ TYPE normal_pdf(TYPE x, TYPE m, TYPE s)
return std::exp(-std::pow((x - m) / s, TYPE(2)) / TYPE(2)) / (Const<TYPE>::SqrtTwoPi() * s);
}
template <typename TYPE>
TYPE sinc(TYPE x)
{
return TYPE(0) == x ? TYPE(1) : std::sin(Const<TYPE>::Pi() * x) / (Const<TYPE>::Pi() * x);
}
}
#endif