cumulate (original) (raw)
Doug Lea dl at cs.oswego.edu
Fri Dec 21 15:58:27 PST 2012
- Previous message: cumulate
- Next message: cumulate
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12/21/12 16:31, Brian Goetz wrote:
In Arrays: void parallelPrefix(T[], int offset, int length, BinaryOperator); void parallelPrefix(int[], int offset, int length, IntBinaryOperator); void parallelPrefix(long[], int offset, int length, LongBinaryOperator); void parallelPrefix(double[], int offset, int length, DoubleBinaryOperator);
The reason I initially suggested a name other than "parallelPrefix" is that the term is used with either of two subtly different variations; one computing (in place) the cumulation up to but not including each element, and the other including the element. Given the parameterization, our version can only be the latter. (Otherwise it would require an identity base and return total.) So I'm OK with it, but still slightly nervous.
Example: [1, 2, 3, 4] -> modify in place to: v1 [0, 1, 3, 6] -> return 10 v2 [1, 3, 6, 10] -> void (our version.)
Each of the versions is a little handier than the other for some purposes. But it is easy enough to adapt any usages of one to use the other.
-Doug
- Previous message: cumulate
- Next message: cumulate
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-experts mailing list