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
19552f74
Commit
19552f74
authored
May 14, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
563f3e5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
30 deletions
+42
-30
wcfs/δbtail.go
wcfs/δbtail.go
+42
-30
No files found.
wcfs/δbtail.go
View file @
19552f74
...
...
@@ -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\n
DifferenceInplace:
\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\n
DifferenceInplace:
\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\n
UnionInplace:
\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\n
UnionInplace:
\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\n
ApplyΔ
\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\n
ApplyΔ
\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
()
...
...
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