Ticket #35 (closed feature request: fixed)

Opened 7 years ago

Last modified 7 years ago

Inclusive scans/folds

Reported by: blever Owned by: chak
Priority: minor Milestone:
Component: Accelerate language Version:
Keywords: Cc:


The scan/fold functions defined within the Accelerate language are all of the exclusive type. That is, they all require the specification of an "identity".

In some cases it can be difficult to specify the identity value. For example, performing a fold over an array of positive Floats where the fold operator is "min" requires that the identity value be positive infinity (in the general case). In some cases, it may be possible to determine a maximum value that thee array may possibly contain. In the general case, however, a better solution would be to have no "identity" value and instead use the first array element value as the identity - that is, an inclusive fold.

Inclusive versions could be created for scanl, scanr, fold and foldSeg.

Change History

Changed 7 years ago by tmcdonell

I've been vaguely considering this as well. The current scan implementation is actually an inclusive scan at its core, and fold/seg should be easy enough to convert. This would tie into ticket:23.

Changed 7 years ago by tmcdonell

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.