From 6b91bacd594e3725b5ab32b89abb7b136cb2ea13 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 21 Dec 2021 16:04:16 -0500 Subject: [PATCH] Map3D needs some changes to allow autoscale RPM bin #3707 --- .../test_basic_math/test_interpolation_3d.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/unit_tests/test_basic_math/test_interpolation_3d.cpp b/unit_tests/test_basic_math/test_interpolation_3d.cpp index bb8494a621..c37927426a 100644 --- a/unit_tests/test_basic_math/test_interpolation_3d.cpp +++ b/unit_tests/test_basic_math/test_interpolation_3d.cpp @@ -19,6 +19,16 @@ scaled_channel mafBinsScaledInt[4] = { 1, 2, 3, 4 }; scaled_channel mafBinsScaledByte[4] = { 1, 2, 3, 4 }; +scaled_channel mapScaledByByte; +/* + = { + { 1, 2, 3, 4, 4}, + { 2, 3, 4, 200, 200 }, + { 3, 4, 200, 500, 500 }, + { 4, 5, 300, 600, 600 }, +}; +*/ + float map[4][5] = { { 1, 2, 3, 4, 4}, { 2, 3, 4, 200, 200 }, @@ -29,6 +39,11 @@ float map[4][5] = { #define EXPECT_NEAR_M4(a, b) EXPECT_NEAR(a, b, 1e-4) static float getValue(float rpm, float maf) { + Map3D<5, 4, uint8_t, float, float> x0; +// x0.init(mapScaledByByte, mafBins, rpmBins); +// float result0 = x0.getValue(rpm, maf); + + Map3D<5, 4, float, float, float> x1; x1.init(map, mafBins, rpmBins); float result1 = x1.getValue(rpm, maf);