Inclusive versus exclusive prefix

Let's stop for a moment and make a very subtle, but very important distinction. So far, we have been concerned with taking inputs of the form  , and as output producing an array of sums of the form . Prefix algorithms that produce output as such are called inclusive; in the case of an inclusive prefix algorithm, the corresponding element at each index is included in the summation in the same index of the output array. This is in contrast to prefix algorithms that are exclusive. An exclusive prefix algorithm differs in that it similarly takes n input values of the form  and produces the length-n output array 

This is important because some efficient variations of the prefix algorithm are exclusive by their nature. We'll see an example of one in the next sub-section.

Note that the exclusive algorithm yields nearly the same output as the inclusive algorithm, only it is right-shifted and omits the final value. We can therefore trivially obtain the equivalent output from either algorithm, provided we keep a copy of .
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.160.43