summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/algorithm2e/algorithm2e_exAlgoDisjdecomp.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-12-16 00:53:28 +0000
committerKarl Berry <karl@freefriends.org>2009-12-16 00:53:28 +0000
commit5d71e79720301a8f2d96c9e573d4ff8bbc7a2b74 (patch)
tree8d6046077b39805dbc454e2e2f1f05719dbfa717 /Master/texmf-dist/doc/latex/algorithm2e/algorithm2e_exAlgoDisjdecomp.tex
parent0ab576d596d5e6b9c0a5a9b8d0b6032612c94195 (diff)
algorithm2e 4.01 (15dec09)
git-svn-id: svn://tug.org/texlive/trunk@16417 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/algorithm2e/algorithm2e_exAlgoDisjdecomp.tex')
-rw-r--r--Master/texmf-dist/doc/latex/algorithm2e/algorithm2e_exAlgoDisjdecomp.tex30
1 files changed, 30 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/algorithm2e/algorithm2e_exAlgoDisjdecomp.tex b/Master/texmf-dist/doc/latex/algorithm2e/algorithm2e_exAlgoDisjdecomp.tex
new file mode 100644
index 00000000000..abb2cc3c5e4
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/algorithm2e/algorithm2e_exAlgoDisjdecomp.tex
@@ -0,0 +1,30 @@
+\IncMargin{1em}
+\begin{algorithm}
+ \SetKwData{Left}{left}\SetKwData{This}{this}\SetKwData{Up}{up}
+ \SetKwFunction{Union}{Union}\SetKwFunction{FindCompress}{FindCompress}
+ \SetKwInOut{Input}{input}\SetKwInOut{Output}{output}
+
+ \Input{A bitmap $Im$ of size $w\times l$}
+ \Output{A partition of the bitmap}
+ \BlankLine
+ \emph{special treatment of the first line}\;
+ \For{$i\leftarrow 2$ \KwTo $l$}{
+ \emph{special treatment of the first element of line $i$}\;
+ \For{$j\leftarrow 2$ \KwTo $w$}{\label{forins}
+ \Left$\leftarrow$ \FindCompress{$Im[i,j-1]$}\;
+ \Up$\leftarrow$ \FindCompress{$Im[i-1,]$}\;
+ \This$\leftarrow$ \FindCompress{$Im[i,j]$}\;
+ \If(\tcp*[h]{O(\Left,\This)==1}){\Left compatible with \This}{\label{lt}
+ \lIf{\Left $<$ \This}{\Union{\Left,\This}}\;
+ \lElse{\Union{\This,\Left}\;}
+ }
+ \If(\tcp*[f]{O(\Up,\This)==1}){\Up compatible with \This}{\label{ut}
+ \lIf{\Up $<$ \This}{\Union{\Up,\This}}\;
+ \tcp{\This is put under \Up to keep tree as flat as possible}\label{cmt}
+ \lElse{\Union{\This,\Up}}\tcp*[r]{\This linked to \Up}\label{lelse}
+ }
+ }
+ \lForEach{element $e$ of the line $i$}{\FindCompress{p}}
+ }
+ \caption{disjoint decomposition}\label{algo_disjdecomp}
+\end{algorithm}\DecMargin{1em} \ No newline at end of file