38 unsigned int resC[]={ 1 , 3 , 6 ,10 ,15 ,21 ,28 ,36 ,45 ,55};
40 std::vector<unsigned int> res;
42 std::vector<unsigned int> res2;
44 std::equal(res2.begin(),res2.end(),resC);
47 unit_assert(std::equal(res.begin(),res.end(),resC));
52 unsigned int resC[]={1,2,6,24,120,720,5040,40320,362880,3628800};
54 std::vector<unsigned int> res;
56 std::vector<unsigned int> res2;
58 unit_assert(std::equal(res2.begin(),res2.end(),resC));
63 unsigned int data[] ={ 3 ,2 ,1 ,2 ,1 ,0 ,4 ,3 ,2};
64 unsigned int resC[]={3 , 2 , 1 , 1 , 1 , 0 , 0 , 0 , 0};
66 std::vector<unsigned int> res;
67 res.assign(data, data + 9);
68 std::vector<unsigned int> res2;
70 unit_assert(std::equal(res2.begin(),res2.end(),resC));
75 unsigned int data[] ={ 3 ,2 ,1 ,2 ,1 ,0 ,4 ,3 ,2};
76 unsigned int resC[]={ 3, 3, 3, 3, 3, 3, 4, 4, 4};
77 std::vector<unsigned int> res;
78 res.assign(data, data + 9);
79 std::vector<unsigned int> res2;
81 unit_assert(std::equal(res2.begin(),res2.end(),resC));
85 int main(
int argc,
char **argv) {
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...
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...
void cumsum(TIterator beg, TIterator end, std::vector< T > &res)
void seq(TReal from, TReal to, std::vector< TReal > &result)
generates the sequence from, from+/-1, ..., to (identical to from:to).
int main(int argc, char **argv)
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 o...