This commit is contained in:
Matthew Kennedy 2020-03-18 18:55:46 -07:00 committed by GitHub
parent 0b7a929587
commit e605b39ab1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@
class ValueProvider3D {
public:
virtual float getValue(float xRpm, float y) = 0;
virtual float getValue(float xRpm, float y) const = 0;
};
@ -30,7 +30,7 @@ public:
explicit Map3D(const char*name);
Map3D(const char*name, float multiplier);
void init(vType table[RPM_BIN_SIZE][LOAD_BIN_SIZE], const kType loadBins[LOAD_BIN_SIZE], const kType rpmBins[RPM_BIN_SIZE]);
float getValue(float xRpm, float y);
float getValue(float xRpm, float y) const;
void setAll(vType value);
vType *pointers[LOAD_BIN_SIZE];
private:
@ -97,7 +97,7 @@ void Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE, vType, kType>::init(vType table[RPM_BIN_
}
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE, typename vType, typename kType>
float Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE, vType, kType>::getValue(float xRpm, float y) {
float Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE, vType, kType>::getValue(float xRpm, float y) const {
efiAssert(CUSTOM_ERR_ASSERT, initialized, "map not initialized", NAN);
if (cisnan(y)) {
warning(CUSTOM_PARAM_RANGE, "%s: y is NaN", name);

View File

@ -102,7 +102,7 @@ int findIndexMsgExt(const char *msg, const kType array[], int size, kType value)
* @brief Two-dimensional table lookup with linear interpolation
*/
template<typename vType, typename kType>
float interpolate3d(float x, const kType xBin[], int xBinSize, float y, const kType yBin[], int yBinSize, vType* map[]) {
float interpolate3d(float x, const kType xBin[], int xBinSize, float y, const kType yBin[], int yBinSize, const vType* const map[]) {
if (cisnan(x)) {
warning(CUSTOM_INTEPOLATE_ERROR_3, "%.2f: x is NaN in interpolate3d", x);
return NAN;