rusEFI
The most advanced open source ECU
|
Linear interpolation algorithms.
See test_interpolation_3d.cpp
Definition in file interpolation.cpp.
Functions | |
static void | testBinary () |
float | interpolateMsg (const char *msg, float x1, float y1, float x2, float y2, float x) |
Linear interpolation by two points. More... | |
float | interpolateClampedWithValidation (float x1, float y1, float x2, float y2, float x) |
float | interpolateClamped (float x1, float y1, float x2, float y2, float x) |
int | findIndex2 (const float array[], unsigned size, float value) |
int | findIndex (const float array[], int size, float value) |
void | initInterpolation () |
Variables | |
float | array16 [] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 } |
int findIndex | ( | const float | array[], |
int | size, | ||
float | value | ||
) |
Definition at line 155 of file interpolation.cpp.
Referenced by testBinary().
int findIndex2 | ( | const float | array[], |
unsigned | size, | ||
float | value | ||
) |
Another implementation, which one is faster?
it should be "if (j < size && array[j] <= value)" but in our case size is always power of 2 thus size is always more then j
Definition at line 131 of file interpolation.cpp.
Referenced by testBinary().
void initInterpolation | ( | ) |
Definition at line 159 of file interpolation.cpp.
Referenced by commonInitEngineController().
float interpolateClamped | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x | ||
) |
todo: use 'interpolateClampedWithValidation' wider?
Definition at line 115 of file interpolation.cpp.
Referenced by ThrottleModelBase::estimateThrottleFlow(), flexCallback(), IdleController::getClosedLoop(), getCrankingAdvance(), getCrankingFuel3(), IdleController::getIdleTimingAdjustment(), IdleController::getOpenLoop(), getRunningAdvance(), IdleController::getRunningOpenLoop(), EtbController::getSetpointEtb(), FuelComputer::getStoichiometricRatio(), IFuelComputer::getTCharge(), IFuelComputer::getTChargeCoefficient(), AirmassVeModelBase::getVe(), interpolateClampedWithValidation(), HellaOilLevelSensor::onEdge(), setHysteresis(), LimpManager::updateRevLimit(), and updateVrThresholdPwm().
float interpolateClampedWithValidation | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x | ||
) |
Definition at line 104 of file interpolation.cpp.
float interpolateMsg | ( | const char * | msg, |
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x | ||
) |
Linear interpolation by two points.
x1 | key of the first point |
y1 | value of the first point |
x2 | key of the second point |
y2 | value of the second point |
X | key to be interpolated |
we could end up here for example while resetting bins while changing engine type
Definition at line 74 of file interpolation.cpp.
Referenced by decodeTpsSentValue(), getAdvanceForRpm(), getAfr(), IFuelComputer::getTChargeCoefficient(), lua_interpolate(), and setLinearCurve().
|
static |
Definition at line 25 of file interpolation.cpp.
Referenced by initInterpolation().
float array16[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 } |
Definition at line 23 of file interpolation.cpp.
Referenced by testBinary().