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() {
...
@@ -375,14 +375,18 @@ func (tidx trackIndex) verify() {
}
}
}
}
const
debugPPSet
=
false
// DifferenceInplace sets A = PP(A.leafs \ B.leafs)
// DifferenceInplace sets A = PP(A.leafs \ B.leafs)
//
//
// In other words it removes B nodes from A while still maintaining A as P-connected.
// In other words it removes B nodes from A while still maintaining A as P-connected.
func
(
A
trackIndex
)
DifferenceInplace
(
B
trackIndex
)
{
func
(
A
trackIndex
)
DifferenceInplace
(
B
trackIndex
)
{
fmt
.
Printf
(
"
\n\n
DifferenceInplace:
\n
"
)
if
debugPPSet
{
fmt
.
Printf
(
" A: %s
\n
"
,
A
)
fmt
.
Printf
(
"
\n\n
DifferenceInplace:
\n
"
)
fmt
.
Printf
(
" B: %s
\n
"
,
B
)
fmt
.
Printf
(
" A: %s
\n
"
,
A
)
defer
fmt
.
Printf
(
"->D: %s
\n
"
,
A
)
fmt
.
Printf
(
" B: %s
\n
"
,
B
)
defer
fmt
.
Printf
(
"->D: %s
\n
"
,
A
)
}
A
.
verify
()
A
.
verify
()
B
.
verify
()
B
.
verify
()
...
@@ -395,14 +399,16 @@ func (A trackIndex) DifferenceInplace(B trackIndex) {
...
@@ -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, δnchild map[zodb.Oid]int) {
func
(
A
trackIndex
)
xDifferenceInplace
(
B
trackIndex
)
{
func
(
A
trackIndex
)
xDifferenceInplace
(
B
trackIndex
)
{
fmt
.
Printf
(
"
\n\n
xDifferenceInplace:
\n
"
)
if
debugPPSet
{
fmt
.
Printf
(
" a: %s
\n
"
,
A
)
fmt
.
Printf
(
"
\n\n
xDifferenceInplace:
\n
"
)
fmt
.
Printf
(
" b: %s
\n
"
,
B
)
fmt
.
Printf
(
" a: %s
\n
"
,
A
)
// fmt.Printf(" δ: %v\n", δnchild)
fmt
.
Printf
(
" b: %s
\n
"
,
B
)
defer
func
()
{
// fmt.Printf(" δ: %v\n", δnchild)
fmt
.
Printf
(
" ->d: %s
\n
"
,
A
)
defer
func
()
{
// fmt.Printf(" ->δ: %v\n", δnchild)
fmt
.
Printf
(
" ->d: %s
\n
"
,
A
)
}()
// fmt.Printf(" ->δ: %v\n", δnchild)
}()
}
δnchild
:=
map
[
zodb
.
Oid
]
int
{}
δnchild
:=
map
[
zodb
.
Oid
]
int
{}
...
@@ -437,14 +443,16 @@ func (A trackIndex) xDifferenceInplace(B trackIndex) {
...
@@ -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, δnchild map[zodb.Oid]int) {
func
(
A
trackIndex
)
xUnionInplace
(
B
trackIndex
)
{
func
(
A
trackIndex
)
xUnionInplace
(
B
trackIndex
)
{
fmt
.
Printf
(
"
\n\n
xUnionInplace:
\n
"
)
if
debugPPSet
{
fmt
.
Printf
(
" a: %s
\n
"
,
A
)
fmt
.
Printf
(
"
\n\n
xUnionInplace:
\n
"
)
fmt
.
Printf
(
" b: %s
\n
"
,
B
)
fmt
.
Printf
(
" a: %s
\n
"
,
A
)
// fmt.Printf(" δ: %v\n", δnchild)
fmt
.
Printf
(
" b: %s
\n
"
,
B
)
defer
func
()
{
// fmt.Printf(" δ: %v\n", δnchild)
fmt
.
Printf
(
" ->u: %s
\n
"
,
A
)
defer
func
()
{
// fmt.Printf(" ->δ: %v\n", δnchild)
fmt
.
Printf
(
" ->u: %s
\n
"
,
A
)
}()
// fmt.Printf(" ->δ: %v\n", δnchild)
}()
}
δnchild
:=
map
[
zodb
.
Oid
]
int
{}
δnchild
:=
map
[
zodb
.
Oid
]
int
{}
...
@@ -494,10 +502,12 @@ func (A trackIndex) fixup(δ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.
// In other words it adds B nodes to A.
func
(
A
trackIndex
)
UnionInplace
(
B
trackIndex
)
{
func
(
A
trackIndex
)
UnionInplace
(
B
trackIndex
)
{
fmt
.
Printf
(
"
\n\n
UnionInplace:
\n
"
)
if
debugPPSet
{
fmt
.
Printf
(
" A: %s
\n
"
,
A
)
fmt
.
Printf
(
"
\n\n
UnionInplace:
\n
"
)
fmt
.
Printf
(
" B: %s
\n
"
,
B
)
fmt
.
Printf
(
" A: %s
\n
"
,
A
)
defer
fmt
.
Printf
(
"->U: %s
\n
"
,
A
)
fmt
.
Printf
(
" B: %s
\n
"
,
B
)
defer
fmt
.
Printf
(
"->U: %s
\n
"
,
A
)
}
A
.
verify
()
A
.
verify
()
B
.
verify
()
B
.
verify
()
...
@@ -536,12 +546,14 @@ func (A trackIndex) UnionInplace(B trackIndex) {
...
@@ -536,12 +546,14 @@ func (A trackIndex) UnionInplace(B trackIndex) {
// ApplyΔ applies δ to trackIdx. XXX
// ApplyΔ applies δ to trackIdx. XXX
func
(
tidx
trackIndex
)
ApplyΔ
(
δ
*
δtrackIndex
)
{
func
(
tidx
trackIndex
)
ApplyΔ
(
δ
*
δtrackIndex
)
{
fmt
.
Printf
(
"
\n\n
ApplyΔ
\n
"
)
if
debugPPSet
{
fmt
.
Printf
(
" A: %s
\n
"
,
tidx
)
fmt
.
Printf
(
"
\n\n
ApplyΔ
\n
"
)
fmt
.
Printf
(
" -: %s
\n
"
,
δ
.
Del
)
fmt
.
Printf
(
" A: %s
\n
"
,
tidx
)
fmt
.
Printf
(
" +: %s
\n
"
,
δ
.
Add
)
fmt
.
Printf
(
" -: %s
\n
"
,
δ
.
Del
)
fmt
.
Printf
(
" x: %v
\n
"
,
δ
.
δnchildNonLeafs
)
fmt
.
Printf
(
" +: %s
\n
"
,
δ
.
Add
)
defer
fmt
.
Printf
(
"
\n
->B: %s
\n
"
,
tidx
)
fmt
.
Printf
(
" x: %v
\n
"
,
δ
.
δnchildNonLeafs
)
defer
fmt
.
Printf
(
"
\n
->B: %s
\n
"
,
tidx
)
}
tidx
.
verify
()
tidx
.
verify
()
δ
.
Del
.
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