Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
f0453574
Commit
f0453574
authored
Apr 29, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ed81f1bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
wcfs/δbtail.go
wcfs/δbtail.go
+3
-3
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+20
-5
No files found.
wcfs/δbtail.go
View file @
f0453574
...
...
@@ -316,9 +316,9 @@ func (tidx trackIndex) verify() {
// Update tidx with trees subsets from tidx2.
func
(
tidx
trackIndex
)
Update
(
tidx2
trackIndex
)
{
fmt
.
Printf
(
"
\n\n
Update:
\n
"
)
fmt
.
Printf
(
"tidx: %s
\n
"
,
tidx
)
fmt
.
Printf
(
"tidx2: %s
\n
"
,
tidx2
)
//
fmt.Printf("\n\nUpdate:\n")
//
fmt.Printf("tidx: %s\n", tidx)
//
fmt.Printf("tidx2: %s\n", tidx2)
tidx
.
verify
()
tidx2
.
verify
()
...
...
wcfs/δbtail_test.go
View file @
f0453574
...
...
@@ -554,7 +554,7 @@ func (kadj KAdjMatrix) Map(keys SetKey) SetKey {
for
k
:=
range
keys
{
to
,
ok
:=
kadj
[
k
]
if
!
ok
{
panicf
(
"%d ∉ kadj
\n\n
kadj: %v"
,
k
,
kadj
)
panicf
(
"
kadj.Map:
%d ∉ kadj
\n\n
kadj: %v"
,
k
,
kadj
)
}
res
.
Update
(
to
)
}
...
...
@@ -562,12 +562,27 @@ func (kadj KAdjMatrix) Map(keys SetKey) SetKey {
}
// KAdj computes adjacency matrix for t1 -> t2 transition.
//
// The set of keys for which kadj matrix is computed can be optionally provided.
// This set of keys defaults to allTestKeys(t1,t2).
//
// KAdj itself is verified by testΔBTail on entries with .kadjOK set.
func
KAdj
(
t1
,
t2
*
tTreeCommit
)
(
kadj
KAdjMatrix
)
{
func
KAdj
(
t1
,
t2
*
tTreeCommit
,
keysv
...
SetKey
)
(
kadj
KAdjMatrix
)
{
var
keys
SetKey
switch
len
(
keysv
)
{
case
0
:
keys
=
allTestKeys
(
t1
,
t2
)
case
1
:
keys
=
keysv
[
0
]
default
:
panic
(
"multiple key sets on the call"
)
}
// kadj = {} k -> adjacent keys.
// if k is tracked -> changes to adjacents must be in Update(t1->t2).
kadj
=
KAdjMatrix
{}
for
k
:=
range
allTestKeys
(
t1
,
t2
)
{
for
k
:=
range
keys
{
adj1
:=
SetKey
{}
adj2
:=
SetKey
{}
...
...
@@ -849,8 +864,8 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
_
=
d01
_
=
d12
kadj01
:=
KAdj
(
t0
,
t1
)
// FIXME for all keys from t0,t1,t2
kadj12
:=
KAdj
(
t1
,
t2
)
// FIXME for all keys from t0,t1,t2
kadj01
:=
KAdj
(
t0
,
t1
,
allTestKeys
(
t0
,
t1
,
t2
))
kadj12
:=
KAdj
(
t1
,
t2
,
allTestKeys
(
t0
,
t1
,
t2
))
_
=
kadj01
_
=
kadj12
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment