Cumulate

Revision as of 07:34, 7 August 2008 by Lchrisman (talk | contribs) (Added recumulate example, from Brian Parsonnet)


Returns an array with each element being the sum of all of the elements of X along dimension I up to, and including, the corresponding element of X.

Declaration

Cumulate(X:Array[I] ; I : Index)

Library

Array Functions

Notes

Recumulate

A useful variation is the Recumulate function, which resets the total to zero at selected points. This usage is:

Recumulate(x,b,I)

where b is an array of booleans indexed by I, having 1 at each point where the cumulation is to be reset to zero. Recumulate is implemented as a User-Defined Function in the example Recumulate example.ana. A clever usage of this function computes the number of time steps that the system has been in the same state (see the example).

See Also

Comments
Loading comments...