Skip to content

Commit 4e65df6

Browse files
committed
Move over terminology writeup (needs an update)
1 parent b9b78cf commit 4e65df6

File tree

10 files changed

+6895
-0
lines changed

10 files changed

+6895
-0
lines changed

doc/terminology/.latexmkrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$pdflatex='pdflatex -shell-escape';

doc/terminology/2opticcomp.tikz

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
\begin{tikzpicture}[on grid]
2+
\node[vert] (ll) at (0, 0) {$l_l$};
3+
\node[vert, right=2.3 of ll, yshift=-4mm] (lr) {$l_r$};
4+
\node[vert, right=7 of ll] (rr) {$r_l$};
5+
\node[vert, left=2.3 of rr, yshift=-4mm] (rl) {$r_r$};
6+
7+
\node (A1) [above left=0.8 and 0.4 of ll] {$A_1$};
8+
\node (A2) [above right=0.8 and 0.4 of rr] {$A_2$};
9+
10+
\node (B1) [below right=0.7 and 0.8 of ll] {$B_1$};
11+
\node (B3) [right=0.7 of B1] {$B_3$};
12+
13+
\node (A3) [below right=0.7 and 0.8 of lr] {$A_3$};
14+
\node (A4) [right=0.7 of A3] {$A_4$};
15+
16+
\node (B2) [below left=0.7 and 0.8 of rr] {$B_2$};
17+
\node (B4) [left=0.7 of B2] {$B_4$};
18+
19+
\draw [->] (A1) -- (ll);
20+
\draw [->] (rr) -- (A2);
21+
22+
\draw [->] (ll) -- ++(1.8,0) to[out=east, in=north west] (lr);
23+
\draw [->] (ll) to[out=south east,in=west] (B1);
24+
\draw [->] (B3) to[out=east,in=south west] (lr);
25+
26+
\draw [->] (lr) -- (rl);
27+
\draw [->] (lr) to[out=south east,in=west] (A3);
28+
\draw [->] (A4) to[out=east,in=south west] (rl);
29+
30+
\draw [->] (rl) to[out=north east, in=west] ($(rr)-(1.8,0)$) -- (rr);
31+
\draw [->] (rl) to[out=south east,in=west] (B4);
32+
\draw [->] (B2) to[out=east,in=south west] (rr);
33+
34+
\draw[->] (ll) to[out=north east, in=west] ++(1,0.4)
35+
to ++(5,0)
36+
to[out=east, in=north west] (rr)
37+
;
38+
39+
\node[draw,dashed,fit=(A3) (A4), inner xsep = 2pt] (box2) {};
40+
41+
\node[vert, below=2 of ll] (ll_2) {$l_l^\prime$};
42+
\node[vert, right=2.3 of ll_2, yshift=-4mm] (lr_2) {$l_r^\prime$};
43+
\node[vert, right=7 of ll_2] (rr_2) {$r_l^\prime$};
44+
\node[vert, left=2.3 of rr_2, yshift=-4mm] (rl_2) {$r_r^\prime$};
45+
46+
\node (B1_2) [above left=0.8 and 0.4 of ll_2] {$B_1$};
47+
\node (B2_2) [above right=0.8 and 0.4 of rr_2] {$B_2$};
48+
49+
\node (C1) [below right=0.7 and 0.8 of ll_2] {$C_1$};
50+
\node (C3) [right=0.7 of C1] {$C_3$};
51+
52+
\node (B3_2) [below right=0.7 and 0.8 of lr_2] {$B_3$};
53+
\node (B4_2) [right=0.7 of B3_2] {$B_4$};
54+
55+
\node (C2) [below left=0.7 and 0.8 of rr_2] {$C_2$};
56+
\node (C4) [left=0.7 of C2] {$C_4$};
57+
58+
\draw [->] (B1_2) -- (ll_2);
59+
\draw [->] (rr_2) -- (B2_2);
60+
61+
\draw [->] (ll_2) -- ++(1.8,0) to[out=east, in=north west] (lr_2);
62+
\draw [->] (ll_2) to[out=south east,in=west] (C1);
63+
\draw [->] (C3) to[out=east,in=south west] (lr_2);
64+
65+
\draw [->] (lr_2) -- (rl_2);
66+
\draw [->] (lr_2) to[out=south east,in=west] (B3_2);
67+
\draw [->] (B4_2) to[out=east,in=south west] (rl_2);
68+
69+
\draw [->] (rl_2) to[out=north east, in=west] ($(rr_2)-(1.8,0)$) -- (rr_2);
70+
\draw [->] (rl_2) to[out=south east,in=west] (C4);
71+
\draw [->] (C2) to[out=east,in=south west] (rr_2);
72+
73+
\draw [->,thick,color=red] (B1) to[out=south west, in=east] (B1_2);
74+
\draw [->,thick,color=red] (B3_2) to[out=north, in=south east] (B3);
75+
\draw [->,thick,color=red] (B4) to[out=south west, in=north] (B4_2);
76+
\draw [->,thick,color=red] (B2_2) to[out=west, in=south east] (B2);
77+
78+
\node[draw,dashed,fit=(C1) (C3), inner xsep = 2pt] (box1) {};
79+
\node[draw,dashed,fit=(C2) (C4), inner xsep = 2pt] (box3) {};
80+
81+
\draw[->] (ll_2) to[out=north east, in=west] ++(1,0.4)
82+
to ++(5,0)
83+
to[out=east, in=north west] (rr_2)
84+
;
85+
\end{tikzpicture}

doc/terminology/fastsetindex.jl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
struct FastSetIndex <: AbstractOptic
2+
path::NTuple{N, Int} where N
3+
end
4+
FastSetIndex(i::Int) = FastSetIndex((i,))
5+
6+
path_getindex(obj, ::Tuple{}) = obj
7+
path_getindex(obj, path::Tuple) =
8+
path_getindex(getindex(obj, first(path)), tail(path))
9+
left(f::FastSetIndex, obj) =
10+
(obj, path_getindex(obj, f.path))
11+
12+
path_setindex(obj, update, (idx,)::Tuple{Int}) =
13+
setindex(obj, update, idx)
14+
path_setindex(obj, update, path) =
15+
setindex(obj,
16+
path_setindex(getindex(obj, first(path)),
17+
update, tail(path)),
18+
first(path))
19+
function right(f::FastSetIndex, obj, update)
20+
path_setindex(obj, update, f.path)
21+
end
22+
23+
(a::FastSetIndex b::FastSetIndex) =
24+
FastSetIndex((a.path..., b.path...))

0 commit comments

Comments
 (0)