Checks whether the partial Euclidean gradient can be computed for a problem. function candoit = canGetPartialEuclideanGradient(problem) Returns true if the partial Euclidean gradient of the cost function can be computed given the problem description, false otherwise. See also: getPartialEuclideanGradient canGetPartialGradient
0001 function candoit = canGetPartialEuclideanGradient(problem) 0002 % Checks whether the partial Euclidean gradient can be computed for a problem. 0003 % 0004 % function candoit = canGetPartialEuclideanGradient(problem) 0005 % 0006 % Returns true if the partial Euclidean gradient of the cost function can 0007 % be computed given the problem description, false otherwise. 0008 % 0009 % See also: getPartialEuclideanGradient canGetPartialGradient 0010 0011 % This file is part of Manopt: www.manopt.org. 0012 % Original author: Nicolas Boumal, June 28, 2016. 0013 % Contributors: 0014 % Change log: 0015 0016 candoit = (isfield(problem, 'partialegrad') && isfield(problem, 'ncostterms')); 0017 0018 if isfield(problem, 'partialegrad') && ~isfield(problem, 'ncostterms') 0019 warning('manopt:partialegrad', ... 0020 ['If problem.partialegrad is specified, indicate the number n\n' ... 0021 'of terms in the cost function with problem.ncostterms = n.']); 0022 end 0023 0024 end