I wrote an algorithm pseudocode using the \userpackage{algorithmic} and when i want to put a caption i get an error. This is the code:
\begin{center}
\begin{algorithmic}
\STATE $N\gets sizeof(\textit{input data})$\\
\textbf{Function} Twiddle(W, N, stuff)
\STATE $ W.r \gets cos(stuff.2.\Pi/N)$
\STATE $ W.i \gets -sin(stuff.2.\Pi/N)$\\
...
\IF{$N_{2}!=1$}
\STATE \textbf{Call} $radix-4(data[N_{2}.k1], N_{2})$
\ENDIF
\label{algo1}
\end{algorithmic}
\end{center}
Can someone help me on that and is there an alternative for this package that gives a better look.
Best Answer
The
algorithmic
environment is not a floating environment, you have to use thealgorithm
wrapper environment. Note this environment cooperates withcaption
, so you can easily customise captions for this environment. Here is an example different from the default: