latex mdpi模板 \begin{spacing}{1.5}行间距 太小 变大\begin{algorithm

用\setstretch{1.35}
\begin{algorithm

\usepackage{
     setspace}%行间距
\usepackage{
     algorithm}  
\usepackage{
     algpseudocode}  
\usepackage{
     amsmath}
\renewcommand{
     \algorithmicrequire}{
     \textbf{
     Input:}}  % Use Input in the format of Algorithm  
\renewcommand{
     \algorithmicensure}{
     \textbf{
     Output:}} % Use Output in the format of Algorithm 
	\begin{
     algorithm}[h]
		\setstretch{
     1.35}
		\caption{
     Conjugate Gradient Algorithm with Dynamic Step-Size Control}
		\label{
     alg::conjugateGradient}
		\begin{
     algorithmic}[1]
			\Require
			$f(x)$: objective funtion;
			$x_0$: initial solution;
			$s$: step size;
			\Ensure
			optimal $x^{
     *}$
			\State initial $g_0=0$ and $d_0=0$;
			\Repeat
			\State compute gradient directions $g_k=\bigtriangledown f(x_k)$;
			
			\State compute Polak-Ribiere parameter $\beta_k=\frac{
     g_k^{
     T}(g_k-g_{
     k-1})}{
     \parallel g_{
     k-1} \parallel^{
     2}}$;
			\State compute the conjugate directions $d_k=-g_k+\beta_k d_{
     k-1}$;
			
			
			\State compute the step size $\alpha_k=s/\parallel d_k \parallel_{
     2}$;
			\Until{
     ($f(x_k)>f(x_{
     k-1})$)}
		\end{
     algorithmic}
	\end{
     algorithm}

latex mdpi模板 \begin{spacing}{1.5}行间距 太小 变大\begin{algorithm_第1张图片

latex mdpi模板 \begin{spacing}{1.5}行间距 太小 变大\begin{algorithm_第2张图片

你可能感兴趣的:(latex mdpi模板 \begin{spacing}{1.5}行间距 太小 变大\begin{algorithm)