|
| template<typename TIterator , typename T > |
| void | cumsum (TIterator beg, TIterator end, std::vector< T > &res) |
| |
| template<typename TIterator > |
| TIterator | cumsum (TIterator beg, TIterator end) |
| |
| template<typename T > |
| void | cumprod (std::vector< T > &x, std::vector< T > &res) |
| | Returns a vector whose elements are the cumulative products of the elements of the argument. More...
|
| |
| template<typename T > |
| void | cummax (std::vector< T > &x, std::vector< T > &res) |
| | Returns a vector whose elements are the cumulative maximum of the elements of the argument. More...
|
| |
| template<typename T > |
| void | cummin (std::vector< T > &x, std::vector< T > &res) |
| | Returns a vector whose elements are the cumulative sums, products, minima or maxima of the elements of the argument. More...
|
| |
template<typename TIterator , typename T >
| void ralab::base::cumsum |
( |
TIterator |
beg, |
|
|
TIterator |
end, |
|
|
std::vector< T > & |
res |
|
) |
| |
CUMSUM Returns a vector whose elements are the cumulative sums, products, minima or maxima of the elements of the argument.
- Parameters
-
| [in] | beg | vector of values of type T |
| [out] | res | cumulative sum |
Definition at line 40 of file cumsum.hpp.
49 typename std::vector<T>::iterator begRes = res.begin();
50 typename std::vector<T>::iterator begResDelayed = begRes;
53 typename std::vector<T>::iterator begEnd = res.end();
54 for( ;begRes != begEnd ; ++begRes, ++begResDelayed)
56 *begRes += *(begResDelayed) ;