27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
Removed []Mark
}
// Diffs the provided data and returns e Delta struct
// with added entries' indices in the second sequence and removed from the first
func Diff(data Interface) Delta {
var len1, len2 = data.Len()
var mat matrix = matrix{v: bits.New(uint(len1 * len2)), lenX: len1, lenY: len2}
for i := 0; i < len1; i++ {
for j := 0; j < len2; j++ {
mat.v.Poke(mat.at(i, j), data.Equal(i, j))
}
}
|
|
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
Removed []Mark
}
// Diffs the provided data and returns e Delta struct
// with added entries' indices in the second sequence and removed from the first
func Diff(data Interface) Delta {
var len1, len2 = data.Len()
var mat matrix = matrix{v: bits.NewBit(uint(len1 * len2)), lenX: len1, lenY: len2}
for i := 0; i < len1; i++ {
for j := 0; j < len2; j++ {
mat.v.Poke(mat.at(i, j), data.Equal(i, j))
}
}
|