Checks whether a subgradient can be computed for a problem structure. function candoit = canGetSubgradient(problem) Returns true if a subgradient of the cost function can be computed given the problem description, false otherwise. See also: canGetGradient
0001 function candoit = canGetSubgradient(problem) 0002 % Checks whether a subgradient can be computed for a problem structure. 0003 % 0004 % function candoit = canGetSubgradient(problem) 0005 % 0006 % Returns true if a subgradient of the cost function can be computed given 0007 % the problem description, false otherwise. 0008 % 0009 % See also: canGetGradient 0010 0011 % This file is part of Manopt: www.manopt.org. 0012 % Original author: Nicolas Boumal, July 20, 2017. 0013 % Contributors: 0014 % Change log: 0015 0016 candoit = isfield(problem, 'subgrad') || canGetGradient(problem); 0017 0018 end