class

Similar::Algorithms::Myers::V

Inherits Reference < Object

V contains the endpoints of the furthest reaching D-paths. For each recorded endpoint (x,y) in diagonal k, we only need to retain x because y can be computed from x - k. In other words, V is an array of integers where V[k] contains the row index of the endpoint of the furthest reaching path in diagonal k.

We can't use a traditional Vec to represent V since we use k as an index and it can take on negative values. So instead V is represented as a light-weight wrapper around a Vec plus an offset which is the maximum value k can take on in order to map negative k's back to a value >= 0.

Constructors

new(max_d : Int32)
Source

Instance methods

[](k : Int32) : Int32
Source
[]=(k : Int32, value : Int32) : Nil
Source
size
Source