Checks whether the cost function can be computed for a problem structure. function candoit = canGetCost(problem) Returns true if the cost function can be computed given the problem description, false otherwise. See also: getCost canGetDirectionalDerivative canGetGradient canGetHessian
0001 function candoit = canGetCost(problem) 0002 % Checks whether the cost function can be computed for a problem structure. 0003 % 0004 % function candoit = canGetCost(problem) 0005 % 0006 % Returns true if the cost function can be computed given the problem 0007 % description, false otherwise. 0008 % 0009 % See also: getCost canGetDirectionalDerivative canGetGradient canGetHessian 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 0017 candoit = isfield(problem, 'cost') || isfield(problem, 'costgrad'); 0018 0019 end