biojava/biojava — pull request #203 by josemduarte (2014-11-07 10:46:00+00:00)
Title: Fixing #202

This fixes #202 by simply changing the dynamic programming array from short to int. Thus it doubles the memory usage. Ideally we should implement the [Hirschberg algorithm](http://en.wikipedia.org/wiki/Hirschberg%27s_algorithm) so that memory usage would be linear, rather than quadratic.

Anyway using the int array, we should be fine in all realistic situations... longest biological sequence to handle is ~100,000 which the int array can handle if the similarity matrix contains reasonable values.

Note that the integer overflow can happen also when aligning long sequences with short ones, which doesn't require much memory but does produce the overflow. The added test shows this.