Commit 1a4b5673 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 333da094
...@@ -957,7 +957,7 @@ func (rs rangeSplit) Get_(k Key) (rnode *nodeInRange, ok bool) { ...@@ -957,7 +957,7 @@ func (rs rangeSplit) Get_(k Key) (rnode *nodeInRange, ok bool) {
// rnode.node must be tree. // rnode.node must be tree.
// rnode.node must be already activated. // rnode.node must be already activated.
// //
// inserted children is also returned for convenience. // inserted children are returned for convenience.
func (prs *rangeSplit) Expand(rnode *nodeInRange) (children rangeSplit) { func (prs *rangeSplit) Expand(rnode *nodeInRange) (children rangeSplit) {
rs := *prs rs := *prs
i := sort.Search(len(rs), func(i int) bool { i := sort.Search(len(rs), func(i int) bool {
......
...@@ -546,6 +546,10 @@ func xzgetBlkDataAt(db *zodb.DB, zblkOid zodb.Oid, at zodb.Tid) string { ...@@ -546,6 +546,10 @@ func xzgetBlkDataAt(db *zodb.DB, zblkOid zodb.Oid, at zodb.Tid) string {
// //
// i.e. = δ(Av, Bv) for k: k ∈ U kadj(A,B)[·] // i.e. = δ(Av, Bv) for k: k ∈ U kadj(A,B)[·]
// ·∈T // ·∈T
//
// XXX adjacency matrix is symmetric: XXX KAdj verifies this at runtime
//
// kadj(A,B) == kadj(B,A)
type KAdjMatrix map[Key]SetKey type KAdjMatrix map[Key]SetKey
// Map returns kadj·keys . // Map returns kadj·keys .
...@@ -568,6 +572,17 @@ func (kadj KAdjMatrix) Map(keys SetKey) SetKey { ...@@ -568,6 +572,17 @@ func (kadj KAdjMatrix) Map(keys SetKey) SetKey {
// //
// KAdj itself is verified by testΔBTail on entries with .kadjOK set. // KAdj itself is verified by testΔBTail on entries with .kadjOK set.
func KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) { func KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
// XXX vvv verifies that KAdj(A,B) == KAdj(B,A)
kadj12 := _KAdj(t1,t2, keysv...)
kadj21 := _KAdj(t2,t1, keysv...)
if !reflect.DeepEqual(kadj12, kadj21) {
panicf("KAdj not symmetric:\nt1: %s\bt2: %s\nkadj12: %v\nkadj21: %v",
t1.tree, t2.tree, kadj12, kadj21)
}
return kadj12
}
func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
var keys SetKey var keys SetKey
switch len(keysv) { switch len(keysv) {
case 0: case 0:
......
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