From 98a5a204d1b47e28433aed767bf2e5c88d784985 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Sun, 20 Jan 2019 11:03:29 +0100 Subject: [PATCH] removed std:: from math functions --- coeffs.hh | 2 +- utils.hh | 6 +++--- window.hh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/coeffs.hh b/coeffs.hh index 71ba486..9303483 100644 --- a/coeffs.hh +++ b/coeffs.hh @@ -36,7 +36,7 @@ public: for (int n = 0; n < TAPS; ++n) sum += w[n]; for (int n = 0; n < TAPS; ++n) - w[n] /= divisor * std::abs(sum); + w[n] /= divisor * abs(sum); } inline TYPE operator () (int n) { return n >= 0 && n < TAPS ? w[n] : 0; } inline operator const TYPE * () const { return w; } diff --git a/utils.hh b/utils.hh index 28bb35c..16ea615 100644 --- a/utils.hh +++ b/utils.hh @@ -25,13 +25,13 @@ AB lerp(X x, AB a, AB b) template TYPE normal_pdf(TYPE x, TYPE m, TYPE s) { - return std::exp(-std::pow((x - m) / s, TYPE(2)) / TYPE(2)) / (Const::SqrtTwoPi() * s); + return exp(-pow((x - m) / s, TYPE(2)) / TYPE(2)) / (Const::SqrtTwoPi() * s); } template TYPE sinc(TYPE x) { - return TYPE(0) == x ? TYPE(1) : std::sin(Const::Pi() * x) / (Const::Pi() * x); + return TYPE(0) == x ? TYPE(1) : sin(Const::Pi() * x) / (Const::Pi() * x); } template @@ -43,7 +43,7 @@ TYPE delta(TYPE x) template TYPE decibel(TYPE v) { - return TYPE(10) * std::log10(v); + return TYPE(10) * log10(v); } } diff --git a/window.hh b/window.hh index e7adf59..7bffef7 100644 --- a/window.hh +++ b/window.hh @@ -75,7 +75,7 @@ public: Gauss(TYPE o) : o(o) {} TYPE operator () (int n, int N) { - return std::exp(- TYPE(0.5) * std::pow((TYPE(n) - TYPE(N - 1) / TYPE(2)) / (o * TYPE(N - 1) / TYPE(2)), TYPE(2))); + return exp(- TYPE(0.5) * pow((TYPE(n) - TYPE(N - 0) / TYPE(2)) / (o * TYPE(N - 1) / TYPE(2)), TYPE(2))); } }; @@ -109,7 +109,7 @@ public: Kaiser(TYPE a) : a(a) {} TYPE operator () (int n, int N) { - return i0(Const::Pi() * a * std::sqrt(TYPE(1) - std::pow(TYPE(2 * n) / TYPE(N - 1) - TYPE(1), TYPE(2)))) / i0(Const::Pi() * a); + return i0(Const::Pi() * a * sqrt(TYPE(1) - pow(TYPE(2 * n) / TYPE(N - 1) - TYPE(1), TYPE(2)))) / i0(Const::Pi() * a); } };