Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. usepackage[linesnumbered,ruled,vlined]{algorithm2e}
  2.  
  3. renewcommand{labelenumi}{(Roman{enumi})}
  4.  
  5. begin{algorithm}
  6. DontPrintSemicolon % Some LaTeX compilers require you to use dontprintsemicolon instead
  7. KwIn{a,b,c,d}
  8. KwOut{e,r}
  9. Calculate $x$, and $y$ Check,
  10. renewcommand{labelenumi}{(Roman{enumi})}
  11. begin{enumerate}[noitemsep,nolistsep]
  12. item If $k geq n$, then the $m_{2}$.
  13. item If $h geq j$, then $m_{1}$.
  14. end{enumerate}
  15. Otherwise, Initialisation: textit{$g(0)=nj$} $i=0$ Compute $n_{2}$,
  16. [
  17. n(i)=frac {a}{b(i)sqrt{3v}}
  18. ] Update $b$,
  19. [
  20. b(i+1)=( -frac{1}{2(g(i)/D}+1)
  21. ] $i=i+1$, Repeat textit{Steps 3 to 6}, till $|a(i+1)-a(i) |<epsilon$
  22. caption{algo of g}
  23. label{algo:b}
  24. end{algorithm}
  25.  
  26. documentclass{article}
  27. usepackage[linesnumbered,ruled,vlined]{algorithm2e}
  28.  
  29. begin{document}
  30.  
  31. begin{algorithm}
  32. %DontPrintSemicolon % Some LaTeX compilers require you to use dontprintsemicolon instead
  33. KwIn{a,b,c,d}
  34. KwOut{e,r}
  35. Calculate $x$, and $y$ Check, linebreak
  36. %renewcommand{labelenumi}{(Roman{enumi})}
  37. %begin{enumerate}[noitemsep,nolistsep]
  38. %item
  39. (I) If $k geq n$, then the $m_{2}$.
  40. linebreak
  41. %item
  42. (II) If $h geq j$, then $m_{1}$. %end{enumerate}
  43. Otherwise, Initialisation: textit{$g(0)=nj$} $i=0$ Compute $n_{2}$,
  44. [
  45. n(i)=frac {a}{b(i)sqrt{3v}}
  46. ] Update $b$,
  47. [
  48. b(i+1)=( -frac{1}{2(g(i)/D}+1)
  49. ] $i=i+1$, Repeat textit{Steps 3 to 6}, till $|a(i+1)-a(i) |<epsilon$
  50. caption{algo of g}
  51. label{algo:b}
  52. end{algorithm}
  53.  
  54. end{document}
  55.  
  56. documentclass{article}
  57. usepackage[linesnumbered,ruled,vlined]{algorithm2e}% http://ctan.org/pkg/algorithm2e
  58. DontPrintSemicolon
  59. begin{document}
  60.  
  61. begin{algorithm}
  62. KwIn{$a$, $b$, $c$, $d$}
  63. KwOut{$e$, $r$}
  64. Calculate~$x$ and~$y$;
  65. lIf{$k geq n$}{$m_2$};
  66. lIf{$h geq j$}{$m_1$};
  67. Else{%
  68. Repeat{$|a(i+1)-a(i)| < epsilon$}{%
  69. Initialisation: $g(0) = nj$;label{stepA}
  70. $i=0$;
  71. Compute~$n_2$
  72. [
  73. n(i) = frac{a}{b(i)sqrt{3v}}
  74. ]
  75. nl Update~$b$
  76. [
  77. b(i+1) = (-frac{1}{2(g(i)/D} + 1)
  78. ]
  79. nl $i = i + 1$;
  80. }
  81. }
  82. caption{My algorithm}
  83. label{algo:b}
  84. end{algorithm}
  85.  
  86. end{document}
  87.  
  88. {
  89. begin{enumerate}[noitemsep,nolistsep]
  90. item If $k geq n$, then the $m_{2}$.
  91. item If $h geq j$, then $m_{1}$.
  92. end{enumerate}
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement