- Timestamp:
- Mar 10, 2024, 11:19:32 AM (9 months ago)
- Branches:
- master
- Children:
- 5546f50b
- Parents:
- 266732e
- Location:
- doc/theses/mike_brooks_MMath
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/Makefile
r266732e rb64d0f4 67 67 ${CFA} $< -o $@ 68 68 69 ${Build}/%: ${Programs}/%.run.cfa | ${Build} 70 ${CFA} $<-o $@69 ${Build}/%: ${Programs}/%.run.cfa | ${Build} # cfa cannot handle pipe 70 sed -f ${Programs}/sedcmd $< > ${Build}/tmp.cfa; ${CFA} ${Build}/tmp.cfa -o $@ 71 71 72 72 ${Build}/%: ${Programs}/%.run.c | ${Build} 73 ${CC} $< -o $@73 sed -f ${Programs}/sedcmd $< | ${CC} -x c -I ${Programs} -o $@ - 74 74 75 75 ${Build}/%: ${Programs}/%.run.cpp | ${Build} 76 ${CXX} -MMD $< -o $@76 sed -f ${Programs}/sedcmd $< | ${CXX} -x c++ -I ${Programs} -o $@ - 77 77 78 78 ${Build}/%.out: ${Build}/% | ${Build} -
doc/theses/mike_brooks_MMath/array.tex
r266732e rb64d0f4 80 80 The stratification of type variables preceding object declarations makes a length referenceable everywhere that it is needed. 81 81 For example, a declaration can share one length, @N@, among a pair of parameters and the return. 82 \lstinput listing[language=CFA, firstline=10, lastline=17]{hello-array.cfa}82 \lstinput{10-17}{hello-array.cfa} 83 83 Here, the function @f@ does a pointwise comparison, checking if each pair of numbers is within half a percent of each other, returning the answers in a newly allocated @bool@ array. 84 84 … … 94 94 95 95 \begin{figure} 96 \lstinput listing[language=CFA, firstline=30, lastline=49]{hello-array.cfa}96 \lstinput{30-49}{hello-array.cfa} 97 97 \caption{\lstinline{f} Harness} 98 98 \label{f:fHarness} … … 142 142 } 143 143 \end{cfa} 144 %\lstinput listing[language=CFA, firstline=60, lastline=65]{hello-array.cfa}144 %\lstinput{60-65}{hello-array.cfa} 145 145 As is common practice in C, the programmer is free to cast, to assert knowledge not shared with the type system. 146 146 \begin{cfa} … … 152 152 } 153 153 \end{cfa} 154 %\lstinput listing[language=CFA, firstline=70, lastline=75]{hello-array.cfa}154 %\lstinput{70-75}{hello-array.cfa} 155 155 156 156 Argument safety and the associated implicit communication of array length work with \CFA's generic types too. 157 157 \CFA allows aggregate types to be generalized with multiple type parameters, including parameterized element type, so can it be defined over a parameterized length. 158 158 Doing so gives a refinement of C's ``flexible array member'' pattern, that allows nesting structures with array members anywhere within other structures. 159 \lstinput listing[language=CFA, firstline=10, lastline=16]{hello-accordion.cfa}159 \lstinput{10-16}{hello-accordion.cfa} 160 160 This structure's layout has the starting offset of @cost_contribs@ varying in @Nclients@, and the offset of @total_cost@ varying in both generic parameters. 161 161 For a function that operates on a @request@ structure, the type system handles this variation transparently. 162 \lstinput listing[language=CFA, firstline=40, lastline=47]{hello-accordion.cfa}162 \lstinput{40-47}{hello-accordion.cfa} 163 163 In the example, different runs of the program result in different offset values being used. 164 \lstinput listing[language=CFA, firstline=60, lastline=76]{hello-accordion.cfa}164 \lstinput{60-76}{hello-accordion.cfa} 165 165 The output values show that @summarize@ and its caller agree on both the offsets (where the callee starts reading @cost_contribs@ and where the callee writes @total_cost@). 166 166 Yet the call site still says just, ``pass the request.'' … … 179 179 180 180 Examples are shown using a $5 \times 7$ float array, @a@, loaded with increments of $0.1$ when stepping across the length-7 finely-strided dimension shown on columns, and with increments of $1.0$ when stepping across the length-5 coarsely-strided dimension shown on rows. 181 %\lstinput listing[language=CFA, firstline=120, lastline=126]{hello-md.cfa}181 %\lstinput{120-126}{hello-md.cfa} 182 182 The memory layout of @a@ has strictly increasing numbers along its 35 contiguous positions. 183 183 … … 185 185 Like with the C array, a lesser-dimensional array reference can be bound to the result of subscripting a greater-dimensional array, by a prefix of its dimensions. 186 186 This action first subscripts away the most coarsely strided dimensions, leaving a result that expects to be be subscripted by the more finely strided dimensions. 187 \lstinput listing[language=CFA, firstline=60, lastline=66]{hello-md.cfa}188 \lstinput listing[aboveskip=0pt, language=CFA, firstline=140, lastline=140]{hello-md.cfa}187 \lstinput{60-66}{hello-md.cfa} 188 \lstinput[aboveskip=0pt]{140-140}{hello-md.cfa} 189 189 190 190 This function declaration is asserting too much knowledge about its parameter @c@, for it to be usable for printing either a row slice or a column slice. … … 194 194 The new-array library provides the trait @ix@, so-defined. 195 195 With it, the original declaration can be generalized, while still implemented with the same body, to the latter declaration: 196 \lstinput listing[language=CFA, firstline=40, lastline=44]{hello-md.cfa}197 \lstinput listing[aboveskip=0pt, language=CFA, firstline=145, lastline=145]{hello-md.cfa}196 \lstinput{40-44}{hello-md.cfa} 197 \lstinput[aboveskip=0pt]{145-145}{hello-md.cfa} 198 198 199 199 Nontrivial slicing, in this example, means passing a noncontiguous slice to @print1d@. 200 200 The new-array library provides a ``subscript by all'' operation for this purpose. 201 201 In a multi-dimensional subscript operation, any dimension given as @all@ is left ``not yet subscripted by a value,'' implementing the @ix@ trait, waiting for such a value. 202 \lstinput listing[language=CFA, firstline=150, lastline=151]{hello-md.cfa}202 \lstinput{150-151}{hello-md.cfa} 203 203 204 204 The example has shown that @a[2]@ and @a[[2, all]]@ both refer to the same, ``2.*'' slice. -
doc/theses/mike_brooks_MMath/background.tex
r266732e rb64d0f4 503 503 \subsection{The pointer-to-array type has been noticed before} 504 504 505 \subsection{Multi-Dimensional} 506 507 As in the last section, we inspect the declaration ... 508 \lstinput{16-18}{bkgd-carray-mdim.c} 509 The significant axis of deriving expressions from @a@ is now ``itself,'' ``first element'' or ``first grand-element (meaning, first element of first element).'' 510 \lstinput{20-44}{bkgd-carray-mdim.c} 511 505 512 506 513 \section{\CFA} -
doc/theses/mike_brooks_MMath/conclusion.tex
r266732e rb64d0f4 1 1 \chapter{Conclusion} 2 3 \section{Lists} 2 4 3 5 \section{Arrays} -
doc/theses/mike_brooks_MMath/list.tex
r266732e rb64d0f4 64 64 \begin{comment} 65 65 \begin{figure} 66 \begin{tabularx}{\textwidth}{Y|Y|Y}\lstinputlisting[language=C , firstline=20, lastline=39]{lst-issues-intrusive.run.c} 67 &\lstinputlisting[language=C++, firstline=20, lastline=39]{lst-issues-wrapped-byref.run.cpp} 68 &\lstinputlisting[language=C++, firstline=20, lastline=39]{lst-issues-wrapped-emplaced.run.cpp} 66 \begin{tabularx}{\textwidth}{Y|Y|Y} 67 \lstinput[language=C]{20-39}{lst-issues-intrusive.run.c} 68 &\lstinputlisting[language=C++]{20-39}{lst-issues-wrapped-byref.run.cpp} 69 &\lstinputlisting[language=C++]{20-39}{lst-issues-wrapped-emplaced.run.cpp} 69 70 \\ & & 70 71 \\ … … 100 101 \begin{lrbox}{\myboxA} 101 102 \begin{tabular}{@{}l@{}} 102 \lstinput listing[language=C, firstline=20, lastline=39]{lst-issues-intrusive.run.c} \\103 \lstinput[language=C]{20-39}{lst-issues-intrusive.run.c} \\ 103 104 \ \\ 104 105 \includegraphics[page=1]{lst-issues-attach.pdf} … … 108 109 \begin{lrbox}{\myboxB} 109 110 \begin{tabular}{@{}l@{}} 110 \lstinput listing[language=C++, firstline=20, lastline=39]{lst-issues-wrapped-byref.run.cpp} \\111 \lstinput[language=C++]{20-39}{lst-issues-wrapped-byref.run.cpp} \\ 111 112 \ \\ 112 113 \includegraphics[page=2]{lst-issues-attach.pdf} … … 116 117 \begin{lrbox}{\myboxC} 117 118 \begin{tabular}{@{}l@{}} 118 \lstinput listing[language=C++, firstline=20, lastline=39]{lst-issues-wrapped-emplaced.run.cpp} \\119 \lstinput[language=C++]{20-39}{lst-issues-wrapped-emplaced.run.cpp} \\ 119 120 \ \\ 120 121 \includegraphics[page=3]{lst-issues-attach.pdf} … … 180 181 181 182 \begin{figure} 182 \lstinput listing[language=C++, firstline=100, lastline=117]{lst-issues-attach-reduction.hpp}183 \lstinput listing[language=C++, firstline=150, lastline=150]{lst-issues-attach-reduction.hpp}183 \lstinput[language=C++]{100-117}{lst-issues-attach-reduction.hpp} 184 \lstinput[language=C++]{150-150}{lst-issues-attach-reduction.hpp} 184 185 \caption{ 185 186 Reduction of wrapped attachment to intrusive attachment. … … 228 229 \begin{figure} 229 230 \parbox[t]{3.5in} { 230 \lstinput listing[language=C++, firstline=20, lastline=60]{lst-issues-multi-static.run.c}231 \lstinput[language=C++]{20-60}{lst-issues-multi-static.run.c} 231 232 }\parbox[t]{20in} { 232 233 ~\\ … … 353 354 354 355 \begin{figure} 355 \lstinput listing[language=CFA, firstline=20, lastline=32]{lst-features-intro.run.cfa}356 \lstinput{20-32}{lst-features-intro.run.cfa} 356 357 \caption[Multiple link directions in \CFA list library]{ 357 358 Demonstration of the running \lstinline{req} example, done using the \CFA list library. … … 365 366 \begin{tabular}{@{}ll@{}} 366 367 \begin{tabular}{@{}l@{}} 367 \lstinput listing[language=CFA, firstline=20, lastline=25]{lst-features-multidir.run.cfa} \\368 \lstinput listing[language=CFA, firstline=40, lastline=67]{lst-features-multidir.run.cfa}368 \lstinput{20-25}{lst-features-multidir.run.cfa} \\ 369 \lstinput{40-67}{lst-features-multidir.run.cfa} 369 370 \end{tabular} 370 371 & 371 \lstinput listing[language=C++, firstline=20, lastline=60]{lst-issues-multi-static.run.c}372 \lstinput[language=C++]{20-60}{lst-issues-multi-static.run.c} 372 373 \end{tabular} 373 374 -
doc/theses/mike_brooks_MMath/uw-ethesis.tex
r266732e rb64d0f4 96 96 97 97 \makeatletter 98 \newcommand{\lstinput}[ 2]{\lstinputlisting[linerange={#1},xleftmargin=4pt,escapechar={\$},moredelim={**[is][\color{red}]{@}{@}}]{#2}}98 \newcommand{\lstinput}[3][]{\lstinputlisting[#1,linerange={#2},xleftmargin=4pt,escapechar={\$},moredelim={**[is][\color{red}]{@}{@}}]{#3}} 99 99 \makeatother 100 100 % cfa macros used in the document
Note: See TracChangeset
for help on using the changeset viewer.