佛山规划建设局网站,潍坊专业输送带产品介绍,网站上的分享,wordpress怎么移动文章分类1 首先导入包#xff1a;
按需要添加或者删除option#xff0c;但是algochapter是必须的。
\usepackage[linesnumbered,ruled,algochapter]{algorithm2e}各个option的作用如下#xff1a; 您好#xff0c;这是Bing。我可以帮您解释algorithm2e包中这几个option的意思。
按需要添加或者删除option但是algochapter是必须的。
\usepackage[linesnumbered,ruled,algochapter]{algorithm2e}各个option的作用如下 您好这是Bing。我可以帮您解释algorithm2e包中这几个option的意思。
linesnumbered: 这个选项表示在伪代码的每一行前面显示行号方便引用和阅读。ruled: 这个选项表示在伪代码的顶部和底部画一条横线并且让标题左对齐。algochapter 或chapter: 这个选项表示在伪代码的标题中加入章节号例如Algorithm 1.1Algorithm 1.2等。
2 举例
\renewcommand{\algorithmcfname}{算法} %---细节与重点
\SetKwInput{KwIn}{输入} %---细节与重点
\SetKwInput{KwOut}{输出} %---细节与重点\begin{algorithm}[h!t]\renewcommand{\thealgocf}{\thechapter-\arabic{algocf}} %---细节与重点实现连字符编号\SetAlgoLined\KwIn{步长阈值$\varepsilon_{2}$残差阈值$\varepsilon_{3}$}\KwOut{满足要求的关节角向量$\symbf{\theta}$}\SetKwBlock{Beginn}{beginn}{ende}\Begin{$k:0$;\While{$($\textbf{not} $stop)$ \textbf{and} $ \left(k k_{\rm max} \right)$}{$k:k1$;\eIf{$\left\|{\symbf{\varDelta} \symbf{\theta}}\right\| \leq \varepsilon_{2} \left(\left\|\symbf{\theta}\right\| \varepsilon_{2}\right)$}{$stop:true$}{$\symbf{\theta}_{\rm new}:\symbf{\theta}{\symbf{\varDelta} \symbf{\theta}}$\eIf{$\varrho 0$}{$\symbf{\theta}:\symbf{\theta}_{\rm new}$; \quad 更新$\symbf{J}$}{$\mu:\mu * \nu$; \quad $\nu:2 * \nu$ }}}}% end for begin\caption{算法伪代码}\label{pseudocode}
\end{algorithm}显示效果