Latex 语法
表格语法:
\renewcommand{\arraystretch}{1.3}%调行距
\setlength\tabcolsep{3pt}%调列距
算法语法:
\begin{algorithm}
\caption{Traditional numeric factorization}\label{alg1}
\begin{algorithmic}[1]
\State\textbf{Input:}
LoopFrag $A$ , LoopFrag $B$ , ... , LoopFrag $N$
\For{LoopFrag $K=1$ to $N$}
\If {Loop dimension * Computation \textless \hspace{0.5em} CPE thread overhead }
\State Up one dimension to cut the Loop K
\State Send the Loop K to the CPE
\State Create thread to accelerate Loop K
\Else
\If {sizeOf(matrix K) \textgreater \hspace{0.3em} Available LDM}
\State Create the CPE kernel to accelerate Loop
\Else
{ Cut the matrix K to LDM }
\EndIf
\EndIf
\EndFor
\end{algorithmic}
\end{algorithm}
PCG算法
\begin{algorithm}
\caption{Preconditioned Conjugate Gradient}%标题
\label{alg1}%标签
\begin{algorithmic}[1]
\State $x_{0} = 0$
\State $r_{0} = b-Ax_{0}$
\State $z_{0} = M^{-1}r_{0}$\
\State $p_{0} = z_{0}$
\State $k = 0$
\While{}
\State $a_{k} = \frac {r_{k}^{T}z_{k}}{p_{k}^{T}Ap_{k}} $
\State $x_{k+1} = x_{k} + a_{k}p_{k}$
\State $r_{k+1} = r_{k} - a_{k}Ap_{k}$
\State $p_{0} = z_{0}$
\State $k = 0$
\If {$r_{k+1}$ is sufficiently small }
\State exit loop
\EndIf
\State $z_{k+1} = M^{-1}r_{k+1}$
\State $\beta_{k} = \frac {z_{k+1}^{T}r_{k+1}}{z_{k}^{T}r_{k}}$
\State $p_{k+1} = z_{k+1} + \beta_{k}p_{k}$
\State $k = k + 1$
\EndWhile
\end{algorithmic}
\end{algorithm}
使其中一行居中:
\centerline{\large{居中的内容}}