
# List of helper functions

create a debug functional for algorithms
1
% createDebugFct(M,F,modIter) - creates 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)}$.

Conditional display
1
% dispIf(condition,str) display string if condition is true.


Computes the remainder of a value $x\in\mathbb R$ in $\bigl[-\tfrac{T}{2},\frac{T}{2}\bigr)$, which is mostly used for phase data, i.e. the manifold $S^1$ and $T=2\pi$.

export points, curves and tangents on the sphere $\mathbb S^2$ to asymptote
1
% fileStr = exportSphereSignals2Asymptote(pts,curves,xi,colors)


Export arrays (sorted in cell arrays) of points, curves, and tangent vectors to Asymptote, where they are plotted on a sphere.

plot data on the Sphere $\mathbb S^2$
1
% plotS2 - plot a signal on the sphere


Plot a set of points on the sphere $\mathbb S^2$.

step size rule based on the Armijo rule
1
% stepSizeAsrmijo(M,F,x,descentDir) compute the step size by Armijo's rule


Determines a step size $s>0$ such that

where $\eta$ is a descent direction, e.g. $\eta = -\nabla F(x)$. where the search is performed by $s^\rho$, $% $ and $c>0$ is a constant.

more
Create a maxiteration or minimal change stopping criterion
1
% stopCritMaxIterEpsilonCreator(M,maxIter,epsilon) a maxIt minEps 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.

Compute the remainder in $\bigl[-\tfrac{T}{2},\frac{T}{2}\bigr)$
1
% symMod(v,T) compute the modulus with respect to [-T/2, T/2)


Computes the remainder of a value $x\in\mathbb R$ in $\bigl[-\tfrac{T}{2},\frac{T}{2}\bigr)$, which is mostly used for phase data, i.e. the manifold $S^1$ and $T=2\pi$.