get_dF_semi
function dF_semi = get_dF_semi(obj,obj_dF_semi)
if obj.order ==1 && ~isempty(obj_dF_semi)
dF_semi = obj_dF_semi;
elseif obj.order == 2 || (isempty(obj_dF_semi) && ~isempty(objdf.nl_semi))
if isempty(obj_dF_semi)
dF_semi = construct_dF_semi(obj);
obj.dF_semi = dF_semi;
else
dF_semi = obj_dF_semi;
end
end
end
function [dF_semi] = construct_dF_semi(obj)
dF_semi = cell(numel(obj.dfnl_semi)+1,1 );
for j = 2:numel(obj.dfnl_semi)+1
if ~isempty(obj.dfnl_semi{j-1})
dF_semi{j} = @(invecs) [-double(obj.dfnl_semi{j-1}(invecs)); sparse(obj.n,1)];
end
end
end