Home > manopt > core > canGetGradient.m

## PURPOSE Checks whether the gradient can be computed for a problem structure.

## DESCRIPTION ``` Checks whether the gradient can be computed for a problem structure.

Returns true if the gradient of the cost function can be computed given
the problem description, false otherwise.

## CROSS-REFERENCE INFORMATION This function calls:
This function is called by:
• manoptAD Preprocess automatic differentiation for a manopt problem structure
• canGetDirectionalDerivative Checks whether dir. derivatives can be computed for a problem structure.
• canGetSubgradient Checks whether a subgradient can be computed for a problem structure.
• getDirectionalDerivative Computes the directional derivative of the cost function at x along d.
• getSubgradient Computes a subgradient of the cost function at x, up to a tolerance
• arc Adaptive regularization by cubics (ARC) minimization algorithm for Manopt
• barzilaiborwein Riemannian Barzilai-Borwein solver with non-monotone line-search.
• rlbfgs Riemannian limited memory BFGS solver for smooth objective functions.
• approxhessianFD Hessian approx. fnctn handle based on finite differences of the gradient.
• steepestdescent Steepest descent (gradient descent) minimization algorithm for Manopt.
• trustregions Riemannian trust-regions solver for optimization on manifolds.
• checkdiff Checks the consistency of the cost function and directional derivatives.
• checkgradient Checks the consistency of the cost function and the gradient.
• checkhessian Checks the consistency of the cost function and the Hessian.
• hessianextreme Compute an extreme eigenvector / eigenvalue of the Hessian of a problem.
• hessianspectrum Returns the eigenvalues of the (preconditioned) Hessian at x.
• manoptsolve Gateway helper function to call a Manopt solver, chosen in the options.

## SOURCE CODE ```0001 function candoit = canGetGradient(problem)
0002 % Checks whether the gradient can be computed for a problem structure.
0003 %
0004 % function candoit = canGetGradient(problem)
0005 %
0006 % Returns true if the gradient of the cost function can be computed given
0007 % the problem description, false otherwise.
0008 %
0010
0011 % This file is part of Manopt: www.manopt.org.
0012 % Original author: Nicolas Boumal, Dec. 30, 2012.
0013 % Contributors:
0014 % Change log:
0015 %
0016 %   June 28, 2016 (NB):
0018 %
0019 %   Nov. 1, 2016 (NB):
0021