Does not inherit
Prototypes | Header File(s) | |
template <class T> | ||
RWMathVec<T> | cumsum(const RWMathVec<T>&) | <rw/math/mathvec.h> |
Takes a vector x and returns a vector y of values corresponding to the cumulative sum of x:
#include <rw/math/mathvec.h> #include <rw/rstream.h> double adata[] = {1.2, 2.4, -1.2, 0.8, 4.5 }; int main() { RWMathVec<double> a(adata, 5); RWMathVec<double> b = cumsum(a); cout << b; }
Program Output:
[ 1.2 3.6 2.4 3.2 7.7]
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.