Skip to content

Instantly share code, notes, and snippets.

@seiflotfy
Last active March 17, 2018 14:16
Show Gist options
  • Save seiflotfy/5d9b09d040d1597f5c7249a21a146c90 to your computer and use it in GitHub Desktop.
Save seiflotfy/5d9b09d040d1597f5c7249a21a146c90 to your computer and use it in GitHub Desktop.
tlc := New()
llb := NewBeta()
// Make sure tlc is not using sparse
tlc.sparse = false
tlc.toNormal()
// lets rebase 10 times
for n := uint8(1); n <= 3; n++ {
// make sure we increment all the registers by 1 this iterations (to guarantee a rebase after the loop is done)
for i := uint32(0); i < tlc.m; i++ {
llb.insert(i, n)
tlc.insert(i, n)
}
// trigger a rebase, make sure we reinsert in the same positions
for j := uint8(n); j > 0; j-- {
fmt.Println(">>> inserting val", 32+j, "in register", uint32(j))
tlc.insert(uint32(j), 32+j)
llb.insert(uint32(j), 32+j)
}
fmt.Println("iteration", n,
"\ntailcut base: ", tlc.b, "\ntailcut est:",tlc.Estimate(),
"\nloglogbeta est:", llb.Estimate(), "\n")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment