#include <numeric>#include <algorithm>

Go to the source code of this file.
Functions | |
| template<class T , class Iter_T > | |
| T | mean (Iter_T first, Iter_T last) |
| compute the mean value of a vector | |
| double | bilinear_interpolation (const double &x, const double &y, const double &x1, const double &y1, const double &x2, const double &y2, const double &f11, const double &f12, const double &f21, const double &f22) |
| double | linear_interpolation (const double x, const double x1, const double x2, const double f1, const double f2) |
| template<class T1 , class Iter_T1 , class T2 , class Iter_T2 > | |
| void | interpolate (Iter_T1 v1_start, Iter_T1 v1_end, Iter_T2 v2_start, Iter_T2 v2_end, T1 &val1, T2 &val2) |
| linear interpolation the val1 value This method supports either classic C arrays and STL's vector | |
| template<class Iter_T1 , class Iter_T2 > | |
| void | interpolate (Iter_T1 v1_start, Iter_T1 v1_end, Iter_T2 v2_start, Iter_T2 v2_end, Iter_T1 vin_start, Iter_T1 vin_end, Iter_T2 vout_start) |
| linear interpolation of the values of a vector. This method supports either classic C arrays and STL's vector | |
| template<typename NumType > | |
| long | get_nearest_val_idx (const NumType *v_start, const NumType *v_end, const NumType &val) |
| search the value that is the nearest to val in a sorted vector If val is situed exactly between 2 values, the upper index is returned | |
contain some statistics computing methods
| double bilinear_interpolation | ( | const double & | x, | |
| const double & | y, | |||
| const double & | x1, | |||
| const double & | y1, | |||
| const double & | x2, | |||
| const double & | y2, | |||
| const double & | f11, | |||
| const double & | f12, | |||
| const double & | f21, | |||
| const double & | f22 | |||
| ) | [inline] |
Make a generic bilinear interpolation
| x | ||
| y | ||
| x1 | ||
| x2 | ||
| y1 | ||
| y2 | ||
| f11 | f(x1,y1) | |
| f12 | f(x1,y2) | |
| f21 | f(x2,y1) | |
| f22 | f(x2,y2) |
| long get_nearest_val_idx | ( | const NumType * | v_start, | |
| const NumType * | v_end, | |||
| const NumType & | val | |||
| ) |
search the value that is the nearest to val in a sorted vector If val is situed exactly between 2 values, the upper index is returned
| v_start | vector start position (pointer or iterator) | |
| v_end | vector end position (pointer that points just after the last value to check or iterator) | |
| val | the value we are searching the nearest position |
| void interpolate | ( | Iter_T1 | v1_start, | |
| Iter_T1 | v1_end, | |||
| Iter_T2 | v2_start, | |||
| Iter_T2 | v2_end, | |||
| Iter_T1 | vin_start, | |||
| Iter_T1 | vin_end, | |||
| Iter_T2 | vout_start | |||
| ) | [inline] |
linear interpolation of the values of a vector. This method supports either classic C arrays and STL's vector
| v1_start | start of input abscissa values. Must be sorted either in ascending or descending order | |
| v1_end | end of input abscissa values | |
| v2_start | start of output abscissa values | |
| v2_end | end of output abscissa values | |
| vin_start | start of the input data to interpolate | |
| vin_end | end of the input data to interpolate | |
| vout_start | start of the interpolated output data |
References interpolate().
| void interpolate | ( | Iter_T1 | v1_start, | |
| Iter_T1 | v1_end, | |||
| Iter_T2 | v2_start, | |||
| Iter_T2 | v2_end, | |||
| T1 & | val1, | |||
| T2 & | val2 | |||
| ) | [inline] |
linear interpolation the val1 value This method supports either classic C arrays and STL's vector
| v1 | the input abscissa values. Must be sorted either in ascending or descending order. Doesn't support STL vectors | |
| v2 | the output abscissa values | |
| val1 | the input value (in v1 coordinates) | |
| val2 | the value interpolated in v2 corresponding to val1 |
References linear_interpolation().
Referenced by interpolate().
| double linear_interpolation | ( | const double | x, | |
| const double | x1, | |||
| const double | x2, | |||
| const double | f1, | |||
| const double | f2 | |||
| ) | [inline] |
Make a generic linear interpolation
| x | ||
| x1 | ||
| x2 | ||
| f1 | f(x1) | |
| f2 | f(x2) |
Referenced by MODISFileData::get_5_to_1km_index(), and interpolate().
| T mean | ( | Iter_T | first, | |
| Iter_T | last | |||
| ) | [inline] |
compute the mean value of a vector
| first | the first element of the vector to consider | |
| last | the last one |
1.7.1