make weights work in by component mode

domain weights now applied under inf norm
range weights now applied when equal
This commit is contained in:
a1xd 2021-04-01 19:40:19 -04:00
parent e9866f27d7
commit 31ffabf6f3
3 changed files with 41 additions and 43 deletions

View file

@ -87,4 +87,10 @@ namespace rawaccel {
wchar_t device_id[MAX_DEV_ID_LEN] = {};
};
template <typename AccelFunc>
inline double apply_weighted(AccelFunc&& f, double x, double w)
{
return 1 + (f(x) - 1) * w;
}
}