
# 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