Debian Codegraph @

texmf-dist/doc/lualatex/luacas/reference/ref_calculus/ref_calculus.tex

raw
1 \documentclass{article}
2
3 \usepackage{luacas}
4 \usepackage{amsmath}
5 \usepackage{amssymb}
6
7 \usepackage[margin=1in]{geometry}
8 \usepackage[shortlabels]{enumitem}
9
10 \usepackage{pgfplots}
11 \pgfplotsset{compat=1.18}
12 \usetikzlibrary{positioning,calc}
13 \usepackage{forest}
14 \usepackage{minted}
15 \usemintedstyle{pastie}
16 \usepackage[hidelinks]{hyperref}
17 \usepackage{parskip}
18 \usepackage{multicol}
19 \usepackage[most]{tcolorbox}
20 \tcbuselibrary{xparse,documentation}
21 \usepackage{microtype}
22 \usepackage{makeidx}
23
24 \usepackage[
25 backend=biber,
26 style=numeric,
27 ]{biblatex}
28 \addbibresource{sources.bib}
29
30 \definecolor{rose}{RGB}{128,0,0}
31 \definecolor{roseyellow}{RGB}{222,205,99}
32 \definecolor{roseblue}{RGB}{167,188,214}
33 \definecolor{rosenavy}{RGB}{79,117,139}
34 \definecolor{roseorange}{RGB}{232,119,34}
35 \definecolor{rosegreen}{RGB}{61,68,30}
36 \definecolor{rosewhite}{RGB}{223,209,167}
37 \definecolor{rosebrown}{RGB}{108,87,27}
38 \definecolor{rosegray}{RGB}{84,88,90}
39
40 \definecolor{codegreen}{HTML}{49BE25}
41
42 \newtcolorbox{codebox}[1][sidebyside]{
43 enhanced,skin=bicolor,
44 #1,
45 arc=1pt,
46 colframe=brown,
47 colback=brown!15,colbacklower=white,
48 boxrule=1pt,
49 notitle
50 }
51
52 \newtcolorbox{codehead}[1][]{
53 enhanced,
54 frame hidden,
55 colback=rosegray!15,
56 boxrule=0mm,
57 leftrule=5mm,
58 rightrule=5mm,
59 boxsep=0mm,
60 arc=0mm,
61 outer arc=0mm,
62 left=3mm,
63 right=3mm,
64 top=1mm,
65 bottom=1mm,
66 toptitle=1mm,
67 bottomtitle=1mm,
68 oversize,
69 #1
70 }
71
72 \usepackage{varwidth}
73
74 \newtcolorbox{newcodehead}[2][]{
75 enhanced,
76 frame hidden,
77 colback=rosegray!15,
78 boxrule=0mm,
79 leftrule=5mm,
80 rightrule=5mm,
81 boxsep=0mm,
82 arc=0mm,
83 outer arc=0mm,
84 left=3mm,
85 right=3mm,
86 top=1mm,
87 bottom=1mm,
88 toptitle=1mm,
89 bottomtitle=1mm,
90 oversize,
91 #1,
92 fonttitle=\bfseries\ttfamily\footnotesize,
93 coltitle=rosegray,
94 attach boxed title to top text right,
95 boxed title style={frame hidden,
96 size=small,
97 bottom=-1mm,
98 interior style={fill=none,
99 top color=white,
100 bottom color=white}
101 },
102 title={#2}
103 }
104
105 \makeindex
106
107 \newcommand{\coderef}[2]{%
108 \begin{codehead}[sidebyside,segmentation hidden]%
109 \mintinline{lua}{#1}%
110 \tcblower%
111 \begin{flushright}%
112 \mintinline{lua}{#2}%
113 \end{flushright}%
114 \end{codehead}%
115 }
116
117 \newcommand{\newcoderef}[3]{%
118 \begin{newcodehead}[sidebyside,segmentation hidden]{#3}%
119 \mintinline{lua}{#1}%
120 \tcblower%
121 \begin{flushright}%
122 \mintinline{lua}{#2}%
123 \end{flushright}%
124 \end{newcodehead}%
125 }
126
127 \usetikzlibrary{shapes.multipart}
128 \useforestlibrary{edges}
129
130 \def\error{\color{red}}
131 \def\self{\color{gray}}
132 \def\call{$\star$ }
133
134 \begin{document}
135 \thispagestyle{empty}
136
137 \section{Calculus}
138 This section contains reference materials for the calculus functionality of \texttt{luacas}. The classes in this module are diagramed below according to inheritance along with the methods/functions one can call upon them.
139 \begin{itemize}
140 \item {\error\ttfamily\itshape method}: an abstract method;
141 \item {\self\ttfamily\itshape method}: a method that returns the expression unchanged;
142 \item {\ttfamily\itshape method}: method that is either unique, implements an abstract method, or overrides an abstract
143 method;
144 \item {\tikz[baseline=-0.5ex]\node[fill=roseorange!30] {\ttfamily\bfseries Class};}: a concrete class.
145 \end{itemize}
146 Here is an inheritance diagram of the classes in the calculus module; all these classes inherit from the \texttt{CompoundExpression} branch of the inheritance tree. Most methods are stated, but some were omitted (because they inherit in the obvious way, they are auxiliary and not likely to be interesting to the end-user, etc).
147 \vfill
148 \forestset{
149 rectcore/.style = {rectangle split,
150 rectangle split parts=2,
151 draw = {rosenavy,thick},
152 rounded corners = 1pt,
153 font = \ttfamily\bfseries,
154 fill = roseblue!#1
155 },
156 rectalg/.style = {rectangle split,
157 rectangle split parts=2,
158 draw = {rose,thick},
159 rounded corners = 1pt,
160 font = \ttfamily\bfseries,
161 fill = rose!#1
162 },
163 rectcalc/.style = {rectangle split,
164 rectangle split parts=2,
165 draw = {roseorange,thick},
166 rounded corners = 1pt,
167 font = \ttfamily\bfseries,
168 fill = roseorange!#1
169 }
170 }
171 \forestset{
172 multiple directions/.style={
173 for tree={#1},
174 phantom,
175 for relative level=1{
176 no edge,
177 delay={
178 !c.content/.pgfmath=content("!u")},
179 before computing xy={l=0,s=0}
180 }
181 },
182 multiple directions/.default={},
183 grow subtree/.style={for tree={grow=#1}},
184 grow' subtree/.style={for tree={grow'=#1}}}
185 \tikzset{
186 every two node part/.style={font=\ttfamily\itshape\footnotesize}
187 }
188 \begin{center}
189 \begin{forest}
190 for tree = {node options={align=left},
191 edge = {-stealth}
192 },
193 forked edges
194 [Expression\nodepart{two}$\cdots$,rectcore={0}
195 [CompoundExpressions\nodepart{two}$\cdots$,rectcore={0}
196 [DerivativeExpression\nodepart{two}
197 :new() \\
198 :evaluate()\\
199 :autosimplify()
200 ,rectcalc=30]
201 [DiffExpression\nodepart{two}
202 :new()\\
203 :evaluate()\\
204 :autosimplify()
205 ,rectcalc=30]
206 [IntegralExpression\nodepart{two}
207 :new()\\
208 :isdefinite()\\
209 .table()\\
210 .linearproperties()\\
211 .substitutionmethod()\\
212 .enhancedsubstitutionmethod()\\
213 .rationalfunction()\\
214 .partsmethod()\\
215 .eulersformula()\\
216 .integrate()
217 ,rectcalc=30]
218 ]
219 ]
220 \end{forest}
221 \end{center}
222 \vfill
223
224 \end{document}
225