If I have a pseudo-algorithm in Latex that looks like this:
With source code below.
\usepackage[ruled, vlined]{algorithm2e}
\begin{document}
\begin{algorithm}[H]
\DontPrintSemicolon
$\mathbf{D}_{obs}(f,Nx,Ny,x,y)\leftarrow \mathbf{D}_{obs}(t,Nx,Ny,x,y)$ by 1-D forward FFT\;
$\mathbf{D}_0\leftarrow\mathbf{D}_{obs}$\;
\For{$f\leftarrow 1,2,\dots,F$}{
\For{$f\leftarrow 1,2,\dots,F$}{
$\mathbf{D}^f_n \leftarrow a_n\mathbf{D}^f_{obs} + (1 - a_n)\mathcal{SF}_{d}\mathbf{D}^f_{n-1} + (1 - \mathcal{S})\mathcal{F}_{d}\mathbf{D}^f_{n-1}$\;
\If{$\left\|\mathbf{D}^f_n - \mathbf{D}^f_{n-1}\right\|_F^2\leq\epsilon$}{
\textbf{return} $\mathbf{D}^f_n$\;
}
\textbf{return} $\mathbf{D}^f_{n_{max}}$\;
}
\textbf{return} $\mathbf{D}_{recovered}$\;
}
$\mathbf{D}_{recovered}(t,Nx,Ny,x,y)\leftarrow \mathbf{D}_{recovered}(f,Nx,Ny,x,y)$ by 1-D inverse FFT\;
\caption{Construction Heuristic - Control 4-6}
\label{algorithm_2}
\end{algorithm}
\end{document}
How can I change the bold name "Algorithm 2" into something else, like "Function 2"? Right now it automatically names all algorithm blocks and just adds a number. I found this thread but in this case it just changes ALL algorithm names. Sometimes I want to write "Function" and sometimes "Algorithm".

