| 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 | 7798 | 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 | 7798 | initValues(table); | ||
| 54 | 7798 | initRows(rowBins); | ||
| 55 | 7798 | initCols(columnBins); | ||
| 56 | 7798 | } | ||
| 57 | ||||
| 58 | // RPM is usually X/Column | |||
| 59 | 3919 | float getValue(float xColumn, float yRow) const final { | ||
| 60 |
11/30Map3D<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<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 2411 times.
Map3D<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<8, 8, unsigned char, unsigned char, unsigned short>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 64 times.
Map3D<16, 16, unsigned short, unsigned short, unsigned short>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 1087 times.
Map3D<6, 6, unsigned short, unsigned short, unsigned short>::getValue(float, float) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
4/12Map3D<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 2411 times.
Map3D<8, 8, unsigned char, short, short>::getValue(float, float) const:
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
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 1087 times.
Map3D<6, 6, unsigned short, unsigned short, unsigned short>::getValue(float, float) const:
✗ Decision 'true' not taken.
✓ Decision 'false' taken 1 time.
|
3919 | if (!m_values) { |
| 61 | ✗ | criticalError("Access to uninitialized table: %s", m_name); | ||
| 62 | ✗ | return 0; | ||
| 63 | } | |||
| 64 | ||||
| 65 | 7837 | return interpolate3d(*m_values, | ||
| 66 | 3919 | *m_rowBins, yRow * m_rowMult, | ||
| 67 | 3919 | *m_columnBins, xColumn * m_colMult) * | ||
| 68 | 3919 | 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 | 2990 | void initValues(scaled_channel<TValue, TMult, TDiv> (&table)[TRowNum][TColNum]) { | ||
| 84 | 2990 | m_values = reinterpret_cast<TValue (*)[TRowNum][TColNum]>(&table); | ||
| 85 | 2990 | m_valueMult = 1 / efi::ratio<TMult, TDiv>::asFloat(); | ||
| 86 | 2990 | } | ||
| 87 | ||||
| 88 | 4808 | void initValues(TValue (&table)[TRowNum][TColNum]) { | ||
| 89 | 4808 | m_values = &table; | ||
| 90 | 4808 | m_valueMult = 1; | ||
| 91 | 4808 | } | ||
| 92 | ||||
| 93 | template <int TRowMult, int TRowDiv> | |||
| 94 | 646 | void initRows(const scaled_channel<TRow, TRowMult, TRowDiv> (&rowBins)[TRowNum]) { | ||
| 95 | 646 | m_rowBins = reinterpret_cast<const TRow (*)[TRowNum]>(&rowBins); | ||
| 96 | 646 | m_rowMult = efi::ratio<TRowMult, TRowDiv>::asFloat(); | ||
| 97 | 646 | } | ||
| 98 | ||||
| 99 | 7152 | void initRows(const TRow (&rowBins)[TRowNum]) { | ||
| 100 | 7152 | m_rowBins = &rowBins; | ||
| 101 | 7152 | m_rowMult = 1; | ||
| 102 | 7152 | } | ||
| 103 | ||||
| 104 | template <int TColMult, int TColDiv> | |||
| 105 | 4166 | void initCols(const scaled_channel<TXColumn, TColMult, TColDiv> (&columnBins)[TColNum]) { | ||
| 106 | 4166 | m_columnBins = reinterpret_cast<const TXColumn (*)[TColNum]>(&columnBins); | ||
| 107 | 4166 | m_colMult = efi::ratio<TColMult, TColDiv>::asFloat(); | ||
| 108 | 4166 | } | ||
| 109 | ||||
| 110 | 3632 | void initCols(const TXColumn (&columnBins)[TColNum]) { | ||
| 111 | 3632 | m_columnBins = &columnBins; | ||
| 112 | 3632 | m_colMult = 1; | ||
| 113 | 3632 | } | ||
| 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 | 60497 | void setLinearCurve(TValue (&array)[TSize], float from, float to, float precision = 0.01f) { | ||
| 149 |
76/76void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 12>(scaled_channel<unsigned short, 10, 1> (&) [12], float, float, float):
✓ Branch 0 taken 7044 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 100>, 16>(scaled_channel<unsigned char, 1, 100> (&) [16], float, float, float):
✓ Branch 0 taken 9392 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<unsigned short, 8>(unsigned short (&) [8], float, float, float):
✓ Branch 0 taken 103312 times.
✓ Branch 1 taken 12914 times.
void setLinearCurve<scaled_channel<unsigned short, 1000, 1>, 8>(scaled_channel<unsigned short, 1000, 1> (&) [8], float, float, float):
✓ Branch 0 taken 4696 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<unsigned short, 4>(unsigned short (&) [4], float, float, float):
✓ Branch 0 taken 4696 times.
✓ Branch 1 taken 1174 times.
void setLinearCurve<float, 16>(float (&) [16], float, float, float):
✓ Branch 0 taken 37568 times.
✓ Branch 1 taken 2348 times.
void setLinearCurve<float, 8>(float (&) [8], float, float, float):
✓ Branch 0 taken 70488 times.
✓ Branch 1 taken 8811 times.
void setLinearCurve<short, 8>(short (&) [8], float, float, float):
✓ Branch 0 taken 23480 times.
✓ Branch 1 taken 2935 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, 16>(unsigned short (&) [16], float, float, float):
✓ Branch 0 taken 28416 times.
✓ Branch 1 taken 1776 times.
void setLinearCurve<unsigned short, 6>(unsigned short (&) [6], float, float, float):
✓ Branch 0 taken 10602 times.
✓ Branch 1 taken 1767 times.
void setLinearCurve<short, 4>(short (&) [4], float, float, float):
✓ Branch 0 taken 2348 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<float, 6>(float (&) [6], float, float, float):
✓ Branch 0 taken 3522 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<unsigned char, 8>(unsigned char (&) [8], float, float, float):
✓ Branch 0 taken 14088 times.
✓ Branch 1 taken 1761 times.
void setLinearCurve<scaled_channel<unsigned char, 2, 1>, 8>(scaled_channel<unsigned char, 2, 1> (&) [8], float, float, float):
✓ Branch 0 taken 46960 times.
✓ Branch 1 taken 5870 times.
void setLinearCurve<scaled_channel<short, 10, 1>, 8>(scaled_channel<short, 10, 1> (&) [8], float, float, float):
✓ Branch 0 taken 46960 times.
✓ Branch 1 taken 5870 times.
void setLinearCurve<scaled_channel<unsigned char, 50, 1>, 8>(scaled_channel<unsigned char, 50, 1> (&) [8], float, float, float):
✓ Branch 0 taken 4696 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<unsigned char, 10, 1>, 8>(scaled_channel<unsigned char, 10, 1> (&) [8], float, float, float):
✓ Branch 0 taken 4696 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 4>(scaled_channel<unsigned char, 1, 5> (&) [4], float, float, float):
✓ Branch 0 taken 2348 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<short, 1, 1>, 5>(scaled_channel<short, 1, 1> (&) [5], float, float, float):
✓ Branch 0 taken 2935 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 5>(scaled_channel<unsigned char, 1, 5> (&) [5], float, float, float):
✓ Branch 0 taken 2935 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 8>(scaled_channel<unsigned char, 1, 5> (&) [8], float, float, float):
✓ Branch 0 taken 4696 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<unsigned char, 6>(unsigned char (&) [6], float, float, float):
✓ Branch 0 taken 3528 times.
✓ Branch 1 taken 588 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 6>(scaled_channel<unsigned short, 100, 1> (&) [6], float, float, float):
✓ Branch 0 taken 7050 times.
✓ Branch 1 taken 1175 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 2>(scaled_channel<unsigned short, 10, 1> (&) [2], float, float, float):
✓ Branch 0 taken 1174 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 2>(scaled_channel<unsigned short, 100, 1> (&) [2], float, float, float):
✓ Branch 0 taken 1174 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 8>(scaled_channel<unsigned short, 10, 1> (&) [8], float, float, float):
✓ Branch 0 taken 4696 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 8>(scaled_channel<unsigned short, 100, 1> (&) [8], float, float, float):
✓ Branch 0 taken 4696 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 10>(scaled_channel<unsigned short, 10, 1> (&) [10], float, float, float):
✓ Branch 0 taken 5870 times.
✓ Branch 1 taken 587 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 char, 100, 1>, 6>(scaled_channel<unsigned char, 100, 1> (&) [6], float, float, float):
✓ Branch 0 taken 7044 times.
✓ Branch 1 taken 1174 times.
void setLinearCurve<scaled_channel<unsigned char, 50, 1>, 4>(scaled_channel<unsigned char, 50, 1> (&) [4], float, float, float):
✓ Branch 0 taken 4696 times.
✓ Branch 1 taken 1174 times.
void setLinearCurve<float, 2>(float (&) [2], float, float, float):
✓ Branch 0 taken 1174 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<float, 4>(float (&) [4], float, float, float):
✓ Branch 0 taken 2348 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<scaled_channel<unsigned short, 1000, 1>, 10>(scaled_channel<unsigned short, 1000, 1> (&) [10], float, float, float):
✓ Branch 0 taken 5870 times.
✓ Branch 1 taken 587 times.
void setLinearCurve<short, 6>(short (&) [6], float, float, float):
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 time.
|
6/12void setLinearCurve<unsigned short, 8>(unsigned short (&) [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<unsigned short, 16>(unsigned short (&) [16], float, float, float):
✓ Decision 'true' taken 28416 times.
✓ Decision 'false' taken 1776 times.
void setLinearCurve<unsigned char, 8>(unsigned char (&) [8], float, float, float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
void setLinearCurve<scaled_channel<unsigned char, 100, 1>, 6>(scaled_channel<unsigned char, 100, 1> (&) [6], float, float, float):
✓ Decision 'true' taken 7044 times.
✓ Decision 'false' taken 1174 times.
|
545781 | for (int i = 0; i < TSize; i++) { |
| 150 | 485284 | 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 short, 10, 1>, 12>(scaled_channel<unsigned short, 10, 1> (&) [12], float, float, float):
✓ Branch 2 taken 7044 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 100>, 16>(scaled_channel<unsigned char, 1, 100> (&) [16], float, float, float):
✓ Branch 2 taken 9392 times.
void setLinearCurve<scaled_channel<unsigned short, 1000, 1>, 8>(scaled_channel<unsigned short, 1000, 1> (&) [8], float, float, float):
✓ Branch 2 taken 4696 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 char, 2, 1>, 8>(scaled_channel<unsigned char, 2, 1> (&) [8], float, float, float):
✓ Branch 2 taken 46960 times.
void setLinearCurve<scaled_channel<short, 10, 1>, 8>(scaled_channel<short, 10, 1> (&) [8], float, float, float):
✓ Branch 2 taken 46960 times.
void setLinearCurve<scaled_channel<unsigned char, 50, 1>, 8>(scaled_channel<unsigned char, 50, 1> (&) [8], float, float, float):
✓ Branch 2 taken 4696 times.
void setLinearCurve<scaled_channel<unsigned char, 10, 1>, 8>(scaled_channel<unsigned char, 10, 1> (&) [8], float, float, float):
✓ Branch 2 taken 4696 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 4>(scaled_channel<unsigned char, 1, 5> (&) [4], float, float, float):
✓ Branch 2 taken 2348 times.
void setLinearCurve<scaled_channel<short, 1, 1>, 5>(scaled_channel<short, 1, 1> (&) [5], float, float, float):
✓ Branch 2 taken 2935 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 5>(scaled_channel<unsigned char, 1, 5> (&) [5], float, float, float):
✓ Branch 2 taken 2935 times.
void setLinearCurve<scaled_channel<unsigned char, 1, 5>, 8>(scaled_channel<unsigned char, 1, 5> (&) [8], float, float, float):
✓ Branch 2 taken 4696 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 6>(scaled_channel<unsigned short, 100, 1> (&) [6], float, float, float):
✓ Branch 2 taken 7050 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 2>(scaled_channel<unsigned short, 10, 1> (&) [2], float, float, float):
✓ Branch 2 taken 1174 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 2>(scaled_channel<unsigned short, 100, 1> (&) [2], float, float, float):
✓ Branch 2 taken 1174 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 8>(scaled_channel<unsigned short, 10, 1> (&) [8], float, float, float):
✓ Branch 2 taken 4696 times.
void setLinearCurve<scaled_channel<unsigned short, 100, 1>, 8>(scaled_channel<unsigned short, 100, 1> (&) [8], float, float, float):
✓ Branch 2 taken 4696 times.
void setLinearCurve<scaled_channel<unsigned short, 10, 1>, 10>(scaled_channel<unsigned short, 10, 1> (&) [10], float, float, float):
✓ Branch 2 taken 5870 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 char, 100, 1>, 6>(scaled_channel<unsigned char, 100, 1> (&) [6], float, float, float):
✓ Branch 2 taken 7044 times.
void setLinearCurve<scaled_channel<unsigned char, 50, 1>, 4>(scaled_channel<unsigned char, 50, 1> (&) [4], float, float, float):
✓ Branch 2 taken 4696 times.
void setLinearCurve<scaled_channel<unsigned short, 1000, 1>, 10>(scaled_channel<unsigned short, 1000, 1> (&) [10], float, float, float):
✓ Branch 2 taken 5870 times.
|
485284 | array[i] = efiRound(value, precision); | |
| 156 | } | |||
| 157 | 60497 | } | ||
| 158 | ||||
| 159 | template<typename TValue, int TSize> | |||
| 160 | 37648 | 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 2348 times.
✓ Branch 1 taken 587 times.
void setArrayValues<unsigned short, 6>(unsigned short (&) [6], float):
✓ Branch 0 taken 3576 times.
✓ Branch 1 taken 596 times.
void setArrayValues<float, 8>(float (&) [8], float):
✓ Branch 0 taken 4824 times.
✓ Branch 1 taken 603 times.
void setArrayValues<scaled_channel<signed char, 2, 1>, 16>(scaled_channel<signed char, 2, 1> (&) [16], float):
✓ Branch 0 taken 9392 times.
✓ Branch 1 taken 587 times.
void setArrayValues<scaled_channel<unsigned short, 100, 1>, 8>(scaled_channel<unsigned short, 100, 1> (&) [8], float):
✓ Branch 0 taken 8984 times.
✓ Branch 1 taken 1123 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, 12>(float (&) [12], float):
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 1 time.
void setArrayValues<float, 5>(float (&) [5], float):
✓ Branch 0 taken 40 times.
✓ Branch 1 taken 8 times.
void setArrayValues<bool, 280>(bool (&) [280], float):
✓ Branch 0 taken 854280 times.
✓ Branch 1 taken 3051 times.
void setArrayValues<unsigned long, 2>(unsigned long (&) [2], float):
✓ Branch 0 taken 44660 times.
✓ Branch 1 taken 22330 times.
void setArrayValues<unsigned int, 120>(unsigned int (&) [120], float):
✓ Branch 0 taken 28560 times.
✓ Branch 1 taken 238 times.
void setArrayValues<unsigned int, 280>(unsigned int (&) [280], float):
✓ Branch 0 taken 66640 times.
✓ Branch 1 taken 238 times.
void setArrayValues<float, 16>(float (&) [16], float):
✓ Branch 0 taken 384 times.
✓ Branch 1 taken 24 times.
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 2712 times.
✓ Branch 1 taken 678 times.
void setArrayValues<float, 560>(float (&) [560], float):
✓ Branch 0 taken 836640 times.
✓ Branch 1 taken 1494 times.
void setArrayValues<unsigned int, 19>(unsigned int (&) [19], float):
✓ Branch 0 taken 114171 times.
✓ Branch 1 taken 6009 times.
void setArrayValues<unsigned char, 8>(unsigned char (&) [8], float):
✓ Branch 0 taken 608 times.
✓ Branch 1 taken 76 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 4824 times.
✓ Decision 'false' taken 603 times.
void setArrayValues<float, 12>(float (&) [12], float):
✓ Decision 'true' taken 12 times.
✓ Decision 'false' taken 1 time.
void setArrayValues<float, 5>(float (&) [5], float):
✓ Decision 'true' taken 40 times.
✓ Decision 'false' taken 8 times.
void setArrayValues<float, 16>(float (&) [16], float):
✓ Decision 'true' taken 384 times.
✓ Decision 'false' taken 24 times.
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.
void setArrayValues<unsigned char, 8>(unsigned char (&) [8], float):
✓ Decision 'true' taken 608 times.
✓ Decision 'false' taken 76 times.
|
2015519 | for (int i = 0; i < TSize; i++) { |
| 162 | 1977871 | array[i] = value; | ||
| 163 | } | |||
| 164 | 37648 | } | ||
| 165 | ||||
| 166 | template <typename TElement, typename VElement, size_t N, size_t M> | |||
| 167 | 5989 | constexpr void setTable(TElement (&dest)[N][M], const VElement value) { | ||
| 168 |
68/72void setTable<float, double, 2ul, 8ul>(float (&) [2ul][8ul], double):
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 2 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<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, double, 4ul, 8ul>(float (&) [4ul][8ul], double):
✓ Branch 0 taken 64 times.
✓ Branch 1 taken 16 times.
void setTable<short, float, 6ul, 6ul>(short (&) [6ul][6ul], float):
✓ Branch 0 taken 3606 times.
✓ Branch 1 taken 601 times.
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>, int, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], int):
✓ Branch 0 taken 2352 times.
✓ Branch 1 taken 588 times.
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<float, float, 4ul, 8ul>(float (&) [4ul][8ul], float):
✓ Branch 0 taken 2376 times.
✓ Branch 1 taken 594 times.
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<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<short, 10, 1>, float, 8ul, 8ul>(scaled_channel<short, 10, 1> (&) [8ul][8ul], float):
✓ Branch 0 taken 4248 times.
✓ Branch 1 taken 531 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 18880 times.
✓ Branch 1 taken 1180 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, 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<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<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<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, 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 4696 times.
✓ Branch 1 taken 587 times.
void setTable<unsigned short, int, 10ul, 10ul>(unsigned short (&) [10ul][10ul], int):
✓ Branch 0 taken 5870 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<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<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<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<unsigned short, 100, 1>, int, 6ul, 6ul>(scaled_channel<unsigned short, 100, 1> (&) [6ul][6ul], int):
✓ Branch 0 taken 3522 times.
✓ Branch 1 taken 587 times.
void setTable<float, int, 4ul, 4ul>(float (&) [4ul][4ul], int):
✓ Branch 0 taken 2348 times.
✓ Branch 1 taken 587 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<float, float, 2ul, 8ul>(float (&) [2ul][8ul], float):
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 4 times.
void setTable<float, unsigned char, 8ul, 8ul>(float (&) [8ul][8ul], unsigned char):
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 2 times.
|
20/38void 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<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, double, 4ul, 8ul>(float (&) [4ul][8ul], double):
✓ Decision 'true' taken 64 times.
✓ Decision 'false' taken 16 times.
void setTable<short, float, 6ul, 6ul>(short (&) [6ul][6ul], float):
✗ 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>, int, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], 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<float, float, 4ul, 8ul>(float (&) [4ul][8ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
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<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<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 18880 times.
✓ Decision 'false' taken 1180 times.
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, 10, 1>, float, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
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<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<float, float, 2ul, 8ul>(float (&) [2ul][8ul], float):
✓ Decision 'true' taken 8 times.
✓ Decision 'false' taken 4 times.
void setTable<float, unsigned char, 8ul, 8ul>(float (&) [8ul][8ul], unsigned char):
✓ Decision 'true' taken 16 times.
✓ Decision 'false' taken 2 times.
|
54781 | for (size_t n = 0; n < N; n++) { |
| 169 |
68/72void setTable<float, double, 2ul, 8ul>(float (&) [2ul][8ul], double):
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 4 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<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, double, 4ul, 8ul>(float (&) [4ul][8ul], double):
✓ Branch 0 taken 512 times.
✓ Branch 1 taken 64 times.
void setTable<short, float, 6ul, 6ul>(short (&) [6ul][6ul], float):
✓ Branch 0 taken 21636 times.
✓ Branch 1 taken 3606 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>, int, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], int):
✓ Branch 0 taken 9408 times.
✓ Branch 1 taken 2352 times.
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<float, float, 4ul, 8ul>(float (&) [4ul][8ul], float):
✓ Branch 0 taken 19008 times.
✓ Branch 1 taken 2376 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<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<short, 10, 1>, float, 8ul, 8ul>(scaled_channel<short, 10, 1> (&) [8ul][8ul], float):
✓ Branch 0 taken 33984 times.
✓ Branch 1 taken 4248 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 302080 times.
✓ Branch 1 taken 18880 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, 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<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<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<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, 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 37568 times.
✓ Branch 1 taken 4696 times.
void setTable<unsigned short, int, 10ul, 10ul>(unsigned short (&) [10ul][10ul], int):
✓ Branch 0 taken 58700 times.
✓ Branch 1 taken 5870 times.
void setTable<float, float, 6ul, 6ul>(float (&) [6ul][6ul], float):
✓ Branch 0 taken 36 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 144 times.
✓ Branch 1 taken 36 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<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<unsigned short, 100, 1>, int, 6ul, 6ul>(scaled_channel<unsigned short, 100, 1> (&) [6ul][6ul], int):
✓ Branch 0 taken 21132 times.
✓ Branch 1 taken 3522 times.
void setTable<float, int, 4ul, 4ul>(float (&) [4ul][4ul], int):
✓ Branch 0 taken 9392 times.
✓ Branch 1 taken 2348 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<float, float, 2ul, 8ul>(float (&) [2ul][8ul], float):
✓ Branch 0 taken 64 times.
✓ Branch 1 taken 8 times.
void setTable<float, unsigned char, 8ul, 8ul>(float (&) [8ul][8ul], unsigned char):
✓ Branch 0 taken 128 times.
✓ Branch 1 taken 16 times.
|
20/38void 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<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, double, 4ul, 8ul>(float (&) [4ul][8ul], double):
✓ Decision 'true' taken 512 times.
✓ Decision 'false' taken 64 times.
void setTable<short, float, 6ul, 6ul>(short (&) [6ul][6ul], float):
✗ 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>, int, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], 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<float, float, 4ul, 8ul>(float (&) [4ul][8ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
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<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<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 302080 times.
✓ Decision 'false' taken 18880 times.
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, 10, 1>, float, 4ul, 4ul>(scaled_channel<short, 10, 1> (&) [4ul][4ul], float):
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
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<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<float, float, 2ul, 8ul>(float (&) [2ul][8ul], float):
✓ Decision 'true' taken 64 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.
|
571732 | for (size_t m = 0; m < M; m++) { |
| 170 | 522940 | dest[n][m] = value; | ||
| 171 | } | |||
| 172 | } | |||
| 173 | 5989 | } | ||
| 174 | ||||
| 175 | template <typename TDest, typename TSource, size_t N, size_t M> | |||
| 176 | 1233 | 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 9408 times.
✓ Branch 1 taken 588 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<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<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>, 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.
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<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<float, unsigned char, 8ul, 8ul>(float (&) [8ul][8ul], unsigned char const (&) [8ul][8ul], float):
✓ Branch 0 taken 4696 times.
✓ Branch 1 taken 587 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.
|
16059 | 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 150528 times.
✓ Branch 1 taken 9408 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<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<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>, 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.
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<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<float, unsigned char, 8ul, 8ul>(float (&) [8ul][8ul], unsigned char const (&) [8ul][8ul], float):
✓ Branch 0 taken 37568 times.
✓ Branch 1 taken 4696 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.
|
213690 | for (size_t m = 0; m < M; m++) { |
| 179 | 198864 | dest[n][m] = source[n][m] * multiply; | ||
| 180 | } | |||
| 181 | } | |||
| 182 | 1233 | } | ||
| 183 | ||||
| 184 | template <typename TDest, typename TSource, size_t N, size_t M> | |||
| 185 | 1176 | 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 2352 times.
✓ Branch 1 taken 1176 times.
|
2/2✓ Decision 'true' taken 2352 times.
✓ Decision 'false' taken 1176 times.
|
3528 | for (size_t n = 0; n < N; n++) { |
| 191 |
2/2✓ Branch 0 taken 18816 times.
✓ Branch 1 taken 2352 times.
|
2/2✓ Decision 'true' taken 18816 times.
✓ Decision 'false' taken 2352 times.
|
21168 | for (size_t m = 0; m < M; m++) { |
| 192 | 18816 | dest[n][m] = source[n][m] * multiply; | ||
| 193 | } | |||
| 194 | } | |||
| 195 | 1176 | } | ||
| 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 | 18199 | void setRpmBin(kType array[], int size, float idleRpm, float topRpm) { | ||
| 210 | 18199 | array[0] = idleRpm - 150; | ||
| 211 | 18199 | int rpmStep = (int)(efiRound((topRpm - idleRpm) / (size - 2), 50) - 150); | ||
| 212 |
10/10void setRpmBin<float>(float*, int, float, float):
✓ Branch 0 taken 8232 times.
✓ Branch 1 taken 1762 times.
void setRpmBin<scaled_channel<unsigned char, 1, 100> >(scaled_channel<unsigned char, 1, 100>*, int, float, float):
✓ Branch 0 taken 11742 times.
✓ Branch 1 taken 2936 times.
void setRpmBin<short>(short*, int, float, float):
✓ Branch 0 taken 15262 times.
✓ Branch 1 taken 2348 times.
void setRpmBin<unsigned short>(unsigned short*, int, float, float):
✓ Branch 0 taken 51656 times.
✓ Branch 1 taken 7044 times.
void setRpmBin<scaled_channel<unsigned char, 1, 50> >(scaled_channel<unsigned char, 1, 50>*, int, float, float):
✓ Branch 0 taken 17610 times.
✓ Branch 1 taken 4109 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 51656 times.
✓ Decision 'false' taken 7044 times.
void setRpmBin<scaled_channel<unsigned char, 1, 50> >(scaled_channel<unsigned char, 1, 50>*, int, float, float):
✓ Decision 'true' taken 17610 times.
✓ Decision 'false' taken 4109 times.
|
122701 | for (int i = 1; i < size - 1;i++) |
| 213 | 104502 | array[i] = idleRpm + rpmStep * (i - 1); | ||
| 214 | 18199 | array[size - 1] = topRpm; | ||
| 215 | 18199 | } | ||
| 216 | ||||
| 217 | /** | |||
| 218 | * initialize RPM table axis using default RPM range | |||
| 219 | */ | |||
| 220 | template<typename TValue, int TSize> | |||
| 221 | 17611 | void setRpmTableBin(TValue (&array)[TSize]) { | ||
| 222 | 17611 | setRpmBin(array, TSize, 800, DEFAULT_RPM_AXIS_HIGH_VALUE); | ||
| 223 | 17611 | } | ||
| 224 |