diff options
author | Karl Berry <karl@freefriends.org> | 2019-05-12 20:23:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-05-12 20:23:02 +0000 |
commit | 22cbaf8cd711b82b3fe4b387a7e72b58409ecdbd (patch) | |
tree | 0b785b59273566c030b567add8671b7f06167054 /Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex | |
parent | 692a797099b0acfd35d4bbd6a322acdc87c2c3a8 (diff) |
pgf
git-svn-id: svn://tug.org/texlive/trunk@51107 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex | 206 |
1 files changed, 103 insertions, 103 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex index 26529cd5e37..d3b817a00f1 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex @@ -13,147 +13,147 @@ % the PGF system layer. % It employs two collect-buffers to reduce the runtime. % -% - It has preasymptotical runtime O(N), but is O(N^2) asymptotically. +% - It has pre-asymptotical runtime O(N), but is O(N^2) asymptotically. % - It requires only 5 macros per list. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Usage: +% Usage: % \pgfapplistnewempty\macro \def\pgfapplistnewempty#1{% - \expandafter\let\csname pgfapp@#1\endcsname=\pgfutil@empty - \expandafter\let\csname pgfapp@#1@smallbuf\endcsname=\pgfutil@empty - \expandafter\let\csname pgfapp@#1@bigbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#1@smallbuf@c\endcsname{0}% - \expandafter\def\csname pgfapp@#1@bigbuf@c\endcsname{0}% + \expandafter\let\csname pgfapp@#1\endcsname=\pgfutil@empty + \expandafter\let\csname pgfapp@#1@smallbuf\endcsname=\pgfutil@empty + \expandafter\let\csname pgfapp@#1@bigbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#1@smallbuf@c\endcsname{0}% + \expandafter\def\csname pgfapp@#1@bigbuf@c\endcsname{0}% }% % #1: the item to append % #2: the list as macro name \long\def\pgfapplistpushback#1\to#2{% - \begingroup - \c@pgf@counta=\csname pgfapp@#2@smallbuf@c\endcsname\relax - \advance\c@pgf@counta by1 - \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% - \endgroup - \expandafter\let\csname pgfapp@#2@smallbuf@c\endcsname=\pgf@glob@TMPa - \ifnum\csname pgfapp@#2@smallbuf@c\endcsname<40 - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% - \expandafter\edef\csname pgfapp@#2@smallbuf\endcsname{\the\t@pgf@toka}% - \else - \pgfapplistpushback@smallbufoverfl{#1}{#2}% - \fi + \begingroup + \c@pgf@counta=\csname pgfapp@#2@smallbuf@c\endcsname\relax + \advance\c@pgf@counta by1 + \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% + \endgroup + \expandafter\let\csname pgfapp@#2@smallbuf@c\endcsname=\pgf@glob@TMPa + \ifnum\csname pgfapp@#2@smallbuf@c\endcsname<40 + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% + \expandafter\edef\csname pgfapp@#2@smallbuf\endcsname{\the\t@pgf@toka}% + \else + \pgfapplistpushback@smallbufoverfl{#1}{#2}% + \fi }% \long\def\pgfapplistpushback@smallbufoverfl#1#2{% - \begingroup - \c@pgf@counta=\csname pgfapp@#2@bigbuf@c\endcsname\relax - \advance\c@pgf@counta by1 - \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% - \endgroup - \expandafter\let\csname pgfapp@#2@bigbuf@c\endcsname=\pgf@glob@TMPa - % - \ifnum\csname pgfapp@#2@bigbuf@c\endcsname<30 - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2@bigbuf\endcsname}% - \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% - \expandafter\edef\csname pgfapp@#2@bigbuf\endcsname{\the\t@pgf@toka\the\t@pgf@tokb}% - \expandafter\let\csname pgfapp@#2@smallbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#2@smallbuf@c\endcsname{0}% - \else% - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2\endcsname}% - \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#2@bigbuf\endcsname}% - \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% - \expandafter\edef\csname pgfapp@#2\endcsname{\the\t@pgf@toka\the\t@pgf@tokb\the\t@pgf@tokc}% - \expandafter\let\csname pgfapp@#2@smallbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#2@smallbuf@c\endcsname{0}% - \expandafter\let\csname pgfapp@#2@bigbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#2@bigbuf@c\endcsname{0}% - \fi% + \begingroup + \c@pgf@counta=\csname pgfapp@#2@bigbuf@c\endcsname\relax + \advance\c@pgf@counta by1 + \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% + \endgroup + \expandafter\let\csname pgfapp@#2@bigbuf@c\endcsname=\pgf@glob@TMPa + % + \ifnum\csname pgfapp@#2@bigbuf@c\endcsname<30 + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2@bigbuf\endcsname}% + \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% + \expandafter\edef\csname pgfapp@#2@bigbuf\endcsname{\the\t@pgf@toka\the\t@pgf@tokb}% + \expandafter\let\csname pgfapp@#2@smallbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#2@smallbuf@c\endcsname{0}% + \else% + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#2\endcsname}% + \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#2@bigbuf\endcsname}% + \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfapp@#2@smallbuf\endcsname#1}% + \expandafter\edef\csname pgfapp@#2\endcsname{\the\t@pgf@toka\the\t@pgf@tokb\the\t@pgf@tokc}% + \expandafter\let\csname pgfapp@#2@smallbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#2@smallbuf@c\endcsname{0}% + \expandafter\let\csname pgfapp@#2@bigbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#2@bigbuf@c\endcsname{0}% + \fi% }% \def\pgfapplist@flushbuffers#1{% - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#1\endcsname}% - \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#1@bigbuf\endcsname}% - \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfapp@#1@smallbuf\endcsname}% - \expandafter\edef\csname pgfapp@#1\endcsname{\the\t@pgf@toka\the\t@pgf@tokb\the\t@pgf@tokc}% - \expandafter\let\csname pgfapp@#1@smallbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#1@smallbuf@c\endcsname{0}% - \expandafter\let\csname pgfapp@#1@bigbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfapp@#1@bigbuf@c\endcsname{0}% + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfapp@#1\endcsname}% + \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfapp@#1@bigbuf\endcsname}% + \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfapp@#1@smallbuf\endcsname}% + \expandafter\edef\csname pgfapp@#1\endcsname{\the\t@pgf@toka\the\t@pgf@tokb\the\t@pgf@tokc}% + \expandafter\let\csname pgfapp@#1@smallbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#1@smallbuf@c\endcsname{0}% + \expandafter\let\csname pgfapp@#1@bigbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfapp@#1@bigbuf@c\endcsname{0}% }% \def\pgfapplistlet#1=#2{% - \pgfapplist@flushbuffers{#2}% - \expandafter\let\expandafter#1\csname pgfapp@#2\endcsname + \pgfapplist@flushbuffers{#2}% + \expandafter\let\expandafter#1\csname pgfapp@#2\endcsname }% - + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% +% % A variant of applist which has the same runtime requirements, but % does PUSH FRONT only. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Usage: +% Usage: % \pgfprependlistnewempty{list} \def\pgfprependlistnewempty#1{% - \expandafter\let\csname pgfpPRP@#1\endcsname=\pgfutil@empty - \expandafter\let\csname pgfpPRP@#1@smallbuf\endcsname=\pgfutil@empty - \expandafter\let\csname pgfpPRP@#1@bigbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfpPRP@#1@smallbuf@c\endcsname{0}% - \expandafter\def\csname pgfpPRP@#1@bigbuf@c\endcsname{0}% + \expandafter\let\csname pgfpPRP@#1\endcsname=\pgfutil@empty + \expandafter\let\csname pgfpPRP@#1@smallbuf\endcsname=\pgfutil@empty + \expandafter\let\csname pgfpPRP@#1@bigbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfpPRP@#1@smallbuf@c\endcsname{0}% + \expandafter\def\csname pgfpPRP@#1@bigbuf@c\endcsname{0}% }% % #1: the item to append % #2: the list as macro name \long\def\pgfprependlistpushfront#1\to#2{% - \begingroup - \c@pgf@counta=\csname pgfpPRP@#2@smallbuf@c\endcsname\relax - \advance\c@pgf@counta by1 - \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% - \endgroup - \expandafter\let\csname pgfpPRP@#2@smallbuf@c\endcsname=\pgf@glob@TMPa - \ifnum\csname pgfpPRP@#2@smallbuf@c\endcsname<40 - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@smallbuf\endcsname}% - \t@pgf@tokb={#1}% - \expandafter\edef\csname pgfpPRP@#2@smallbuf\endcsname{\the\t@pgf@tokb\the\t@pgf@toka}% - \else - \pgfprependlistpushfront@smallbufoverfl{#1}{#2}% - \fi + \begingroup + \c@pgf@counta=\csname pgfpPRP@#2@smallbuf@c\endcsname\relax + \advance\c@pgf@counta by1 + \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% + \endgroup + \expandafter\let\csname pgfpPRP@#2@smallbuf@c\endcsname=\pgf@glob@TMPa + \ifnum\csname pgfpPRP@#2@smallbuf@c\endcsname<40 + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@smallbuf\endcsname}% + \t@pgf@tokb={#1}% + \expandafter\edef\csname pgfpPRP@#2@smallbuf\endcsname{\the\t@pgf@tokb\the\t@pgf@toka}% + \else + \pgfprependlistpushfront@smallbufoverfl{#1}{#2}% + \fi }% \long\def\pgfprependlistpushfront@smallbufoverfl#1#2{% - \begingroup - \c@pgf@counta=\csname pgfpPRP@#2@bigbuf@c\endcsname\relax - \advance\c@pgf@counta by1 - \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% - \endgroup - \expandafter\let\csname pgfpPRP@#2@bigbuf@c\endcsname=\pgf@glob@TMPa - % - \ifnum\csname pgfpPRP@#2@bigbuf@c\endcsname<30 - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@bigbuf\endcsname}% - \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@smallbuf\endcsname}% - \t@pgf@tokc={#1}% - \expandafter\edef\csname pgfpPRP@#2@bigbuf\endcsname{\the\t@pgf@tokc\the\t@pgf@tokb\the\t@pgf@toka}% - \expandafter\let\csname pgfpPRP@#2@smallbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfpPRP@#2@smallbuf@c\endcsname{0}% - \else% - \pgfprependlist@flushbuffers{#2}% - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2\endcsname}% - \t@pgf@tokb={#1}% - \expandafter\edef\csname pgfpPRP@#2\endcsname{\the\t@pgf@tokb\the\t@pgf@toka}% - \fi% + \begingroup + \c@pgf@counta=\csname pgfpPRP@#2@bigbuf@c\endcsname\relax + \advance\c@pgf@counta by1 + \xdef\pgf@glob@TMPa{\the\c@pgf@counta}% + \endgroup + \expandafter\let\csname pgfpPRP@#2@bigbuf@c\endcsname=\pgf@glob@TMPa + % + \ifnum\csname pgfpPRP@#2@bigbuf@c\endcsname<30 + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@bigbuf\endcsname}% + \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2@smallbuf\endcsname}% + \t@pgf@tokc={#1}% + \expandafter\edef\csname pgfpPRP@#2@bigbuf\endcsname{\the\t@pgf@tokc\the\t@pgf@tokb\the\t@pgf@toka}% + \expandafter\let\csname pgfpPRP@#2@smallbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfpPRP@#2@smallbuf@c\endcsname{0}% + \else% + \pgfprependlist@flushbuffers{#2}% + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#2\endcsname}% + \t@pgf@tokb={#1}% + \expandafter\edef\csname pgfpPRP@#2\endcsname{\the\t@pgf@tokb\the\t@pgf@toka}% + \fi% }% \def\pgfprependlist@flushbuffers#1{% - \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1\endcsname}% - \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1@bigbuf\endcsname}% - \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1@smallbuf\endcsname}% - \expandafter\edef\csname pgfpPRP@#1\endcsname{\the\t@pgf@tokc\the\t@pgf@tokb\the\t@pgf@toka}% - \expandafter\let\csname pgfpPRP@#1@smallbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfpPRP@#1@smallbuf@c\endcsname{0}% - \expandafter\let\csname pgfpPRP@#1@bigbuf\endcsname=\pgfutil@empty - \expandafter\def\csname pgfpPRP@#1@bigbuf@c\endcsname{0}% + \t@pgf@toka=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1\endcsname}% + \t@pgf@tokb=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1@bigbuf\endcsname}% + \t@pgf@tokc=\expandafter\expandafter\expandafter{\csname pgfpPRP@#1@smallbuf\endcsname}% + \expandafter\edef\csname pgfpPRP@#1\endcsname{\the\t@pgf@tokc\the\t@pgf@tokb\the\t@pgf@toka}% + \expandafter\let\csname pgfpPRP@#1@smallbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfpPRP@#1@smallbuf@c\endcsname{0}% + \expandafter\let\csname pgfpPRP@#1@bigbuf\endcsname=\pgfutil@empty + \expandafter\def\csname pgfpPRP@#1@bigbuf@c\endcsname{0}% }% \def\pgfprependlistlet#1=#2{% - \pgfprependlist@flushbuffers{#2}% - \expandafter\let\expandafter#1\csname pgfpPRP@#2\endcsname + \pgfprependlist@flushbuffers{#2}% + \expandafter\let\expandafter#1\csname pgfpPRP@#2\endcsname }% |