Commit 19552f74 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 563f3e5e
......@@ -375,14 +375,18 @@ func (tidx trackIndex) verify() {
}
}
const debugPPSet = false
// DifferenceInplace sets A = PP(A.leafs \ B.leafs)
//
// In other words it removes B nodes from A while still maintaining A as P-connected.
func (A trackIndex) DifferenceInplace(B trackIndex) {
fmt.Printf("\n\nDifferenceInplace:\n")
fmt.Printf(" A: %s\n", A)
fmt.Printf(" B: %s\n", B)
defer fmt.Printf("->D: %s\n", A)
if debugPPSet {
fmt.Printf("\n\nDifferenceInplace:\n")
fmt.Printf(" A: %s\n", A)
fmt.Printf(" B: %s\n", B)
defer fmt.Printf("->D: %s\n", A)
}
A.verify()
B.verify()
......@@ -395,14 +399,16 @@ func (A trackIndex) DifferenceInplace(B trackIndex) {
//func (A trackIndex) xDifferenceInplace(B trackIndex, δnchild map[zodb.Oid]int) {
func (A trackIndex) xDifferenceInplace(B trackIndex) {
fmt.Printf("\n\n xDifferenceInplace:\n")
fmt.Printf(" a: %s\n", A)
fmt.Printf(" b: %s\n", B)
// fmt.Printf(" δ: %v\n", δnchild)
defer func() {
fmt.Printf(" ->d: %s\n", A)
// fmt.Printf(" ->δ: %v\n", δnchild)
}()
if debugPPSet {
fmt.Printf("\n\n xDifferenceInplace:\n")
fmt.Printf(" a: %s\n", A)
fmt.Printf(" b: %s\n", B)
// fmt.Printf(" δ: %v\n", δnchild)
defer func() {
fmt.Printf(" ->d: %s\n", A)
// fmt.Printf(" ->δ: %v\n", δnchild)
}()
}
δnchild := map[zodb.Oid]int{}
......@@ -437,14 +443,16 @@ func (A trackIndex) xDifferenceInplace(B trackIndex) {
//func (A trackIndex) xUnionInplace(B trackIndex, δnchild map[zodb.Oid]int) {
func (A trackIndex) xUnionInplace(B trackIndex) {
fmt.Printf("\n\n xUnionInplace:\n")
fmt.Printf(" a: %s\n", A)
fmt.Printf(" b: %s\n", B)
// fmt.Printf(" δ: %v\n", δnchild)
defer func() {
fmt.Printf(" ->u: %s\n", A)
// fmt.Printf(" ->δ: %v\n", δnchild)
}()
if debugPPSet {
fmt.Printf("\n\n xUnionInplace:\n")
fmt.Printf(" a: %s\n", A)
fmt.Printf(" b: %s\n", B)
// fmt.Printf(" δ: %v\n", δnchild)
defer func() {
fmt.Printf(" ->u: %s\n", A)
// fmt.Printf(" ->δ: %v\n", δnchild)
}()
}
δnchild := map[zodb.Oid]int{}
......@@ -494,10 +502,12 @@ func (A trackIndex) fixup(δnchild map[zodb.Oid]int) {
//
// In other words it adds B nodes to A.
func (A trackIndex) UnionInplace(B trackIndex) {
fmt.Printf("\n\nUnionInplace:\n")
fmt.Printf(" A: %s\n", A)
fmt.Printf(" B: %s\n", B)
defer fmt.Printf("->U: %s\n", A)
if debugPPSet {
fmt.Printf("\n\nUnionInplace:\n")
fmt.Printf(" A: %s\n", A)
fmt.Printf(" B: %s\n", B)
defer fmt.Printf("->U: %s\n", A)
}
A.verify()
B.verify()
......@@ -536,12 +546,14 @@ func (A trackIndex) UnionInplace(B trackIndex) {
// ApplyΔ applies δ to trackIdx. XXX
func (tidx trackIndex) ApplyΔ(δ *δtrackIndex) {
fmt.Printf("\n\nApplyΔ\n")
fmt.Printf(" A: %s\n", tidx)
fmt.Printf(" -: %s\n", δ.Del)
fmt.Printf(" +: %s\n", δ.Add)
fmt.Printf(" x: %v\n", δ.δnchildNonLeafs)
defer fmt.Printf("\n->B: %s\n", tidx)
if debugPPSet {
fmt.Printf("\n\nApplyΔ\n")
fmt.Printf(" A: %s\n", tidx)
fmt.Printf(" -: %s\n", δ.Del)
fmt.Printf(" +: %s\n", δ.Add)
fmt.Printf(" x: %v\n", δ.δnchildNonLeafs)
defer fmt.Printf("\n->B: %s\n", tidx)
}
tidx.verify()
δ.Del.verify()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment