1. A method for generating a result vector with summed values from a first input vector, comprising: receiving the first input vector, a second input vector, and a control vector, and optionally receiving a predicate vector, wherein each vector includes N elements; recording a value from an element at a key element position in the second input vector into a base value; and generating the result vector, wherein generating the result vector involves, if the predicate vector is received, for each element in the result vector to the right of the key element position for which a corresponding element in the predicate vector contains a non-zero value, otherwise, for each element in the result vector to the right of the key element position, setting the element in the result vector equal to a sum of the base value and a value in each relevant element of the first input vector, from an element at the key element position to and including a predetermined element in the first input vector.