Class template for performing linear interpolation using a lookup table. More...
#include <Interp.hpp>
Public Member Functions | |
| LinearInterp ()=delete | |
| constexpr | LinearInterp (const TablePoint< Tin, Tout >(&table_)[size]) |
| constexpr Tout | interp (Tin input) const |
| Performs linear interpolation for the given input value, using the table. | |
| constexpr Tin | start () const |
| Returns the starting input value of the interpolation table. | |
| constexpr Tin | range () const |
| Returns the input range of the interpolation table (last input - first input) | |
Private Member Functions | |
| const | TablePoint (&table)[size] |
Class template for performing linear interpolation using a lookup table.
| Tin | Type of the input values |
| Tout | Type of the output values |
| Tmid | Intermediate type for calculations to prevent overflow |
| size | Number of points in the interpolation table |
Definition at line 34 of file Interp.hpp.
|
delete |
Default constructor deleted to prevent instantiation without a table
|
inlineexplicitconstexpr |
Normal constructor
Definition at line 38 of file Interp.hpp.
|
inlineconstexpr |
Performs linear interpolation for the given input value, using the table.
| input | The input value to interpolate |
Definition at line 45 of file Interp.hpp.
References TablePoint< Tin, Tout >::in, and TablePoint< Tin, Tout >::out.
Referenced by Pedal::checkPedalFault(), and Pedal::pedalTorqueMapping().
|
inlineconstexpr |
Returns the input range of the interpolation table (last input - first input)
Definition at line 83 of file Interp.hpp.
Referenced by Pedal::checkPedalFault().
|
inlineconstexpr |
Returns the starting input value of the interpolation table.
Definition at line 74 of file Interp.hpp.
Referenced by Pedal::pedalTorqueMapping().
|
private |
Reference to the interpolation table