Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

We'll have more to say about these classes later but basically we have plus ("+") methods for adding Segments and Chunks, a ZERO identity element and a flatten method which takes our Chunk or Segment and converts it into a list of words.

...

and gives me confidence that my algorithm is a monoid. The above showed that Segments have left and right identity elements for "+" (in fact both Check.ZERO and Segment.ZERO work). If we wanted to, we could have additional checks for the associativity piece or for properties of Chunk.

What have we achieved? Well, now we are in a position to write some parallel versions of our algorithm. Many have a common strategy and that is to divide the input into sections. Typically the division stops once the sections reach a certain granularity of size. As a general rule, if we divide past a certain level of granularity, then the overheads associated with setting up the parallelism out weigh the parallelism gains.

...