kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Log | Files | Refs | README

commit d948dbd9a7dc4ead480a1d179da11ac18a0eda37
parent 641d691bbc50ddec3f17676ccc98017af29c3e22
Author: d.levin256@gmail.com <d.levin256@gmail.com>
Date:   Mon, 16 Oct 2023 09:18:00 +0100

Fix typo in epsilon

Diffstat:
Minclude/kfr/testo/comparison.hpp | 16++++++++--------
Mtests/complex_test.cpp | 2+-
Mtests/dsp_test.cpp | 2+-
Mtests/unit/base/basic_expressions.cpp | 2+-
Mtests/unit/base/reduce.cpp | 2+-
Mtests/unit/dsp/units.cpp | 8++++----
Mtests/unit/graphics/color.cpp | 2+-
Mtests/unit/graphics/geometry.cpp | 4++--
8 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/include/kfr/testo/comparison.hpp b/include/kfr/testo/comparison.hpp @@ -65,23 +65,23 @@ inline T& current_epsilon() } template <typename T = void> -struct eplison_scope +struct epsilon_scope { static_assert(std::is_floating_point_v<T>); - eplison_scope(T scale) { current_epsilon<T>() = std::numeric_limits<T>::epsilon() * scale; } - ~eplison_scope() { current_epsilon<T>() = saved; } + epsilon_scope(T scale) { current_epsilon<T>() = std::numeric_limits<T>::epsilon() * scale; } + ~epsilon_scope() { current_epsilon<T>() = saved; } T saved = current_epsilon<T>(); }; template <> -struct eplison_scope<void> +struct epsilon_scope<void> { - eplison_scope(float scale) : f(scale), d(static_cast<double>(scale)), ld(static_cast<long double>(scale)) + epsilon_scope(float scale) : f(scale), d(static_cast<double>(scale)), ld(static_cast<long double>(scale)) { } - eplison_scope<float> f; - eplison_scope<double> d; - eplison_scope<long double> ld; + epsilon_scope<float> f; + epsilon_scope<double> d; + epsilon_scope<long double> ld; }; CMT_PRAGMA_GNU(GCC diagnostic pop) diff --git a/tests/complex_test.cpp b/tests/complex_test.cpp @@ -99,7 +99,7 @@ TEST(complex_math) CHECK(carg(c32{ 0.f, -1.f }) == -c_pi<float> / 2); CHECK(carg(c32{ -1.f, 0.f }) == c_pi<float>); - testo::eplison_scope<void> eps(5); + testo::epsilon_scope<void> eps(5); CHECK(csin(c32{ 1.f, 1.f }) == c32{ 1.2984575814159773f, 0.634963914784736f }); CHECK(ccos(c32{ 1.f, 1.f }) == c32{ 0.8337300251311489f, -0.9888977057628651f }); diff --git a/tests/dsp_test.cpp b/tests/dsp_test.cpp @@ -20,7 +20,7 @@ namespace CMT_ARCH_NAME TEST(goertzel) { - testo::eplison_scope<float> e(100); + testo::epsilon_scope<float> e(100); univector<float, 16> a; a = sinenorm(phasor(0.125f)); diff --git a/tests/unit/base/basic_expressions.cpp b/tests/unit/base/basic_expressions.cpp @@ -16,7 +16,7 @@ inline namespace CMT_ARCH_NAME TEST(linspace) { - testo::eplison_scope<> eps(10); + testo::epsilon_scope<> eps(10); CHECK_EXPRESSION(linspace(0.0, 1.0, 5, true, ctrue), { 0.0, 0.25, 0.50, 0.75, 1.0 }); CHECK_EXPRESSION(linspace(0.0, 1.0, 4, false, ctrue), { 0.0, 0.25, 0.50, 0.75 }); CHECK(get_shape(linspace(0.0, 1.0, 5, true, cfalse)) == shape{ infinite_size }); diff --git a/tests/unit/base/reduce.cpp b/tests/unit/base/reduce.cpp @@ -15,7 +15,7 @@ inline namespace CMT_ARCH_NAME TEST(reduce) { - testo::eplison_scope<void> e(100); + testo::epsilon_scope<void> e(100); { univector<float, 6> a({ 1, 2, 3, 4, 5, -9 }); CHECK(sum(a) == 6); diff --git a/tests/unit/dsp/units.cpp b/tests/unit/dsp/units.cpp @@ -13,7 +13,7 @@ inline namespace CMT_ARCH_NAME TEST(note_to_hertz) { - testo::eplison_scope<void> eps(2000); + testo::epsilon_scope<void> eps(2000); CHECK(kfr::note_to_hertz(60) == fbase(261.6255653005986346778499935233)); CHECK(kfr::note_to_hertz(pack(60)) == pack(fbase(261.6255653005986346778499935233))); @@ -23,7 +23,7 @@ TEST(note_to_hertz) TEST(hertz_to_note) { - testo::eplison_scope<void> eps(1000); + testo::epsilon_scope<void> eps(1000); CHECK(kfr::hertz_to_note(261.6255653005986346778499935233) == fbase(60)); CHECK(kfr::hertz_to_note(pack(261.6255653005986346778499935233)) == pack(fbase(60))); @@ -33,7 +33,7 @@ TEST(hertz_to_note) TEST(amp_to_dB) { - testo::eplison_scope<void> eps(1000); + testo::epsilon_scope<void> eps(1000); CHECK(kfr::amp_to_dB(fbase(2.0)) == fbase(6.0205999132796239042747778944899)); CHECK(kfr::amp_to_dB(fbase(-2.0)) == fbase(6.0205999132796239042747778944899)); @@ -46,7 +46,7 @@ TEST(amp_to_dB) TEST(dB_to_amp) { - testo::eplison_scope<void> eps(1000); + testo::epsilon_scope<void> eps(1000); CHECK(kfr::dB_to_amp(fbase(-HUGE_VAL)) == fbase(0.0)); CHECK(kfr::dB_to_amp(fbase(0.0)) == fbase(1.0)); diff --git a/tests/unit/graphics/color.cpp b/tests/unit/graphics/color.cpp @@ -12,7 +12,7 @@ inline namespace CMT_ARCH_NAME { TEST(color) { - testo::eplison_scope<void> e(100); + testo::epsilon_scope<void> e(100); f32color c1 = f32color::from_argb(0xFF'FF00FF); CHECK(c1.r == 1); diff --git a/tests/unit/graphics/geometry.cpp b/tests/unit/graphics/geometry.cpp @@ -12,7 +12,7 @@ inline namespace CMT_ARCH_NAME { TEST(point) { - testo::eplison_scope<void> e(100); + testo::epsilon_scope<void> e(100); f32point p{ 0.f, 0.5f }; CHECK(p.distance(i32point{ 1, 2 }) == 1.80277563773f); @@ -47,7 +47,7 @@ TEST(border) TEST(rectangle) { - testo::eplison_scope<void> e(100); + testo::epsilon_scope<void> e(100); CHECK(f32rectangle{ f32point{ 1, 2 }, f32size{ 2, 2 } } == f32rectangle{ 1, 2, 3, 4 }); CHECK(f32rectangle{ f32point{ 1, 2 }, f32point{ 3, 4 } } == f32rectangle{ 1, 2, 3, 4 }); CHECK(f32rectangle{ f32point{ 1, 2 }, f32size{ 3, 4 }, f32point{ 0.5f, 0.5f } } ==