File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55\usepackage {subcaption }
66\usepackage [ruled,linesnumbered ]{algorithm2e }
77\usepackage {hyperref }
8+ \usepackage {listings }
89
910\def\figureautorefname {图}
11+
1012\SetAlgorithmName {算法}{算法}{算法索引}
1113
14+ \renewcommand *{\lstlistingname }{代码}
15+
1216\title {何老师算法课笔记}
1317\subtitle {还没有想好的副标题}
1418\author {计卓1801全体}
Original file line number Diff line number Diff line change @@ -47,6 +47,48 @@ \section{环境}
4747 \end {enumerate }
4848\end {itemize }
4949
50+ 这是一张图片:
51+
52+ \begin {figure }[hbt]
53+ \centering
54+ \includegraphics {image/dynamic-programming-1.png}
55+ \caption {这是一张图片}\label {fig:example }
56+ \end {figure }
57+
58+ 这是一段代码:
59+
60+ \ begin{lstlisting} [language=Python, caption=Python example]
61+ import numpy as np
62+
63+ def incmatrix(genl1,genl2):
64+ m = len(genl1)
65+ n = len(genl2)
66+ M = None #to become the incidence matrix
67+ VT = np.zeros((n*m,1), int) #dummy variable
68+
69+ #compute the bitwise xor matrix
70+ M1 = bitxormatrix(genl1)
71+ M2 = np.triu(bitxormatrix(genl2),1)
72+
73+ for i in range(m-1):
74+ for j in range(i+1, m):
75+ [r,c] = np.where(M2 == M1[i,j])
76+ for k in range(len(r)):
77+ VT[(i)*n + r[k]] = 1;
78+ VT[(i)*n + c[k]] = 1;
79+ VT[(j)*n + r[k]] = 1;
80+ VT[(j)*n + c[k]] = 1;
81+
82+ if M is None:
83+ M = np.copy(VT)
84+ else:
85+ M = np.concatenate((M, VT), 1)
86+
87+ VT = np.zeros((n*m,1), int)
88+
89+ return M
90+ \end {lstlisting }
91+
5092更多环境请见文档。
5193
5294\section {引用 }
You can’t perform that action at this time.
0 commit comments