I want to write in this algorithm if after for. How can I do that?
\begin{algorithm}[H]
\caption{Algorithm Gaussian elimination with patrial pivoting}
\SetAlgoLined
\For{$i=1:1:n$}{
$p_{i} = i;$
}
{
}
\For{$k=1:1:n$}{
$max=|a_{pk}k|$\\
\For{$i\;=k+1:1:n$}{
\if{$max<|a_{pk}k|$}
{}
{
}
$a_{i}{j}\;=a_{i}{j} - m_{i}{k}a_{k}{j};$\\
I have tried this
\begin{algorithm}[H]
\caption{Algorithm Gaussian elimination with patrial pivoting}
\SetAlgoLined
\For{$i=1:1:n$}{
$p_{i} = i;$
}
{
}
\For{$k=1:1:n$}{
$max=|a_{pk}k|$\\
\For{$i\;=k+1:1:n$}{
\if{$max<|a_{pk}k|$}
{
$max<|a_{pk}k|$
}
}
{
}
$a_{i}{j}\;=a_{i}{j} - m_{i}{k}a_{k}{j};$\\
{
}
}
$b_{i}=b_{i}-m_{i}{k}b_{k};$
but it tells me incomplete \if.



\Fors to print for if ... do, correct? – Werner Apr 22 '20 at 15:48