LaTeX伪代码相关

给出一个简单的栗子

\begin{algorithm}[t]
\caption{Realization of the Background Searching} %?????
%\hspace*{0.02in}
{\bf {Input:}} original HSI ${\bf{H}} = \left[ {{\bf{B}},{\bf{A}}} \right]$, maximum distance between two points in the same group $\mathcal{E}$, minimum number of samples in a cluster \textit{MinPts};\\
{\bf {\emph{Steps:}} }
\label{alg1}
\begin{algorithmic}[1]
\State Reduce the dimension of input data ${\bf{H}}$ by PCA and set the transformed data as ${\bf{H}^{'}} = \left[ {{\bf{B}^{'}},{\bf{A}^{'}}} \right] = \{ {{\bf{h}}_{ij}}\} _{i = 0,j = 0}^{i = M^{'},j = N^{'}}$, where $M^{'} < M, N^{'} < N$;
\State  Calculate the clusters $\mathbb{C}_{1}, \mathbb{C}_{2} \cdots \mathbb{C}_{c}$ and the anomalies $\mathbb{Q}$ by applying DBSCAN algorithm.

\State Find the corresponding class of each vector $\textbf{h}_{ij}^{'}$ in ${\bf{H}^{'}}$ according to $\mathbb{C}_{1}, \mathbb{C}_{2} \cdots \mathbb{C}_{c}$ and $\mathbb{Q}$, and display all classes as a clustering map as shown in Fig. \ref{Figure2};
\State Set anomalies in clustering map to 1, while other background classes to 0 for obtaining the initial detection ${\bf{S}}$;
\State Search background vector from original input ${\bf{H}}$ according to Eq. (4).
\end{algorithmic}
{\bf {Output:}} background samples ${{\bf{B}}_s}$.
\end{algorithm}

效果如下
在这里插入图片描述要想实现在伪代码中换行但是序号数不增加,即如下效果:
在这里插入图片描述
而非(直接’\'换行)
在这里插入图片描述
在要换行的地方加\Statex

\State Fix ${\bf{Z}}$, ${\bf{E}}$ and update ${\bf{J}}$ 
\Statex $\mathbf{J}=\arg \min \frac{1}{\mu}\|\mathbf{J}\|_{*}+\frac{1}{2}\left\|\mathbf{J}-\left(\mathbf{Z}+\mathbf{Y}_{2} / \mu\right)\right\|_{F}^{2}$
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值