File: disstrees.sty

package info (click to toggle)
genomethreader 1.7.3%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 46,528 kB
  • sloc: ansic: 90,168; ruby: 1,769; makefile: 548; sh: 112; perl: 105
file content (181 lines) | stat: -rw-r--r-- 6,141 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
%Stefan Kurtz, 1995
\newcommand{\Scriptstyle}[1]{${\scriptstyle #1}$}
\def\cacTree{
   \put(0,0){\circle{3}}%
   \put(0,-1){\vector(0,-1){16}}%
   \put(-2,-8){\makebox(0,0)[r]{\Scriptstyle{c}}}%
   \put(0,-18){\circle{3}}%
   \put(0,-19){\vector(0,-1){16}}%
   \put(-2,-26){\makebox(0,0)[r]{\Scriptstyle{a}}}%
   \put(0,-36){\circle{3}}%
   \put(0,-37){\vector(0,-1){16}}%
   \put(-2,-44){\makebox(0,0)[r]{\Scriptstyle{c}}}%
   \put(0,-54){\circle{3}}%
}
\def\cabcacTree{
   \put(0,0){\circle{3}}%
   \put(0,-1){\vector(0,-1){16}}%
   \put(-2,-8){\makebox(0,0)[r]{\Scriptstyle{c}}}%
   \put(0,-18){\circle{3}}%
   \put(0,-19){\vector(0,-1){16}}%
   \put(-2,-26){\makebox(0,0)[r]{\Scriptstyle{a}}}%
   \put(0,-36){\circle{3}}%
   \put(0,-37){\vector(0,-1){16}}%
   \put(-2,-44){\makebox(0,0)[r]{\Scriptstyle{b}}}%
   \put(0,-54){\cacTree}%
}
\def\bcabcacTree{
   \put(0,0){\circle{3}}%
   \put(0,-1){\vector(0,-1){16}}%
   \put(-2,-8){\makebox(0,0)[r]{\Scriptstyle{b}}}%
   \put(0,-18){\cabcacTree}%
}
\newcommand{\LeftEdge}[2]{
  \put(0,0){\circle{3}}
  \put(-1,-1){\vector(-1,-1){30}}
  \put(-16,-12){\makebox(0,0)[r]{\Scriptstyle{#1}}}%
  \put(-32,-32){#2}
}
\newcommand{\RightEdge}[2]{
  \put(0,0){\circle{3}}
  \put(1,-1){\vector(1,-1){30}}
  \put(16,-12){\makebox(0,0)[l]{\Scriptstyle{#1}}}%
  \put(32,-32){#2}
}
\newcommand{\Leaf}[2][]{
  \put(0,0){\circle#1{3}}%
  \put(1,-3){\makebox(0,0)[l]{\Scriptstyle{#2}}}%
}
\newcommand{\True}{
  \put(0,0){\circle*{3}}%
}
\newcommand{\UnTree}[4][]{
  \put(0,0){\circle#1{3}}
  \put(0,-1){\vector(0,-1){#2}}
  \count1=#2
  \divide\count1 by 2
  \multiply\count1 by -1
  \put(-2,\count1){\makebox(0,0)[r]{\Scriptstyle{#3}}}%
  \count1=#2
  \advance\count1 by 2
  \multiply\count1 by -1
  \put(0,\count1){#4}
}
\newcommand{\UnTreeWithLabel}[4]{
  \put(0,0){\circle{3}}
  \put(0,-1){\vector(0,-1){#1}}
  \count1=#1
  \divide\count1 by 2
  \multiply\count1 by -1
  \put(-2,\count1){\makebox(0,0)[r]{\Scriptstyle{#2}}}%
  \count1=#1
  \advance\count1 by 2
  \multiply\count1 by -1
  \put(0,\count1){#3}
  \put(1,2){\makebox(0,0)[l]{\Scriptstyle{#4}}}
}

\newcommand{\BinTree}[8]{
  \put(0,0){\circle#8{3}}
  \count1=#1
  \count2=#2
  \put(1,-1){\vector(\count1,-1){\count2}}
  \multiply\count1 by -1
  \put(-1,-1){\vector(\count1,-1){\count2}}
  \put(1,2){\makebox(0,0)[l]{\Scriptstyle{#3}}}
  \count2=#2
  \divide\count2 by 2
  \multiply\count2 by -1
  \put(\count2,-12){\makebox(0,0)[r]{\Scriptstyle{#4}}}%
  \count2=#2
  \advance\count2 by 2
  \multiply\count2 by -1
  \put(\count2,-32){#5}
  \count2=#2
  \divide\count2 by 2
  \put(\count2,-12){\makebox(0,0)[l]{\Scriptstyle{#6}}}%
  \count2=#2
  \advance\count2 by 2
  \put(\count2,-32){#7}
}

\newcommand{\SmallBinTree}[6][]{\BinTree{1}{30}{#2}{#3}{#4}{#5}{#6}{#1}}
\newcommand{\MedBinTree}[6][]{\BinTree{2}{60}{#2}{#3}{#4}{#5}{#6}{#1}}
\newcommand{\BigBinTree}[6][]{\BinTree{3}{90}{#2}{#3}{#4}{#5}{#6}{#1}}
\newcommand{\HugeBinTree}[6][]{\BinTree{4}{120}{#2}{#3}{#4}{#5}{#6}{#1}}

\newcommand{\SmallTernary}[9][]{\BinTree{1}{30}{#2}{#3}{#4}{#8}{#9}{#1}\UnTree{#5}{#6}{#7}}
\newcommand{\BigTernary}[9][]{\BinTree{2}{60}{#2}{#3}{#4}{#8}{#9}{#1}\UnTree{#5}{#6}{#7}}
\newcommand{\MedTernary}[9][]{\BinTree{3}{90}{#2}{#3}{#4}{#8}{#9}{#1}\UnTree{#5}{#6}{#7}}
\newcommand{\HugeTernary}[9][]{\BinTree{4}{120}{#2}{#3}{#4}{#8}{#9}{#1}\UnTree{#5}{#6}{#7}}
\newcommand{\SuperHugeTernary}[9][]{\BinTree{4}{180}{#2}{#3}{#4}{#8}{#9}{#1}\UnTree{#5}{#6}{#7}}

\newcommand{\Sentinel}[0]{\mathtt{\symbol{36}}}
\newcommand{\Shownode}[3]{\fbox{${\scriptscriptstyle #1}$\footnotesize -${\scriptscriptstyle [#2..#3]}$}}
\newcommand{\PutShownode}[3]{\Leaf{\put(-22,-27){\Shownode{#1}{#2}{#3}}}}
\newcommand{\Subbintree}[5]{\SmallBinTree{#5}{#1}{\Leaf{#3}}{#2}{\Leaf{#4}}}
\newcommand{\Ternsubtree}[3]{\put(0,-22){\MedTernary{}{}{#1}{30}{}{#2}{}{#3}\put(-21,9){\Shownode{1}{0}{5}}}}
\newcommand{\Treetoa}[9]{%
\put(0,-15){\MedTernary{\put(-10,0){#7}}%
            {a}{\Subbintree{ac..\Sentinel}{ca..\Sentinel}{#1}{#2}{#8}}%
            {30}{ca}{\Subbintree{aa..\Sentinel}{ta..\Sentinel}{#3}{#4}{#9}}%
            {t}{\Subbintree{aa\Sentinel}{\Sentinel}{#5}{#6}{#8}}}}

\newcommand{\Suffixtreeacaaacatat}[0]{%
%\fbox{
\begin{picture}(535,120)(0,0)%
\put(270,68){%
\put(51,45){\vector(1,0){180}}%
\put(232,45){\Leaf{}}%
\put(142,47){\Scriptstyle{\Sentinel}}%
\put(50,45){\SuperHugeTernary{}{a}{\Treetoa{}{}{}{}{}{}{}{}{}}{45}{ca}{\Subbintree{aa..\Sentinel}{}{ta..\Sentinel}{}}{t}{\put(0,-15){\Subbintree{at\Sentinel}{\Sentinel}{}{}{}}}}}%
\end{picture}%
%}
}

\newcommand{\Suffixtreeacaaacatatwithpositions}[0]{%
%\fbox{
\begin{picture}(535,120)(0,0)%
\put(270,68){%
\put(51,45){\vector(1,0){180}}%
\put(232,45){\Leaf{10}}%
\put(142,47){\Scriptstyle{\Sentinel}}%
\put(50,45){\SuperHugeTernary{}{a}{\Treetoa{2}{3}{0}{4}{6}{8}{}{}{}}{45}{ca}{\Subbintree{aa..\Sentinel}{ta..\Sentinel}{1}{5}{}}{t}{\put(0,-15){\Subbintree{at\Sentinel}{\Sentinel}{7}{9}{}}}}}%
\end{picture}%
%}
}

\newcommand{\Suffixtreeacaaacatatwithpositionsandlcps}[0]{%
%\fbox{
\begin{picture}(535,120)(0,0)%
\put(270,68){%
\put(51,45){\vector(1,0){180}}%
\put(232,45){\Leaf{10}}%
\put(142,47){\Scriptstyle{\Sentinel}}%
\put(50,45){\SuperHugeTernary{}{a}{\Treetoa{2}{3}{0}{4}{6}{8}{1}{\mbox{2}}{\mbox{3}}}{45}{ca}{\Subbintree{aa..\Sentinel}{ta..\Sentinel}{1}{5}{\mbox{2}}}{t}{\put(0,-15){\Subbintree{at\Sentinel}{\Sentinel}{7}{9}{\mbox{1}}}}}}%
\end{picture}%
%}
}

\newcommand{\Lcpintervaltreeacaaacatat}[0]{
%\fbox{
\begin{picture}(320,125)(15,-60)%
\put(220,45){\put(-22,9){\Shownode{0}{0}{10}}\MedTernary{}{}{\Leaf{}\Ternsubtree{\PutShownode{2}{0}{1}}{\PutShownode{3}{2}{3}}{\PutShownode{2}{4}{5}}}{30}{}{\PutShownode{2}{6}{7}}{}{\PutShownode{1}{8}{9}}}%
\end{picture}%
%}
}

%Example:

%\documentclass[12pt]{article}
%\usepackage{disstrees}
%\begin{document}
%\begin{center}
%\begin{picture}(200,75)(-80,-65)
%\HugeBinTree{(T,T)}{\$}{\Leaf{(F,F)}}
%              {c}{\MedBinTree{(T,T)}{\$}{\Leaf{(F,F)}}{c\$}{\Leaf{(F,F)}}}
%\UnTree{15}{a}{\SmallBinTree{(F,F)}{acc\$}{\Leaf{(F,F)}}{cc\$}{\Leaf{(F,F)}}}
%\put(122,-32){\UnTree{34}{aacc\$}{\Leaf{(T,F)}}}
%\end{picture}
%\end{center}
%\end{document}