$\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 maxiteration or minimal change stopping criterion

Given a manifold $\M$, a maximal number of iterates $K$ and a minimal change $\varepsilon$, this small helper returns a function handle suitable for $\M$-valued data $x\colon\Grid\to\M$ of any dimension that returns true when in the current iterate $k$

This criterion is evaluated after running the $k$th iteration and hence stops after $K$ iterations.

### Matlab Documentation

1
2
3
4
5
6
7
8
9
10
11
12
13
% stopCritMaxIterEpsilonCreator(M,maxIter,epsilon) a maxIt minEps criterion
% based on a maximal number of iterations or a minimal max-norm change
%
% INPUT
%   M      : the manifold the data lives on
%  maxIter : the maximal number of iterations
%  epsilon : the maximal change within an iteration
%
% OUTPUT
%   fct : a functional @(x,xold,s,iter) suitable for both (sub) gradient
%           descent or cyclic proximal point
% ---
% MVIRT 1.1 | R. Bergmann | 2018-01-25