From 31ffabf6f32ae14b6e2f6ce33763bf4ef1bff809 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Thu, 1 Apr 2021 19:40:19 -0400 Subject: make weights work in by component mode domain weights now applied under inf norm range weights now applied when equal --- common/rawaccel-base.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'common/rawaccel-base.hpp') diff --git a/common/rawaccel-base.hpp b/common/rawaccel-base.hpp index ebc3f3e..a9da458 100644 --- a/common/rawaccel-base.hpp +++ b/common/rawaccel-base.hpp @@ -87,4 +87,10 @@ namespace rawaccel { wchar_t device_id[MAX_DEV_ID_LEN] = {}; }; + template + inline double apply_weighted(AccelFunc&& f, double x, double w) + { + return 1 + (f(x) - 1) * w; + } + } -- cgit v1.2.3