Image Component Library (ICL)
|
class for linear and quadatic extrapolation More...
#include <Extrapolator.h>
Static Public Member Functions | |
static valueType | predict (valueType x2, valueType x1) |
extrapolates the next value (time t) using linear interpolation More... | |
static valueType | predict (valueType x3, valueType x2, valueType x1) |
extrapolates the next value using quadratic interpolation More... | |
static valueType | predict (valueType x2, timeType t2, valueType x1, timeType t1, timeType t) |
linear interpolation, but with timestamped value More... | |
static valueType | predict (valueType x3, timeType t3, valueType x2, timeType t2, valueType x1, timeType t1, timeType t) |
quadratic interpolation, but with timestamped value More... | |
static valueType | predict (int n, valueType *xs, timeType *ts=0, timeType t=timeType(0)) |
generic interpolation function abstracting from number of mesh points availability of timestamps More... | |
class for linear and quadatic extrapolation
The Extrapolator class is designed as template and abstracts from the type of the values as well as from the type that is used to indicate time stamps for values.
The template is explicitly intantiated for value type icl32f and the time types long int, int and icl32f
|
static |
extrapolates the next value (time t) using linear interpolation
The time series is x_2(t-2),x_1(t-1),result(t) \; with \; dt=1
x2 | first value at time t-2 |
x1 | second value at time t-1 |
|
static |
extrapolates the next value using quadratic interpolation
The time series is x3@t-3 x2@t-2 x1@t-1 result@t with dt=1
x3 | second value at time t-3 |
x2 | first value at time t-2 |
x1 | second value at time t-1 |
|
static |
linear interpolation, but with timestamped value
The time series is ... x2(t2) x1(t1) result(t)
x2 | third value at time t2 |
t2 | time stamp for value x2 |
x1 | third value at time t1 |
t1 | time stamp for value x1 |
t | time stamp for the returned value |
|
static |
quadratic interpolation, but with timestamped value
The time series is ... x3(t3) x2(t2) x1(t1) result(t)
x3 | third value at time t3 |
t3 | time stamp for value x3 |
x2 | third value at time t2 |
t2 | time stamp for value x2 |
x1 | third value at time t1 |
t1 | time stamp for value x1 |
t | time stamp for the returned value |
|
static |
generic interpolation function abstracting from number of mesh points availability of timestamps
In valueTypetime environments, not every time 3 mesh points for the extrapolation are available. To avoid the necessity of switching between the cases of a different mesh point counts, this function provides a generic interface.
Please considere, that n must be one of {1,2,3} and t must not be 0 if ts is given
If n is 1, the prediction returns the current value *xs.
If n is 2, the prediction returns the first order extrapolated next value:
dt1 = t1 - t2 for ts=NULL: return x1 + x1 - p2 dt0 = t - t1 v1 = (x1-x2)/dt1 return x1 + dt0*v1
If n is 3, the prediction returns the second order extraploated next value:
dt2 = t2 - t3 for ts=NULL: v1 = p1-p2 dt1 = t1 - t2 a = v1-( p2-p3 ) dt0 = t - t1 return p1 + v1 + a/2.0 v2 = (x2-x3)/dt2 v1 = (x1-x2)/dt1 a = (v1-v2)/((dt1+dt2)/2) return x1 + dt0*v1 + (dt0*dt0)/2.0 * a