title: How to calculate the cumulative sum for a vector of doubles in C++?
body: <p>I have a vector of doubles and I need to create another array which is a cumulative sum of the elements of the first. For example; </p>
  
  <pre><code> vector&lt;double&gt; Array(10,1);
   vector&lt;double&gt; Sum(10);  
  
   Sum[0] = Array[0]; 
   for(unsigned int i=1; i&lt;Array.size(); i++)
       Sum[i] = Sum[i-1] + Array[i]; 
  </code></pre>
  
  <p>Is there an in-built function that will perform the above cumulative sum? </p>