1

One part of my algorithm is done in parallel, for that, I have a block in my algorithm, but I can not show it properly. Can anybody help me to solve this problem?

\usepackage[linesnumbered,lined,boxed,commentsnumbered,ruled,longend]{algorithm2e}
\begin{document}
\begin{algorithm}[!t]
\DontPrintSemicolon 
\SetKwBlock{DoParallel}{do in parallel}{end}

\begin{algorithmic}[1] 
\STATE \DoParallel{
\FOR{ $1\leq i \leq Epoch$}
    \STATE Do the 
\ENDFOR
\FOR{ $1\leq i \leq Epoch$}
\STATE Do the 1;
\ENDFOR}
\end{algorithmic}\label{}
\end{algorithm}
\end{document}

here is the figure

Any other response which is related to the parallel in the algorithm is appreciated.

  • 1
    Looks like you are mixing two different packages for algorithms, but it's hard to tell, what is going on, since your code doesn't compile – DG' Oct 23 at 11:52
1

You are mixing (at least) two different packages for typesetting algorithms. I suggest, you stick to one of them:

\documentclass{article}
\usepackage[linesnumbered,lined,boxed,commentsnumbered,ruled,longend]{algorithm2e}
\begin{document}
\begin{algorithm}[!t]
    \DontPrintSemicolon
    \SetKwBlock{DoParallel}{do in parallel}{end}
    \DoParallel{
        \For{$1\leq i \leq$ Epoch}{
            Do the
        }
        \For{$1\leq i \leq$ Epoch}{
            Do the 1;
        }
    }
\end{algorithm}\label{oursmc}
\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.