OGS
|
Class (template) LinearIntervalInterpolation is a functional object performing an interval mapping \(f: [a,b] \to [c,d]\).
Input numeric type has to be a floating point type and must behave well under the operations addition, subtraction, multiplication and division. Let \(a, b, c, d\) objects supporting the mentioned operations. Under the condition \(a \neq b\) an instance of the class computes a value within the interval \([c, d]\), i.e., \(f: [a,b] \to [c,d]\).
Definition at line 32 of file LinearIntervalInterpolation.h.
#include <LinearIntervalInterpolation.h>
Public Member Functions | |
LinearIntervalInterpolation (NUMERIC_TYPE a, NUMERIC_TYPE b, NUMERIC_TYPE c, NUMERIC_TYPE d) | |
NUMERIC_TYPE | operator() (NUMERIC_TYPE x) const |
Private Attributes | |
NUMERIC_TYPE | m_ |
NUMERIC_TYPE | n_ |
MathLib::LinearIntervalInterpolation< NUMERIC_TYPE >::LinearIntervalInterpolation | ( | NUMERIC_TYPE | a, |
NUMERIC_TYPE | b, | ||
NUMERIC_TYPE | c, | ||
NUMERIC_TYPE | d ) |
Constructor of class template for a linear map \(y = m \cdot x + n\). Under the prerequisite \(a \neq b\) it initializes the coefficients \(m\) and \(n\) in a correct way.
a | first endpoint of the first interval |
b | second endpoint of the first interval |
c | first endpoint of the second interval |
d | second endpoint of the second interval |
Definition at line 64 of file LinearIntervalInterpolation.h.
References MathLib::LinearIntervalInterpolation< NUMERIC_TYPE >::m_, MathLib::LinearIntervalInterpolation< NUMERIC_TYPE >::n_, and OGS_FATAL.
|
inline |
Method computes the value at point \(x\) obtained by linear interpolation.
x | the point the interpolation value is searched for |
Definition at line 76 of file LinearIntervalInterpolation.h.
|
private |
the slope of the linear map
Definition at line 56 of file LinearIntervalInterpolation.h.
Referenced by MathLib::LinearIntervalInterpolation< NUMERIC_TYPE >::LinearIntervalInterpolation().
|
private |
the offset of the linear map for \(x\) equals zero
Definition at line 60 of file LinearIntervalInterpolation.h.
Referenced by MathLib::LinearIntervalInterpolation< NUMERIC_TYPE >::LinearIntervalInterpolation().