Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
ds2-notes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
datovky
ds2-notes
Commits
d003e0a3
Commit
d003e0a3
authored
3 years ago
by
Filip Stedronsky
Browse files
Options
Downloads
Patches
Plain Diff
Succinct: finalize 1st version
parent
9abd703e
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
fs-succinct/mixer_chain.asy
+1
-1
1 addition, 1 deletion
fs-succinct/mixer_chain.asy
fs-succinct/succinct.tex
+44
-4
44 additions, 4 deletions
fs-succinct/succinct.tex
fs-succinct/tree_shapes.asy
+4
-1
4 additions, 1 deletion
fs-succinct/tree_shapes.asy
with
49 additions
and
6 deletions
fs-succinct/mixer_chain.asy
+
1
−
1
View file @
d003e0a3
...
...
@@ -24,4 +24,4 @@ for (int i = 1; i < nmixers; ++i) {
pair endb = (mixgrid * (nmixers-1), 0) + (0.5,0);
draw(endb -- endb + (0.5,0) {E} .. {S} endb + (1.5,-1) -- endb + (1.5,-1.25), e_arrow);
label(endb + (1.5,-1.25), "$2^{M_
*
}$", S);
label(endb + (1.5,-1.25), "$2^{M_
{n+1}
}$", S);
This diff is collapsed.
Click to expand it.
fs-succinct/succinct.tex
+
44
−
4
View file @
d003e0a3
...
...
@@ -420,10 +420,50 @@ for possibly the last and in the last level all the vertices in one contiguous s
starting at the very left.
Now let us consider a level at height
$
h
$
(from the bottom). There are at most three
subtree types at that level: full subtrees of height
$
h
$
, full subtrees of height
$
h
-
1
$
and one irregular subtree in the middle (unless the whole tree is full; then there would
be only one kind of subtree). See fig.
\figref
{
tree
_
shapes
}
.
three vertex types by subtree shape and they appear on the level in a specific order:
\tightlist
{
n.
}
\:
a contiguous segment of vertices with full subtrees of height
$
h
$
(type A)
\:
one vertex with an irregular subtree (type B)
\:
a contiguous segment of vertices with full subtrees of height
$
h
-
1
$
(type C)
\endlist
See fig.
\figref
{
tree
_
shapes
}
. If the last level happens to be full, there are only
type-A vertices.
\figure
[tree_shapes]
{
tree
_
shapes.pdf
}{}{
Vertex types by subtree shape
}
Thus, for each level and each vertex type, it is sufficient to remember:
\tightlist
{
o
}
\:
Number of vertices of this type on this level. From this, we can easily determine
vertex type from its index by simple comparison.
\:
Mixer parameters.
\:
Starting address of the output of first vertex of this type in the output stream.
From this, we can easily compute starting address of any vertex by simple addition
and multiplication as all vertices of a given type on a given level have the same
number of output bits (parameter
$
M
$
). This will be useful for local decoding.
\endlist
This a precomputed table of
$
\O
(
\log
n
)
$
words.
\figure
[tree_shapes]
{
tree
_
shapes.pdf
}{}{
Tree and subtree shapes
}
Block size and redundancy computation is exactly the same as in the chain case and
we still get
$
\O
(
1
)
$
redundancy. The chain can be thought of as a degenerate case
of the tree construction where the tree has the shape of a path (and thus all subtrees
have distinct shapes and distinct mixer parameters).
Local decoding of
$
i
$
-th input block could be done as follows:
\tightlist
{
o
}
\:
Convert block index into a position in the tree (level + index on level)
\:
Determine the vertex type and mixer parameters, compute position in output stream and extract the
corresponding output
$
m
\in
2
^
M
$
\:
Do the same for the parent vertex
\:
Using the parent mixer, decode the carry going up from our vertex
\:
Using our mixer, decode the original input block from our output and carry
\endlist
Local modification can be done in a similar fashion the other way around. Both take
$
\O
(
1
)
$
time on RAM.
\theorem
{
On a Word-RAM, we can represent a string
$
A
\in
[
\Sigma
]
^
n
$
in space
$
\lceil
n
\log
\Sigma
\rceil
+
\O
(
1
)
$
bits,
with random-access element read and write operations in
$
\O
(
1
)
$
time, using a precomputed table of
$
\O
(
\log
n
)
$
constants dependent on
$
n
$
and
$
\Sigma
$
.
}
\endchapter
This diff is collapsed.
Click to expand it.
fs-succinct/tree_shapes.asy
+
4
−
1
View file @
d003e0a3
...
...
@@ -8,11 +8,14 @@ draw((3.2,-3.5)--(3.2,-2), Arrows);
label((3.2, -2.75), "$h-1$", E);
void subtree(path p) {
filldraw(p, 0.5*white);
filldraw(p, 0.
6
5*white);
}
subtree((-1.75, -4)--(-0.75,-4)--(-1.25,-2)--cycle);
subtree((-0.5, -4)--(0,-4)--(0,-3.5)--(0.5,-3.5)--(0,-2)--cycle);
subtree((1.75, -3.5)--(0.75,-3.5)--(1.25,-2)--cycle);
label((-1.25, -3), "A");
label((-0, -3), "B");
label((1.25, -3), "C");
draw((-3, -4) -- (0,-4) -- (0,-3.5) -- (3,-3.5) -- (0, 0) -- cycle, halfthick);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment