Class for calculating the linear interpolation. It interpolates till 3-dimensional data.
More...
|
| LinearInterpolator (bool limitToBoundaryValues=true) |
|
virtual | ~LinearInterpolator ()=default |
|
bool | init (const T_IN dimension1Data[], uint16_t dimension1DataSize, const T_TARGET targetData[], uint16_t targetDataSize) |
| Initializes the class members with 1 dimensional data points. More...
|
|
bool | init (const T_IN dimension1Data[], uint16_t dimension1DataSize, const T_IN dimension2Data[], uint16_t dimension2DataSize, const T_TARGET targetData[], uint16_t targetDataSize) |
| Initializes the class members with 2 dimensional data points. More...
|
|
bool | init (const T_IN dimension1Data[], uint16_t dimension1DataSize, const T_IN dimension2Data[], uint16_t dimension2DataSize, const T_IN dimension3Data[], uint16_t dimension3DataSize, const T_TARGET targetData[], uint16_t targetDataSize) |
| Initializes the class members with 2 dimensional data points. More...
|
|
bool | setTargetDataInputDimension (const T_TARGET targetData[], uint16_t targetDataSize) |
| It updates/changes the m_targetDataSource array. More...
|
|
bool | interpolate (T_TARGET &y, T_IN x1=0, T_IN x2=0, T_IN x3=0) |
| Calculates the interpolation of a given data point. More...
|
|
template<uint8_t MAX_DIMENSIONS, typename T_IN, typename T_TARGET = T_IN, typename T_STORAGE = T_TARGET>
class semf::LinearInterpolator< MAX_DIMENSIONS, T_IN, T_TARGET, T_STORAGE >
Class for calculating the linear interpolation. It interpolates till 3-dimensional data.
- Note
- The notation used in this class as follows: value as 'x' and the dimension's number is suffix, i.e.
x1
1st dimensional value, x2
2nd dimensional value. so a data point in 3d space (x1
, x2
, ,x3
). The corresponding value (target) of a given point is notated as y
.
- Template Parameters
-
MAX_DIMENTIONS | Maximum dimensions for interpolation (1, 2, or 3). |
T_IN | Data type of inputs. |
T_TARGET | Data type of outputs. |
T_STORAGE | Data type of intermediate results. |
Definition at line 31 of file linearinterpolator.h.
template<uint8_t MAX_DIMENSIONS, typename T_IN , typename T_TARGET , typename T_STORAGE >
bool semf::LinearInterpolator< MAX_DIMENSIONS, T_IN, T_TARGET, T_STORAGE >::init |
( |
const T_IN |
dimension1Data[], |
|
|
uint16_t |
dimension1DataSize, |
|
|
const T_IN |
dimension2Data[], |
|
|
uint16_t |
dimension2DataSize, |
|
|
const T_IN |
dimension3Data[], |
|
|
uint16_t |
dimension3DataSize, |
|
|
const T_TARGET |
targetData[], |
|
|
uint16_t |
targetDataSize |
|
) |
| |
Initializes the class members with 2 dimensional data points.
- Parameters
-
dimension1Data | Pointer to the elements of the first dimension. |
dimension1DataSize | Number of elements of the first dimension. |
dimension2Data | Pointer to the elements of the second dimension. |
dimension2DataSize | Number of elements of the second dimension. |
dimension3Data | Pointer to the elements of the third dimension. |
dimension3DataSize | Number of elements of the third dimension. |
targetData | Pointer to the targetDataput dimension data. |
targetDataSize | Number of elements of the targetDataput data. |
- Returns
false
if the number of output elements doesn't match the number of input elements, otherwise returns true
.
Definition at line 229 of file linearinterpolator.h.