Line | Branch | Decision | Exec | Source |
---|---|---|---|---|
1 | /** | |||
2 | * @file table_helper.h | |||
3 | * | |||
4 | * @date Jul 6, 2014 | |||
5 | * @author Andrey Belomutskiy, (c) 2012-2020 | |||
6 | */ | |||
7 | ||||
8 | #pragma once | |||
9 | ||||
10 | #include <cmath> | |||
11 | #include <array> | |||
12 | #include "efi_interpolation.h" | |||
13 | #include "efilib.h" | |||
14 | #include "efi_ratio.h" | |||
15 | #include "efi_scaled_channel.h" | |||
16 | #include <rusefi/interpolation.h> | |||
17 | ||||
18 | #if EFI_UNIT_TEST | |||
19 | #include <stdexcept> | |||
20 | #endif | |||
21 | ||||
22 | // popular left edge of CLT-based correction curves | |||
23 | #define CLT_CURVE_RANGE_FROM -40 | |||
24 | ||||
25 | class ValueProvider3D { | |||
26 | public: | |||
27 | virtual float getValue(float xColumn, float yRow) const = 0; | |||
28 | }; | |||
29 | ||||
30 | ||||
31 | /** | |||
32 | * this helper class brings together 3D table with two 2D axis curves | |||
33 | * TODO: explicitly spell out why do we have this template and when exactly is it useful (useful with scaled content?) | |||
34 | * todo: improve interpolate3d to handle scaling? | |||
35 | * A recommended use is if a class depends on a table and this can be shared with several classes but only one is instantiated, see for example airmass.h | |||
36 | * It can also be used if you need to test the behavior of a calculated X/Y => table value, but it is advisable to do those expects externally and/or only test the result of the get, | |||
37 | * since interpotalate3d is easier to use and does not require initiation. | |||
38 | * *** WARNING *** https://en.wikipedia.org/wiki/KISS_principle | |||
39 | * *** WARNING *** this helper requires initialization, make sure that helper is useful any time you consider using it | |||
40 | * *** WARNING *** we had too many bugs where we were not initializing, often just using the underlying interpolate3d is the way to go | |||
41 | */ | |||
42 | template<int TColNum, int TRowNum, typename TValue, typename TXColumn, typename TRow> | |||
43 | class Map3D : public ValueProvider3D { | |||
44 | public: | |||
45 | 169 | Map3D(const char *name) { | ||
46 | 169 | m_name = name; | ||
47 | 169 | } | ||
48 | template <typename TValueInit, typename TXColumnInit, typename TRowInit> | |||
49 | 7785 | void initTable(TValueInit (&table)[TRowNum][TColNum], | ||
50 | const TXColumnInit (&columnBins)[TColNum], const TRowInit (&rowBins)[TRowNum]) { | |||
51 | // This splits out here so that we don't need one overload of init per possible combination of table/rows/columns types/dimensions | |||
52 | // Overload resolution figures out the correct versions of the functions below to call, some of which have assertions about what's allowed | |||
53 | 7785 | initValues(table); | ||
54 | 7785 | initRows(rowBins); | ||
55 | 7785 | initCols(columnBins); | ||
56 | 7785 | } | ||
57 | ||||
58 | // RPM is usually X/Column | |||
59 | 3956 | float getValue(float xColumn, float yRow) const final { | ||
60 |
11/30Map3D<8, 8, float, short, short>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
Map3D<8, 8, unsigned char, short, short>::getValue(float, float) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
Map3D<10, 8, unsigned char, short, short>::getValue(float, float) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
Map3D<6, 6, unsigned short, unsigned short, unsigned short>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
Map3D<8, 8, signed char, unsigned short, unsigned short>::getValue(float, float) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
Map3D<8, 8, unsigned char, unsigned char, unsigned char>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 204 times.
Map3D<6, 6, signed char, unsigned char, unsigned char>::getValue(float, float) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
Map3D<6, 6, signed char, unsigned short, unsigned char>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 2449 times.
Map3D<8, 8, unsigned char, unsigned char, unsigned short>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 64 times.
Map3D<5, 4, unsigned int, float, float>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 30 times.
Map3D<5, 4, float, unsigned char, float>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 30 times.
Map3D<5, 4, float, float, unsigned char>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 30 times.
Map3D<5, 4, float, float, int>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 30 times.
Map3D<5, 4, float, float, float>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 30 times.
Map3D<16, 16, unsigned short, unsigned short, unsigned short>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 1086 times.
|
4/12Map3D<8, 8, unsigned char, short, short>::getValue(float, float) const:
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
Map3D<6, 6, unsigned short, unsigned short, unsigned short>::getValue(float, float) const:
✗ Decision 'true' not taken.
✓ Decision 'false' taken 1 time.
Map3D<8, 8, signed char, unsigned short, unsigned short>::getValue(float, float) const:
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
Map3D<6, 6, signed char, unsigned short, unsigned char>::getValue(float, float) const:
✗ Decision 'true' not taken.
✓ Decision 'false' taken 2449 times.
Map3D<8, 8, unsigned char, unsigned char, unsigned short>::getValue(float, float) const:
✗ Decision 'true' not taken.
✓ Decision 'false' taken 64 times.
Map3D<16, 16, unsigned short, unsigned short, unsigned short>::getValue(float, float) const:
✗ Decision 'true' not taken.
✓ Decision 'false' taken 1086 times.
|
3956 | if (!m_values) { |
61 | ✗ | criticalError("Access to uninitialized table: %s", m_name); | ||
62 | ✗ | return 0; | ||
63 | } | |||
64 | ||||
65 | 7911 | return interpolate3d(*m_values, | ||
66 | 3956 | *m_rowBins, yRow * m_rowMult, | ||
67 | 3956 | *m_columnBins, xColumn * m_colMult) * | ||
68 | 3956 | m_valueMult; | ||
69 | } | |||
70 | ||||
71 | void setAll(TValue value) { | |||
72 | efiAssertVoid(ObdCode::CUSTOM_ERR_6573, m_values, "map not initialized"); | |||
73 | ||||
74 | for (size_t r = 0; r < TRowNum; r++) { | |||
75 | for (size_t c = 0; c < TColNum; c++) { | |||
76 | (*m_values)[r][c] = value / m_valueMult; | |||
77 | } | |||
78 | } | |||
79 | } | |||
80 | ||||
81 | private: | |||
82 | template <int TMult, int TDiv> | |||
83 | 2985 | void initValues(scaled_channel<TValue, TMult, TDiv> (&table)[TRowNum][TColNum]) { | ||
84 | 2985 | m_values = reinterpret_cast<TValue (*)[TRowNum][TColNum]>(&table); | ||
85 | 2985 | m_valueMult = 1 / efi::ratio<TMult, TDiv>::asFloat(); | ||
86 | 2985 | } | ||
87 | ||||
88 | 4800 | void initValues(TValue (&table)[TRowNum][TColNum]) { | ||
89 | 4800 | m_values = &table; | ||
90 | 4800 | m_valueMult = 1; | ||
91 | 4800 | } | ||
92 | ||||
93 | template <int TRowMult, int TRowDiv> | |||
94 | 645 | void initRows(const scaled_channel<TRow, TRowMult, TRowDiv> (&rowBins)[TRowNum]) { | ||
95 | 645 | m_rowBins = reinterpret_cast<const TRow (*)[TRowNum]>(&rowBins); | ||
96 | 645 | m_rowMult = efi::ratio<TRowMult, TRowDiv>::asFloat(); | ||
97 | 645 | } | ||
98 | ||||
99 | 7140 | void initRows(const TRow (&rowBins)[TRowNum]) { | ||
100 | 7140 | m_rowBins = &rowBins; | ||
101 | 7140 | m_rowMult = 1; | ||
102 | 7140 | } | ||
103 | ||||
104 | template <int TColMult, int TColDiv> | |||
105 | 4159 | void initCols(const scaled_channel<TXColumn, TColMult, TColDiv> (&columnBins)[TColNum]) { | ||
106 | 4159 | m_columnBins = reinterpret_cast<const TXColumn (*)[TColNum]>(&columnBins); | ||
107 | 4159 | m_colMult = efi::ratio<TColMult, TColDiv>::asFloat(); | ||
108 | 4159 | } | ||
109 | ||||
110 | 3626 | void initCols(const TXColumn (&columnBins)[TColNum]) { | ||
111 | 3626 | m_columnBins = &columnBins; | ||
112 | 3626 | m_colMult = 1; | ||
113 | 3626 | } | ||
114 | ||||
115 | static size_t getIndexForCoordinates(size_t row, size_t column) { | |||
116 | // Index 0 is bottom left corner | |||
117 | // Index TColNum - 1 is bottom right corner | |||
118 | // indicies count right, then up | |||
119 | return row * TColNum + column; | |||
120 | } | |||
121 | ||||
122 | TValue getValueAtPosition(size_t row, size_t column) const { | |||
123 | auto idx = getIndexForCoordinates(row, column); | |||
124 | return m_values[idx]; | |||
125 | } | |||
126 | ||||
127 | // TODO: should be const | |||
128 | /*const*/ TValue (*m_values)[TRowNum][TColNum] = nullptr; | |||
129 | ||||
130 | const TRow (*m_rowBins)[TRowNum] = nullptr; | |||
131 | const TXColumn (*m_columnBins)[TColNum] = nullptr; | |||
132 | ||||
133 | float m_rowMult = 1; | |||
134 | float m_colMult = 1; | |||
135 | float m_valueMult = 1; | |||
136 | const char *m_name; | |||
137 | }; | |||
138 | ||||
139 | typedef Map3D<VE_RPM_COUNT, VE_LOAD_COUNT, uint16_t, uint16_t, uint16_t> ve_Map3D_t; | |||
140 | typedef Map3D<PEDAL_TO_TPS_RPM_SIZE, PEDAL_TO_TPS_SIZE, uint8_t, uint8_t, uint8_t> pedal2tps_t; | |||
141 | typedef Map3D<MAP_EST_RPM_COUNT, MAP_EST_LOAD_COUNT, uint16_t, uint16_t, uint16_t> mapEstimate_Map3D_t; | |||
142 | ||||
143 | /** | |||
144 | * @param precision for example '0.1' for one digit fractional part. Default to 0.01, two digits. | |||
145 | * see also: ensureArrayIsAscending | |||
146 | */ | |||
147 | template<typename TValue, int TSize> | |||
148 | 60394 | void setLinearCurve(TValue (&array)[TSize], float from, float to, float precision = 0.01f) { | ||
149 |
76/76void setLinearCurve<scaled_channel<unsigned char, 2, 1>, 8>(scaled_channel<unsigned char, 2, 1> (&) [8], float, float, float):
✓ Branch 0 taken 46880 times.
✓ Branch 1 taken 5860 times.
void setLinearCurve<scaled_channel<short, 10, 1>, 8>(scaled_channel<short, 10, 1> (&) [8], float, float, float):
✓ Branch 0 taken 46880 times.
✓ Branch 1 taken 5860 times.
void setLinearCurve<unsigned short, 8>(unsigned short (&) [8], float, float, float):
✓ Branch 0 taken 103136 times.
✓ Branch 1 taken 12892 times.
void setLinearCurve<unsigned short, 16>(unsigned short (&) [16], float, float, float):
✓ Branch 0 taken 28368 times.
✓ Branch 1 taken 1773 times.
void setLinearCurve<scaled_channel<unsigned char, 50, 1>, 8>(scaled_channel<unsigned char, 50, 1> (&) [8], float, float, float):
✓ Branch 0 taken 4688 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned char, 10, 1>, 8>(scaled_channel<unsigned char, 10, 1> (&) [8], float, float, float):
✓ Branch 0 taken 4688 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 4>(scaled_channel<unsigned char, 1, 5> (&) [4], float, float, float):
✓ Branch 0 taken 2344 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<short, 1, 1>, 5>(scaled_channel<short, 1, 1> (&) [5], float, float, float):
✓ Branch 0 taken 2930 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 5>(scaled_channel<unsigned char, 1, 5> (&) [5], float, float, float):
✓ Branch 0 taken 2930 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 8>(scaled_channel<unsigned char, 1, 5> (&) [8], float, float, float):
✓ Branch 0 taken 4688 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<float, 16>(float (&) [16], float, float, float):
✓ Branch 0 taken 37504 times.
✓ Branch 1 taken 2344 times.
void setLinearCurve<scaled_channel<unsigned short, 1000, 1>, 10>(scaled_channel<unsigned short, 1000, 1> (&) [10], float, float, float):
✓ Branch 0 taken 5860 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<unsigned char, 8>(unsigned char (&) [8], float, float, float):
✓ Branch 0 taken 14064 times.
✓ Branch 1 taken 1758 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 12>(scaled_channel<unsigned short, 10, 1> (&) [12], float, float, float):
✓ Branch 0 taken 7032 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 100>, 16>(scaled_channel<unsigned char, 1, 100> (&) [16], float, float, float):
✓ Branch 0 taken 9376 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned short, 1000, 1>, 8>(scaled_channel<unsigned short, 1000, 1> (&) [8], float, float, float):
✓ Branch 0 taken 4688 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<unsigned short, 4>(unsigned short (&) [4], float, float, float):
✓ Branch 0 taken 4688 times.
✓ Branch 1 taken 1172 times.
void setLinearCurve<float, 8>(float (&) [8], float, float, float):
✓ Branch 0 taken 70368 times.
✓ Branch 1 taken 8796 times.
void setLinearCurve<short, 8>(short (&) [8], float, float, float):
✓ Branch 0 taken 23440 times.
✓ Branch 1 taken 2930 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 20>, 16>(scaled_channel<unsigned char, 1, 20> (&) [16], float, float, float):
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 2 times.
void setLinearCurve<scaled_channel<short, 1, 1>, 16>(scaled_channel<short, 1, 1> (&) [16], float, float, float):
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 2 times.
void setLinearCurve<unsigned short, 6>(unsigned short (&) [6], float, float, float):
✓ Branch 0 taken 10584 times.
✓ Branch 1 taken 1764 times.
void setLinearCurve<unsigned char, 6>(unsigned char (&) [6], float, float, float):
✓ Branch 0 taken 3522 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 6>(scaled_channel<unsigned short, 100, 1> (&) [6], float, float, float):
✓ Branch 0 taken 7038 times.
✓ Branch 1 taken 1173 times.
void setLinearCurve<scaled_channel<short, 100, 1>, 8>(scaled_channel<short, 100, 1> (&) [8], float, float, float):
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1 time.
void setLinearCurve<signed char, 8>(signed char (&) [8], float, float, float):
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1 time.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 2>(scaled_channel<unsigned short, 10, 1> (&) [2], float, float, float):
✓ Branch 0 taken 1172 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 2>(scaled_channel<unsigned short, 100, 1> (&) [2], float, float, float):
✓ Branch 0 taken 1172 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 8>(scaled_channel<unsigned short, 10, 1> (&) [8], float, float, float):
✓ Branch 0 taken 4688 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 8>(scaled_channel<unsigned short, 100, 1> (&) [8], float, float, float):
✓ Branch 0 taken 4688 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 10>(scaled_channel<unsigned short, 10, 1> (&) [10], float, float, float):
✓ Branch 0 taken 5860 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<short, 6>(short (&) [6], float, float, float):
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 time.
void setLinearCurve<short, 4>(short (&) [4], float, float, float):
✓ Branch 0 taken 2344 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<float, 6>(float (&) [6], float, float, float):
✓ Branch 0 taken 3516 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned char, 50, 1>, 4>(scaled_channel<unsigned char, 50, 1> (&) [4], float, float, float):
✓ Branch 0 taken 4688 times.
✓ Branch 1 taken 1172 times.
void setLinearCurve<float, 2>(float (&) [2], float, float, float):
✓ Branch 0 taken 1172 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<float, 4>(float (&) [4], float, float, float):
✓ Branch 0 taken 2344 times.
✓ Branch 1 taken 586 times.
void setLinearCurve<scaled_channel<unsigned char, 100, 1>, 6>(scaled_channel<unsigned char, 100, 1> (&) [6], float, float, float):
✓ Branch 0 taken 7032 times.
✓ Branch 1 taken 1172 times.
|
6/12void setLinearCurve<unsigned short, 8>(unsigned short (&) [8], float, float, float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setLinearCurve<unsigned short, 16>(unsigned short (&) [16], float, float, float):
✓ Decision 'true' taken 28368 times.
✓ Decision 'false' taken 1773 times.
void setLinearCurve<unsigned char, 8>(unsigned char (&) [8], float, float, float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setLinearCurve<float, 8>(float (&) [8], float, float, float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setLinearCurve<scaled_channel<unsigned char, 1, 20>, 16>(scaled_channel<unsigned char, 1, 20> (&) [16], float, float, float):
✓ Decision 'true' taken 32 times.
✓ Decision 'false' taken 2 times.
void setLinearCurve<scaled_channel<unsigned char, 100, 1>, 6>(scaled_channel<unsigned char, 100, 1> (&) [6], float, float, float):
✓ Decision 'true' taken 7032 times.
✓ Decision 'false' taken 1172 times.
|
544852 | for (int i = 0; i < TSize; i++) { |
150 | 484458 | float value = interpolateMsg("setLinearCurve", 0, from, TSize - 1, to, i); | ||
151 | ||||
152 | /** | |||
153 | * rounded values look nicer, also we want to avoid precision mismatch with Tuner Studio | |||
154 | */ | |||
155 |
23/23void setLinearCurve<scaled_channel<unsigned char, 2, 1>, 8>(scaled_channel<unsigned char, 2, 1> (&) [8], float, float, float):
✓ Branch 2 taken 46880 times.
void setLinearCurve<scaled_channel<short, 10, 1>, 8>(scaled_channel<short, 10, 1> (&) [8], float, float, float):
✓ Branch 2 taken 46880 times.
void setLinearCurve<scaled_channel<unsigned char, 50, 1>, 8>(scaled_channel<unsigned char, 50, 1> (&) [8], float, float, float):
✓ Branch 2 taken 4688 times.
void setLinearCurve<scaled_channel<unsigned char, 10, 1>, 8>(scaled_channel<unsigned char, 10, 1> (&) [8], float, float, float):
✓ Branch 2 taken 4688 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 4>(scaled_channel<unsigned char, 1, 5> (&) [4], float, float, float):
✓ Branch 2 taken 2344 times.
void setLinearCurve<scaled_channel<short, 1, 1>, 5>(scaled_channel<short, 1, 1> (&) [5], float, float, float):
✓ Branch 2 taken 2930 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 5>(scaled_channel<unsigned char, 1, 5> (&) [5], float, float, float):
✓ Branch 2 taken 2930 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 8>(scaled_channel<unsigned char, 1, 5> (&) [8], float, float, float):
✓ Branch 2 taken 4688 times.
void setLinearCurve<scaled_channel<unsigned short, 1000, 1>, 10>(scaled_channel<unsigned short, 1000, 1> (&) [10], float, float, float):
✓ Branch 2 taken 5860 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 12>(scaled_channel<unsigned short, 10, 1> (&) [12], float, float, float):
✓ Branch 2 taken 7032 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 100>, 16>(scaled_channel<unsigned char, 1, 100> (&) [16], float, float, float):
✓ Branch 2 taken 9376 times.
void setLinearCurve<scaled_channel<unsigned short, 1000, 1>, 8>(scaled_channel<unsigned short, 1000, 1> (&) [8], float, float, float):
✓ Branch 2 taken 4688 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 20>, 16>(scaled_channel<unsigned char, 1, 20> (&) [16], float, float, float):
✓ Branch 2 taken 32 times.
void setLinearCurve<scaled_channel<short, 1, 1>, 16>(scaled_channel<short, 1, 1> (&) [16], float, float, float):
✓ Branch 2 taken 32 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 6>(scaled_channel<unsigned short, 100, 1> (&) [6], float, float, float):
✓ Branch 2 taken 7038 times.
void setLinearCurve<scaled_channel<short, 100, 1>, 8>(scaled_channel<short, 100, 1> (&) [8], float, float, float):
✓ Branch 2 taken 8 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 2>(scaled_channel<unsigned short, 10, 1> (&) [2], float, float, float):
✓ Branch 2 taken 1172 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 2>(scaled_channel<unsigned short, 100, 1> (&) [2], float, float, float):
✓ Branch 2 taken 1172 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 8>(scaled_channel<unsigned short, 10, 1> (&) [8], float, float, float):
✓ Branch 2 taken 4688 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 8>(scaled_channel<unsigned short, 100, 1> (&) [8], float, float, float):
✓ Branch 2 taken 4688 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 10>(scaled_channel<unsigned short, 10, 1> (&) [10], float, float, float):
✓ Branch 2 taken 5860 times.
void setLinearCurve<scaled_channel<unsigned char, 50, 1>, 4>(scaled_channel<unsigned char, 50, 1> (&) [4], float, float, float):
✓ Branch 2 taken 4688 times.
void setLinearCurve<scaled_channel<unsigned char, 100, 1>, 6>(scaled_channel<unsigned char, 100, 1> (&) [6], float, float, float):
✓ Branch 2 taken 7032 times.
|
484458 | array[i] = efiRound(value, precision); | |
156 | } | |||
157 | 60394 | } | ||
158 | ||||
159 | template<typename TValue, int TSize> | |||
160 | 36679 | void setArrayValues(TValue (&array)[TSize], float value) { | ||
161 |
36/36void setArrayValues<scaled_channel<short, 100, 1>, 4>(scaled_channel<short, 100, 1> (&) [4], float):
✓ Branch 0 taken 2344 times.
✓ Branch 1 taken 586 times.
void setArrayValues<unsigned short, 6>(unsigned short (&) [6], float):
✓ Branch 0 taken 3570 times.
✓ Branch 1 taken 595 times.
void setArrayValues<float, 8>(float (&) [8], float):
✓ Branch 0 taken 4816 times.
✓ Branch 1 taken 602 times.
void setArrayValues<float, 16>(float (&) [16], float):
✓ Branch 0 taken 384 times.
✓ Branch 1 taken 24 times.
void setArrayValues<scaled_channel<unsigned short, 10, 1>, 8>(scaled_channel<unsigned short, 10, 1> (&) [8], float):
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 4 times.
void setArrayValues<float, 560>(float (&) [560], float):
✓ Branch 0 taken 834400 times.
✓ Branch 1 taken 1490 times.
void setArrayValues<unsigned long, 2>(unsigned long (&) [2], float):
✓ Branch 0 taken 42808 times.
✓ Branch 1 taken 21404 times.
void setArrayValues<unsigned int, 19>(unsigned int (&) [19], float):
✓ Branch 0 taken 113867 times.
✓ Branch 1 taken 5993 times.
void setArrayValues<unsigned int, 120>(unsigned int (&) [120], float):
✓ Branch 0 taken 28080 times.
✓ Branch 1 taken 234 times.
void setArrayValues<unsigned int, 280>(unsigned int (&) [280], float):
✓ Branch 0 taken 65520 times.
✓ Branch 1 taken 234 times.
void setArrayValues<unsigned char, 8>(unsigned char (&) [8], float):
✓ Branch 0 taken 608 times.
✓ Branch 1 taken 76 times.
void setArrayValues<float, 5>(float (&) [5], float):
✓ Branch 0 taken 40 times.
✓ Branch 1 taken 8 times.
void setArrayValues<float, 12>(float (&) [12], float):
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 1 time.
void setArrayValues<scaled_channel<unsigned char, 1, 10>, 8>(scaled_channel<unsigned char, 1, 10> (&) [8], float):
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1 time.
void setArrayValues<unsigned short, 4>(unsigned short (&) [4], float):
✓ Branch 0 taken 2708 times.
✓ Branch 1 taken 677 times.
void setArrayValues<bool, 280>(bool (&) [280], float):
✓ Branch 0 taken 852040 times.
✓ Branch 1 taken 3043 times.
void setArrayValues<scaled_channel<signed char, 2, 1>, 16>(scaled_channel<signed char, 2, 1> (&) [16], float):
✓ Branch 0 taken 9376 times.
✓ Branch 1 taken 586 times.
void setArrayValues<scaled_channel<unsigned short, 100, 1>, 8>(scaled_channel<unsigned short, 100, 1> (&) [8], float):
✓ Branch 0 taken 8968 times.
✓ Branch 1 taken 1121 times.
|
12/14void setArrayValues<unsigned short, 6>(unsigned short (&) [6], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setArrayValues<float, 8>(float (&) [8], float):
✓ Decision 'true' taken 4816 times.
✓ Decision 'false' taken 602 times.
void setArrayValues<float, 16>(float (&) [16], float):
✓ Decision 'true' taken 384 times.
✓ Decision 'false' taken 24 times.
void setArrayValues<unsigned char, 8>(unsigned char (&) [8], float):
✓ Decision 'true' taken 608 times.
✓ Decision 'false' taken 76 times.
void setArrayValues<float, 5>(float (&) [5], float):
✓ Decision 'true' taken 40 times.
✓ Decision 'false' taken 8 times.
void setArrayValues<float, 12>(float (&) [12], float):
✓ Decision 'true' taken 12 times.
✓ Decision 'false' taken 1 time.
void setArrayValues<scaled_channel<unsigned char, 1, 10>, 8>(scaled_channel<unsigned char, 1, 10> (&) [8], float):
✓ Decision 'true' taken 8 times.
✓ Decision 'false' taken 1 time.
|
2006260 | for (int i = 0; i < TSize; i++) { |
162 | 1969581 | array[i] = value; | ||
163 | } | |||
164 | 36679 | } | ||
165 | ||||
166 | template <typename TElement, typename VElement, size_t N, size_t M> | |||
167 | 5979 | constexpr void setTable(TElement (&dest)[N][M], const VElement value) { | ||
168 |
68/72void setTable<short, float, 6ul, 6ul>(short (&) [6ul][6ul], float):
✓ Branch 0 taken 3600 times.
✓ Branch 1 taken 600 times.
void setTable<scaled_channel<short, 100, 1>, double, 2ul, 8ul>(scaled_channel<short, 100, 1> (&) [2ul][8ul], double):
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 time.
void setTable<scaled_channel<unsigned short, 100, 1>, double, 8ul, 8ul>(scaled_channel<unsigned short, 100, 1> (&) [8ul][8ul], double):
✓ Branch 0 taken 4688 times.
✓ Branch 1 taken 586 times.
void setTable<unsigned short, int, 10ul, 10ul>(unsigned short (&) [10ul][10ul], int):
✓ Branch 0 taken 5860 times.
✓ Branch 1 taken 586 times.
void setTable<scaled_channel<short, 10, 1>, int, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], int):
✓ Branch 0 taken 2348 times.
✓ Branch 1 taken 587 times.
void setTable<float, float, 6ul, 6ul>(float (&) [6ul][6ul], float):
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 time.
void setTable<float, int, 4ul, 8ul>(float (&) [4ul][8ul], int):
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 6 times.
void setTable<scaled_channel<short, 10, 1>, float, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], float):
✓ Branch 0 taken 36 times.
✓ Branch 1 taken 9 times.
void setTable<float, double, 4ul, 8ul>(float (&) [4ul][8ul], double):
✓ Branch 0 taken 64 times.
✓ Branch 1 taken 16 times.
void setTable<scaled_channel<unsigned char, 1, 2>, float, 8ul, 8ul>(scaled_channel<unsigned char, 1, 2> (&) [8ul][8ul], float):
✓ Branch 0 taken 64 times.
✓ Branch 1 taken 8 times.
void setTable<float, int, 6ul, 6ul>(float (&) [6ul][6ul], int):
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 time.
void setTable<scaled_channel<unsigned short, 10, 1>, int, 4ul, 4ul>(scaled_channel<unsigned short, 10, 1> (&) [4ul][4ul], int):
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 1 time.
void setTable<scaled_channel<signed char, 5, 1>, int, 4ul, 4ul>(scaled_channel<signed char, 5, 1> (&) [4ul][4ul], int):
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 8 times.
void setTable<float, float, 4ul, 8ul>(float (&) [4ul][8ul], float):
✓ Branch 0 taken 2372 times.
✓ Branch 1 taken 593 times.
void setTable<scaled_channel<short, 10, 1>, int, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], int):
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 1 time.
void setTable<scaled_channel<unsigned char, 2, 1>, float, 8ul, 8ul>(scaled_channel<unsigned char, 2, 1> (&) [8ul][8ul], float):
✓ Branch 0 taken 64 times.
✓ Branch 1 taken 8 times.
void setTable<scaled_channel<short, 100, 1>, float, 2ul, 8ul>(scaled_channel<short, 100, 1> (&) [2ul][8ul], float):
✓ Branch 0 taken 56 times.
✓ Branch 1 taken 28 times.
void setTable<float, float, 16ul, 16ul>(float (&) [16ul][16ul], float):
✓ Branch 0 taken 18848 times.
✓ Branch 1 taken 1178 times.
void setTable<scaled_channel<short, 10, 1>, double, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], double):
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 2 times.
void setTable<float, double, 2ul, 8ul>(float (&) [2ul][8ul], double):
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 2 times.
void setTable<float, unsigned char, 8ul, 8ul>(float (&) [8ul][8ul], unsigned char):
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 2 times.
void setTable<scaled_channel<short, 10, 1>, int, 8ul, 8ul>(scaled_channel<short, 10, 1> (&) [8ul][8ul], int):
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 3 times.
void setTable<scaled_channel<unsigned short, 100, 1>, int, 6ul, 6ul>(scaled_channel<unsigned short, 100, 1> (&) [6ul][6ul], int):
✓ Branch 0 taken 3516 times.
✓ Branch 1 taken 586 times.
void setTable<float, int, 4ul, 4ul>(float (&) [4ul][4ul], int):
✓ Branch 0 taken 2344 times.
✓ Branch 1 taken 586 times.
void setTable<scaled_channel<unsigned short, 10, 1>, int, 16ul, 16ul>(scaled_channel<unsigned short, 10, 1> (&) [16ul][16ul], int):
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 3 times.
void setTable<scaled_channel<unsigned char, 2, 1>, int, 8ul, 8ul>(scaled_channel<unsigned char, 2, 1> (&) [8ul][8ul], int):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
void setTable<float, signed char, 2ul, 6ul>(float (&) [2ul][6ul], signed char):
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 2 times.
void setTable<signed char, signed char, 2ul, 6ul>(signed char (&) [2ul][6ul], signed char):
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 2 times.
void setTable<float, float, 2ul, 6ul>(float (&) [2ul][6ul], float):
✓ Branch 0 taken 26 times.
✓ Branch 1 taken 13 times.
void setTable<signed char, int, 6ul, 6ul>(signed char (&) [6ul][6ul], int):
✓ Branch 0 taken 18 times.
✓ Branch 1 taken 3 times.
void setTable<scaled_channel<unsigned short, 100, 1>, int, 8ul, 8ul>(scaled_channel<unsigned short, 100, 1> (&) [8ul][8ul], int):
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1 time.
void setTable<scaled_channel<short, 10, 1>, float, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], float):
✓ Branch 0 taken 320 times.
✓ Branch 1 taken 20 times.
void setTable<scaled_channel<unsigned char, 2, 1>, unsigned char, 8ul, 8ul>(scaled_channel<unsigned char, 2, 1> (&) [8ul][8ul], unsigned char):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
void setTable<scaled_channel<short, 10, 1>, float, 8ul, 8ul>(scaled_channel<short, 10, 1> (&) [8ul][8ul], float):
✓ Branch 0 taken 4240 times.
✓ Branch 1 taken 530 times.
void setTable<scaled_channel<unsigned char, 147, 1>, float, 16ul, 16ul>(scaled_channel<unsigned char, 147, 1> (&) [16ul][16ul], float):
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 2 times.
void setTable<float, float, 2ul, 8ul>(float (&) [2ul][8ul], float):
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 4 times.
|
20/38void setTable<short, float, 6ul, 6ul>(short (&) [6ul][6ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<scaled_channel<short, 10, 1>, int, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], int):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<float, int, 4ul, 8ul>(float (&) [4ul][8ul], int):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<scaled_channel<short, 10, 1>, float, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<float, double, 4ul, 8ul>(float (&) [4ul][8ul], double):
✓ Decision 'true' taken 64 times.
✓ Decision 'false' taken 16 times.
void setTable<scaled_channel<unsigned char, 1, 2>, float, 8ul, 8ul>(scaled_channel<unsigned char, 1, 2> (&) [8ul][8ul], float):
✓ Decision 'true' taken 64 times.
✓ Decision 'false' taken 8 times.
void setTable<float, float, 4ul, 8ul>(float (&) [4ul][8ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<scaled_channel<unsigned char, 2, 1>, float, 8ul, 8ul>(scaled_channel<unsigned char, 2, 1> (&) [8ul][8ul], float):
✓ Decision 'true' taken 64 times.
✓ Decision 'false' taken 8 times.
void setTable<scaled_channel<short, 100, 1>, float, 2ul, 8ul>(scaled_channel<short, 100, 1> (&) [2ul][8ul], float):
✓ Decision 'true' taken 56 times.
✓ Decision 'false' taken 28 times.
void setTable<float, float, 16ul, 16ul>(float (&) [16ul][16ul], float):
✓ Decision 'true' taken 18848 times.
✓ Decision 'false' taken 1178 times.
void setTable<scaled_channel<short, 10, 1>, double, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], double):
✓ Decision 'true' taken 8 times.
✓ Decision 'false' taken 2 times.
void setTable<float, unsigned char, 8ul, 8ul>(float (&) [8ul][8ul], unsigned char):
✓ Decision 'true' taken 16 times.
✓ Decision 'false' taken 2 times.
void setTable<scaled_channel<short, 10, 1>, int, 8ul, 8ul>(scaled_channel<short, 10, 1> (&) [8ul][8ul], int):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<scaled_channel<unsigned char, 2, 1>, int, 8ul, 8ul>(scaled_channel<unsigned char, 2, 1> (&) [8ul][8ul], int):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<float, float, 2ul, 6ul>(float (&) [2ul][6ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<signed char, int, 6ul, 6ul>(signed char (&) [6ul][6ul], int):
✓ Decision 'true' taken 18 times.
✓ Decision 'false' taken 3 times.
void setTable<scaled_channel<unsigned short, 100, 1>, int, 8ul, 8ul>(scaled_channel<unsigned short, 100, 1> (&) [8ul][8ul], int):
✓ Decision 'true' taken 8 times.
✓ Decision 'false' taken 1 time.
void setTable<scaled_channel<short, 10, 1>, float, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<float, float, 2ul, 8ul>(float (&) [2ul][8ul], float):
✓ Decision 'true' taken 8 times.
✓ Decision 'false' taken 4 times.
|
54689 | for (size_t n = 0; n < N; n++) { |
169 |
68/72void setTable<short, float, 6ul, 6ul>(short (&) [6ul][6ul], float):
✓ Branch 0 taken 21600 times.
✓ Branch 1 taken 3600 times.
void setTable<scaled_channel<short, 100, 1>, double, 2ul, 8ul>(scaled_channel<short, 100, 1> (&) [2ul][8ul], double):
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 2 times.
void setTable<scaled_channel<unsigned short, 100, 1>, double, 8ul, 8ul>(scaled_channel<unsigned short, 100, 1> (&) [8ul][8ul], double):
✓ Branch 0 taken 37504 times.
✓ Branch 1 taken 4688 times.
void setTable<unsigned short, int, 10ul, 10ul>(unsigned short (&) [10ul][10ul], int):
✓ Branch 0 taken 58600 times.
✓ Branch 1 taken 5860 times.
void setTable<scaled_channel<short, 10, 1>, int, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], int):
✓ Branch 0 taken 9392 times.
✓ Branch 1 taken 2348 times.
void setTable<float, float, 6ul, 6ul>(float (&) [6ul][6ul], float):
✓ Branch 0 taken 36 times.
✓ Branch 1 taken 6 times.
void setTable<float, int, 4ul, 8ul>(float (&) [4ul][8ul], int):
✓ Branch 0 taken 192 times.
✓ Branch 1 taken 24 times.
void setTable<scaled_channel<short, 10, 1>, float, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], float):
✓ Branch 0 taken 144 times.
✓ Branch 1 taken 36 times.
void setTable<float, double, 4ul, 8ul>(float (&) [4ul][8ul], double):
✓ Branch 0 taken 512 times.
✓ Branch 1 taken 64 times.
void setTable<scaled_channel<unsigned char, 1, 2>, float, 8ul, 8ul>(scaled_channel<unsigned char, 1, 2> (&) [8ul][8ul], float):
✓ Branch 0 taken 512 times.
✓ Branch 1 taken 64 times.
void setTable<float, int, 6ul, 6ul>(float (&) [6ul][6ul], int):
✓ Branch 0 taken 36 times.
✓ Branch 1 taken 6 times.
void setTable<scaled_channel<unsigned short, 10, 1>, int, 4ul, 4ul>(scaled_channel<unsigned short, 10, 1> (&) [4ul][4ul], int):
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 4 times.
void setTable<scaled_channel<signed char, 5, 1>, int, 4ul, 4ul>(scaled_channel<signed char, 5, 1> (&) [4ul][4ul], int):
✓ Branch 0 taken 128 times.
✓ Branch 1 taken 32 times.
void setTable<float, float, 4ul, 8ul>(float (&) [4ul][8ul], float):
✓ Branch 0 taken 18976 times.
✓ Branch 1 taken 2372 times.
void setTable<scaled_channel<short, 10, 1>, int, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], int):
✓ Branch 0 taken 256 times.
✓ Branch 1 taken 16 times.
void setTable<scaled_channel<unsigned char, 2, 1>, float, 8ul, 8ul>(scaled_channel<unsigned char, 2, 1> (&) [8ul][8ul], float):
✓ Branch 0 taken 512 times.
✓ Branch 1 taken 64 times.
void setTable<scaled_channel<short, 100, 1>, float, 2ul, 8ul>(scaled_channel<short, 100, 1> (&) [2ul][8ul], float):
✓ Branch 0 taken 448 times.
✓ Branch 1 taken 56 times.
void setTable<float, float, 16ul, 16ul>(float (&) [16ul][16ul], float):
✓ Branch 0 taken 301568 times.
✓ Branch 1 taken 18848 times.
void setTable<scaled_channel<short, 10, 1>, double, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], double):
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 8 times.
void setTable<float, double, 2ul, 8ul>(float (&) [2ul][8ul], double):
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 4 times.
void setTable<float, unsigned char, 8ul, 8ul>(float (&) [8ul][8ul], unsigned char):
✓ Branch 0 taken 128 times.
✓ Branch 1 taken 16 times.
void setTable<scaled_channel<short, 10, 1>, int, 8ul, 8ul>(scaled_channel<short, 10, 1> (&) [8ul][8ul], int):
✓ Branch 0 taken 192 times.
✓ Branch 1 taken 24 times.
void setTable<scaled_channel<unsigned short, 100, 1>, int, 6ul, 6ul>(scaled_channel<unsigned short, 100, 1> (&) [6ul][6ul], int):
✓ Branch 0 taken 21096 times.
✓ Branch 1 taken 3516 times.
void setTable<float, int, 4ul, 4ul>(float (&) [4ul][4ul], int):
✓ Branch 0 taken 9376 times.
✓ Branch 1 taken 2344 times.
void setTable<scaled_channel<unsigned short, 10, 1>, int, 16ul, 16ul>(scaled_channel<unsigned short, 10, 1> (&) [16ul][16ul], int):
✓ Branch 0 taken 768 times.
✓ Branch 1 taken 48 times.
void setTable<scaled_channel<unsigned char, 2, 1>, int, 8ul, 8ul>(scaled_channel<unsigned char, 2, 1> (&) [8ul][8ul], int):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
void setTable<float, signed char, 2ul, 6ul>(float (&) [2ul][6ul], signed char):
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 4 times.
void setTable<signed char, signed char, 2ul, 6ul>(signed char (&) [2ul][6ul], signed char):
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 4 times.
void setTable<float, float, 2ul, 6ul>(float (&) [2ul][6ul], float):
✓ Branch 0 taken 156 times.
✓ Branch 1 taken 26 times.
void setTable<signed char, int, 6ul, 6ul>(signed char (&) [6ul][6ul], int):
✓ Branch 0 taken 108 times.
✓ Branch 1 taken 18 times.
void setTable<scaled_channel<unsigned short, 100, 1>, int, 8ul, 8ul>(scaled_channel<unsigned short, 100, 1> (&) [8ul][8ul], int):
✓ Branch 0 taken 64 times.
✓ Branch 1 taken 8 times.
void setTable<scaled_channel<short, 10, 1>, float, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], float):
✓ Branch 0 taken 5120 times.
✓ Branch 1 taken 320 times.
void setTable<scaled_channel<unsigned char, 2, 1>, unsigned char, 8ul, 8ul>(scaled_channel<unsigned char, 2, 1> (&) [8ul][8ul], unsigned char):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
void setTable<scaled_channel<short, 10, 1>, float, 8ul, 8ul>(scaled_channel<short, 10, 1> (&) [8ul][8ul], float):
✓ Branch 0 taken 33920 times.
✓ Branch 1 taken 4240 times.
void setTable<scaled_channel<unsigned char, 147, 1>, float, 16ul, 16ul>(scaled_channel<unsigned char, 147, 1> (&) [16ul][16ul], float):
✓ Branch 0 taken 512 times.
✓ Branch 1 taken 32 times.
void setTable<float, float, 2ul, 8ul>(float (&) [2ul][8ul], float):
✓ Branch 0 taken 64 times.
✓ Branch 1 taken 8 times.
|
20/38void setTable<short, float, 6ul, 6ul>(short (&) [6ul][6ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<scaled_channel<short, 10, 1>, int, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], int):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<float, int, 4ul, 8ul>(float (&) [4ul][8ul], int):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<scaled_channel<short, 10, 1>, float, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<float, double, 4ul, 8ul>(float (&) [4ul][8ul], double):
✓ Decision 'true' taken 512 times.
✓ Decision 'false' taken 64 times.
void setTable<scaled_channel<unsigned char, 1, 2>, float, 8ul, 8ul>(scaled_channel<unsigned char, 1, 2> (&) [8ul][8ul], float):
✓ Decision 'true' taken 512 times.
✓ Decision 'false' taken 64 times.
void setTable<float, float, 4ul, 8ul>(float (&) [4ul][8ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<scaled_channel<unsigned char, 2, 1>, float, 8ul, 8ul>(scaled_channel<unsigned char, 2, 1> (&) [8ul][8ul], float):
✓ Decision 'true' taken 512 times.
✓ Decision 'false' taken 64 times.
void setTable<scaled_channel<short, 100, 1>, float, 2ul, 8ul>(scaled_channel<short, 100, 1> (&) [2ul][8ul], float):
✓ Decision 'true' taken 448 times.
✓ Decision 'false' taken 56 times.
void setTable<float, float, 16ul, 16ul>(float (&) [16ul][16ul], float):
✓ Decision 'true' taken 301568 times.
✓ Decision 'false' taken 18848 times.
void setTable<scaled_channel<short, 10, 1>, double, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], double):
✓ Decision 'true' taken 32 times.
✓ Decision 'false' taken 8 times.
void setTable<float, unsigned char, 8ul, 8ul>(float (&) [8ul][8ul], unsigned char):
✓ Decision 'true' taken 128 times.
✓ Decision 'false' taken 16 times.
void setTable<scaled_channel<short, 10, 1>, int, 8ul, 8ul>(scaled_channel<short, 10, 1> (&) [8ul][8ul], int):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<scaled_channel<unsigned char, 2, 1>, int, 8ul, 8ul>(scaled_channel<unsigned char, 2, 1> (&) [8ul][8ul], int):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<float, float, 2ul, 6ul>(float (&) [2ul][6ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<signed char, int, 6ul, 6ul>(signed char (&) [6ul][6ul], int):
✓ Decision 'true' taken 108 times.
✓ Decision 'false' taken 18 times.
void setTable<scaled_channel<unsigned short, 100, 1>, int, 8ul, 8ul>(scaled_channel<unsigned short, 100, 1> (&) [8ul][8ul], int):
✓ Decision 'true' taken 64 times.
✓ Decision 'false' taken 8 times.
void setTable<scaled_channel<short, 10, 1>, float, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setTable<float, float, 2ul, 8ul>(float (&) [2ul][8ul], float):
✓ Decision 'true' taken 64 times.
✓ Decision 'false' taken 8 times.
|
570774 | for (size_t m = 0; m < M; m++) { |
170 | 522064 | dest[n][m] = value; | ||
171 | } | |||
172 | } | |||
173 | 5979 | } | ||
174 | ||||
175 | template <typename TDest, typename TSource, size_t N, size_t M> | |||
176 | 1231 | constexpr void copyTable(TDest (&dest)[N][M], const TSource (&source)[N][M], float multiply = 1.0f) { | ||
177 |
20/20void copyTable<scaled_channel<unsigned char, 147, 1>, float, 16ul, 16ul>(scaled_channel<unsigned char, 147, 1> (&) [16ul][16ul], float const (&) [16ul][16ul], float):
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 1 time.
void copyTable<scaled_channel<unsigned short, 10, 1>, float, 16ul, 16ul>(scaled_channel<unsigned short, 10, 1> (&) [16ul][16ul], float const (&) [16ul][16ul], float):
✓ Branch 0 taken 9392 times.
✓ Branch 1 taken 587 times.
void copyTable<scaled_channel<short, 10, 1>, float, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], float const (&) [16ul][16ul], float):
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 1 time.
void copyTable<signed char, float, 8ul, 8ul>(signed char (&) [8ul][8ul], float const (&) [8ul][8ul], float):
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 2 times.
void copyTable<float, unsigned char, 8ul, 8ul>(float (&) [8ul][8ul], unsigned char const (&) [8ul][8ul], float):
✓ Branch 0 taken 4688 times.
✓ Branch 1 taken 586 times.
void copyTable<scaled_channel<short, 10, 1>, unsigned char, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], unsigned char const (&) [16ul][16ul], float):
✓ Branch 0 taken 352 times.
✓ Branch 1 taken 22 times.
void copyTable<scaled_channel<unsigned short, 10, 1>, unsigned char, 16ul, 16ul>(scaled_channel<unsigned short, 10, 1> (&) [16ul][16ul], unsigned char const (&) [16ul][16ul], float):
✓ Branch 0 taken 112 times.
✓ Branch 1 taken 7 times.
void copyTable<scaled_channel<short, 100, 1>, float, 2ul, 8ul>(scaled_channel<short, 100, 1> (&) [2ul][8ul], float const (&) [2ul][8ul], float):
✓ Branch 0 taken 18 times.
✓ Branch 1 taken 9 times.
void copyTable<signed char, unsigned char, 8ul, 8ul>(signed char (&) [8ul][8ul], unsigned char const (&) [8ul][8ul], float):
✓ Branch 0 taken 64 times.
✓ Branch 1 taken 8 times.
void copyTable<scaled_channel<unsigned short, 10, 1>, signed char, 16ul, 16ul>(scaled_channel<unsigned short, 10, 1> (&) [16ul][16ul], signed char const (&) [16ul][16ul], float):
✓ Branch 0 taken 128 times.
✓ Branch 1 taken 8 times.
|
2/4void copyTable<scaled_channel<short, 10, 1>, unsigned char, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], unsigned char const (&) [16ul][16ul], float):
✓ Decision 'true' taken 352 times.
✓ Decision 'false' taken 22 times.
void copyTable<scaled_channel<short, 100, 1>, float, 2ul, 8ul>(scaled_channel<short, 100, 1> (&) [2ul][8ul], float const (&) [2ul][8ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
|
16033 | for (size_t n = 0; n < N; n++) { |
178 |
20/20void copyTable<scaled_channel<unsigned char, 147, 1>, float, 16ul, 16ul>(scaled_channel<unsigned char, 147, 1> (&) [16ul][16ul], float const (&) [16ul][16ul], float):
✓ Branch 0 taken 256 times.
✓ Branch 1 taken 16 times.
void copyTable<scaled_channel<unsigned short, 10, 1>, float, 16ul, 16ul>(scaled_channel<unsigned short, 10, 1> (&) [16ul][16ul], float const (&) [16ul][16ul], float):
✓ Branch 0 taken 150272 times.
✓ Branch 1 taken 9392 times.
void copyTable<scaled_channel<short, 10, 1>, float, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], float const (&) [16ul][16ul], float):
✓ Branch 0 taken 256 times.
✓ Branch 1 taken 16 times.
void copyTable<signed char, float, 8ul, 8ul>(signed char (&) [8ul][8ul], float const (&) [8ul][8ul], float):
✓ Branch 0 taken 128 times.
✓ Branch 1 taken 16 times.
void copyTable<float, unsigned char, 8ul, 8ul>(float (&) [8ul][8ul], unsigned char const (&) [8ul][8ul], float):
✓ Branch 0 taken 37504 times.
✓ Branch 1 taken 4688 times.
void copyTable<scaled_channel<short, 10, 1>, unsigned char, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], unsigned char const (&) [16ul][16ul], float):
✓ Branch 0 taken 5632 times.
✓ Branch 1 taken 352 times.
void copyTable<scaled_channel<unsigned short, 10, 1>, unsigned char, 16ul, 16ul>(scaled_channel<unsigned short, 10, 1> (&) [16ul][16ul], unsigned char const (&) [16ul][16ul], float):
✓ Branch 0 taken 1792 times.
✓ Branch 1 taken 112 times.
void copyTable<scaled_channel<short, 100, 1>, float, 2ul, 8ul>(scaled_channel<short, 100, 1> (&) [2ul][8ul], float const (&) [2ul][8ul], float):
✓ Branch 0 taken 144 times.
✓ Branch 1 taken 18 times.
void copyTable<signed char, unsigned char, 8ul, 8ul>(signed char (&) [8ul][8ul], unsigned char const (&) [8ul][8ul], float):
✓ Branch 0 taken 512 times.
✓ Branch 1 taken 64 times.
void copyTable<scaled_channel<unsigned short, 10, 1>, signed char, 16ul, 16ul>(scaled_channel<unsigned short, 10, 1> (&) [16ul][16ul], signed char const (&) [16ul][16ul], float):
✓ Branch 0 taken 2048 times.
✓ Branch 1 taken 128 times.
|
2/4void copyTable<scaled_channel<short, 10, 1>, unsigned char, 16ul, 16ul>(scaled_channel<short, 10, 1> (&) [16ul][16ul], unsigned char const (&) [16ul][16ul], float):
✓ Decision 'true' taken 5632 times.
✓ Decision 'false' taken 352 times.
void copyTable<scaled_channel<short, 100, 1>, float, 2ul, 8ul>(scaled_channel<short, 100, 1> (&) [2ul][8ul], float const (&) [2ul][8ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
|
213346 | for (size_t m = 0; m < M; m++) { |
179 | 198544 | dest[n][m] = source[n][m] * multiply; | ||
180 | } | |||
181 | } | |||
182 | 1231 | } | ||
183 | ||||
184 | template <typename TDest, typename TSource, size_t N, size_t M> | |||
185 | 1174 | constexpr void copyTable( | ||
186 | TDest (&dest)[N][M], | |||
187 | const std::array<std::array<TSource, M>, N>& source, | |||
188 | float multiply = 1.0f | |||
189 | ) { | |||
190 |
2/2✓ Branch 0 taken 2348 times.
✓ Branch 1 taken 1174 times.
|
2/2✓ Decision 'true' taken 2348 times.
✓ Decision 'false' taken 1174 times.
|
3522 | for (size_t n = 0; n < N; n++) { |
191 |
2/2✓ Branch 0 taken 18784 times.
✓ Branch 1 taken 2348 times.
|
2/2✓ Decision 'true' taken 18784 times.
✓ Decision 'false' taken 2348 times.
|
21132 | for (size_t m = 0; m < M; m++) { |
192 | 18784 | dest[n][m] = source[n][m] * multiply; | ||
193 | } | |||
194 | } | |||
195 | 1174 | } | ||
196 | ||||
197 | // specialization that can use memcpy when src and dest types match | |||
198 | template <typename TDest, size_t N, size_t M> | |||
199 | constexpr void copyTable(scaled_channel<TDest, 1, 1> (&dest)[N][M], const TDest (&source)[N][M]) { | |||
200 | memcpy(dest, source, N * M * sizeof(TDest)); | |||
201 | } | |||
202 | ||||
203 | template <typename TDest, size_t N, size_t M> | |||
204 | constexpr void copyTable(TDest (&dest)[N][M], const TDest (&source)[N][M]) { | |||
205 | memcpy(dest, source, N * M * sizeof(TDest)); | |||
206 | } | |||
207 | ||||
208 | template<typename kType> | |||
209 | 18168 | void setRpmBin(kType array[], int size, float idleRpm, float topRpm) { | ||
210 | 18168 | array[0] = idleRpm - 150; | ||
211 | 18168 | int rpmStep = (int)(efiRound((topRpm - idleRpm) / (size - 2), 50) - 150); | ||
212 |
10/10void setRpmBin<float>(float*, int, float, float):
✓ Branch 0 taken 8218 times.
✓ Branch 1 taken 1759 times.
void setRpmBin<scaled_channel<unsigned char, 1, 100> >(scaled_channel<unsigned char, 1, 100>*, int, float, float):
✓ Branch 0 taken 11722 times.
✓ Branch 1 taken 2931 times.
void setRpmBin<short>(short*, int, float, float):
✓ Branch 0 taken 15236 times.
✓ Branch 1 taken 2344 times.
void setRpmBin<unsigned short>(unsigned short*, int, float, float):
✓ Branch 0 taken 51568 times.
✓ Branch 1 taken 7032 times.
void setRpmBin<scaled_channel<unsigned char, 1, 50> >(scaled_channel<unsigned char, 1, 50>*, int, float, float):
✓ Branch 0 taken 17580 times.
✓ Branch 1 taken 4102 times.
|
4/8void setRpmBin<float>(float*, int, float, float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setRpmBin<scaled_channel<unsigned char, 1, 100> >(scaled_channel<unsigned char, 1, 100>*, int, float, float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setRpmBin<unsigned short>(unsigned short*, int, float, float):
✓ Decision 'true' taken 51568 times.
✓ Decision 'false' taken 7032 times.
void setRpmBin<scaled_channel<unsigned char, 1, 50> >(scaled_channel<unsigned char, 1, 50>*, int, float, float):
✓ Decision 'true' taken 17580 times.
✓ Decision 'false' taken 4102 times.
|
122492 | for (int i = 1; i < size - 1;i++) |
213 | 104324 | array[i] = idleRpm + rpmStep * (i - 1); | ||
214 | 18168 | array[size - 1] = topRpm; | ||
215 | 18168 | } | ||
216 | ||||
217 | /** | |||
218 | * initialize RPM table axis using default RPM range | |||
219 | */ | |||
220 | template<typename TValue, int TSize> | |||
221 | 17581 | void setRpmTableBin(TValue (&array)[TSize]) { | ||
222 | 17581 | setRpmBin(array, TSize, 800, DEFAULT_RPM_AXIS_HIGH_VALUE); | ||
223 | 17581 | } | ||
224 |