FUNCTION cumsum,v ;+ ; s=CUMSUM(v) is a vector such that s[0]=v[0], s[1]=v[0]+v[1],.. ; so that s is the cumulative sum over v. If v is an array ; with multiple dimensions, then s has the same shape as v. ; ; H. Rhody ; February 1999 ;- n=N_ELEMENTS(v) s=v FOR k=1,n-1 DO s[k]=s[k-1]+v[k] RETURN,s END