I am trying to use algorithm2e
for my pseudocode. I am having a weird behavior with the comments.
I want them to appear right after the code, on the right, while there seems to be a random (quite big) space that I don't want.
sometimes I tried to have comments on a line, which means that they don't come right after a piece of pseudocode, but I start directly with the comment itself. This was giving me error, any way to achieve this?
\begin{algorithm}[H]
\KwData{Number of samples per pixel N, image and camera properties}
\KwResult{Path Traced image $I_i$, and Gradient Domain Path Traced $\Delta_{i,j}$}
\For{each pixel \emph{i} of the image }{
\For{each sample per pixel}{
$I_i = I_i + h(x-x_i)f(\bar{x})/p(\bar{x})$\tcp*{\textbf{add contribution of base path to the primal image}}
$I_i = I_i/N; $\\
\For{all neighbour pixels $ j \in \Phi_i of i$ }{
$\bar{y} := T_{ij}(\bar{x})$\tcp*{\textbf{calculate offset path with shift mapping}}
$\Delta_{i,j} := \Delta_{i,j} + w_{i,j}(\bar{x})h(x-x_i)(f(\bar{x}) - f(\bar{y})|T_{ij}|);$\\
$\Delta_{i,j} := Delta_{i,j} /N $ \tcp*{\textbf{for all \emph{j}}}
}
}
}
\caption{How to compute GDPT}
\end{algorithm}