$\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}}$

# gradient of the distance functions first argument

The gradient of $f(x) = \tfrac{1}{p} d^p(x,y)$ for a fixed value $y\in\M$ and $p\geq1$, with standard $p=2$. This function returns the gradient

if $x\neq y$ and the element $\eta=0\in T_x\M$ form the subgradient else. For details see .

### Matlab Documentation

1
2
3
4
5
6
7
8
% gradDistance(M,x,y,p) gradient of f(x) = 1/p d^p(x,y)for fixed y in M.
%
% INPUT
%  M   : a manfiold
% x,y  : two points on a manifold
%  p   : (2) exponent of the distance function
% ---
% MVIRT | R. Bergmann | 2018-01-22


1. Afsari, B (2011). Riemannian $L^p$center of mass: Existence, uniqueness, and convexity. Proceedings of the American Mathematical Society. 139 655–73