$\DeclareMathOperator{\arccosh}{arccosh} \DeclareMathOperator*{\argmin}{arg\,min} \DeclareMathOperator{\Exp}{Exp} \newcommand{\geo}{\gamma_{\overset{\frown}{#1,#2}}} \newcommand{\geoS}{\gamma} \newcommand{\geoD}{\gamma_} \newcommand{\geoL}{\gamma(#2; #1)} \newcommand{\gradM}{\nabla_{\M}} \newcommand{\gradMComp}{\nabla_{\M,#1}} \newcommand{\Grid}{\mathcal G} \DeclareMathOperator{\Log}{Log} \newcommand{\M}{\mathcal M} \newcommand{\N}{\mathcal N} \newcommand{\mat}{\mathbf{#1}} \DeclareMathOperator{\prox}{prox} \newcommand{\PT}{\mathrm{PT}_{#1\to#2}#3} \newcommand{\R}{\mathbb R} \newcommand{\SPD}{\mathcal{P}(#1)} \DeclareMathOperator{\Tr}{Tr} \newcommand{\tT}{\mathrm{T}} \newcommand{\vect}{\mathbf{#1}}$

# create a debug functional for algorithms

For all algorithms, i.e. CPP, gradient, and subgradient can all call a debug function. This function returns a handle @8x,xold,iter) to display the function value $F(x^{(k)})$ of the current iterate, the current iterate $k$ as well as the last maximal change of $x^{(k)}$ and $x^{(k-1)}$.

### Matlab Documentation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
% createDebugFct(M,F,modIter) - creates a debug functional for algorithms
% using x,xold,iter as inputs, evaluating the function F to minimize,
% displaying iteration, the value of F at the current iterate and last
% change (w.r.t. distance on M). If modIter is given, only every modIters
% iteration
%
% INPUT
% M       : a manifold
% F       : the function to minimize
% modIter : (optional, 1) only display the debug every modIters iteration
%
% OUTPUT
% f       : a function handle @ (x,xold,iter) that can be used in
%           algorithms Debug Option
% ---
% Manifold-valued Image Restoration Toolbox 1.2
% R. Bergmann | 2018-02-12