for some reason I every line I get an error: Undefined control sequence: \IF (or \STATE or \ELSE). What is the problem with my syntax? Also if I want to reference this algorithm later on how would I do it?
Thanks.
Hi,
thanks for the \ref comment, that works now.
I removed the \Else line but I still get the same error for the other lines.
For some reason though if I change the inside of \begin{algorithmic} to this:
My remark addressed the "meaning" of the command inside the whole algorithm (you don't have to remove it, just review your algorithm).
danylo wrote:
For some reason though if I change the inside of \begin{algorithmic} to this:
\For{all ...}
\State do ...
\EndFor
\State return
As I said in my reply, beware of capitalization; LaTeX commands are sensible to capitalization. The code I posted works perfectly (in a "formal" sense; i.e., it's syntactically correct, but the semantics is up to you).
It works now. I didn't realize that the commands were case sensitive. Thanks. One of other thing I'm curious about is that in the \Comment command is there a way to change the way the comment is produced? Right now a little arrow is used to show the start of the comment. I would prefer something like // instead.
One more thing - how do you force a line break in the middle of a command?
Thanks.
Sorry, I have one more question...
I start off my pseudo code with:
\begin{algorithm}{}
\label{alg:qt}
\caption{$QT\_Clust(S,d)$}
Then later in my text I do \ref{alg:qt} later in my text but it returns the section number the pseudo code is in and no information about the actual algorithm. How do I change this?
Thanks.
danylo wrote:
I'm curious about is that in the \Comment command is there a way to change the way the comment is produced? Right now a little arrow is used to show the start of the comment. I would prefer something like // instead.
danylo wrote:
Then later in my text I do \ref{alg:qt} later in my text but it returns the section number the pseudo code is in and no information about the actual algorithm. How do I change this?