inv_solve_abs_GN

PURPOSE ^

inv_solve_abs_GN is deprecated in favour of inv_solve_gn

SYNOPSIS ^

function img= inv_solve_abs_GN(imdl,varargin);

DESCRIPTION ^

 inv_solve_abs_GN is deprecated in favour of inv_solve_gn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function img= inv_solve_abs_GN(imdl,varargin);
0002 % inv_solve_abs_GN is deprecated in favour of inv_solve_gn
0003 
0004 warning('EIDORS:deprecated','INV_SOLVE_ABS_GN is deprecated in favour of INV_SOLVE_GN as of 04-Feb-2016.');
0005 try imdl.inv_solve_gn = imdl.inv_solve_abs_GN; imdl=rmfield(imdl,'inv_solve_abs_GN'); end
0006 imdl = deprecate_imdl_opt(imdl, 'parameters');
0007 imdl = deprecate_imdl_opt(imdl, 'inv_solve');
0008 imdl = deprecate_imdl_opt(imdl, 'inv_solve_core');
0009 img=inv_solve_gn(imdl,varargin{:});
0010 try img.inv_solve_abs_GN = img.inv_solve_gn; img=rmfield(img,'inv_solve_gn'); end
0011 
0012 function imdl = deprecate_imdl_opt(imdl,opt)
0013    if ~isfield(imdl, opt)
0014       return;
0015    end
0016    if ~isstruct(imdl.(opt))
0017       error(['unexpected imdl.' opt ' where ' opt ' is not a struct... i do not know what to do']);
0018    end
0019 
0020    % warn on anything but imdl.inv_solve.calc_solution_error
0021    Af = fieldnames(imdl.(opt));
0022    if ~strcmp(opt, 'inv_solve') || (length(Af(:)) ~= 1) || ~strcmp(Af(:),'calc_solution_error')
0023       disp(imdl)
0024       disp(imdl.(opt))
0025       warning('EIDORS:deprecatedParameters',['INV_SOLVE imdl.' opt '.* are deprecated in favour of imdl.inv_solve_gn.* as of 30-Apr-2014.']);
0026    end
0027 
0028    if ~isfield(imdl, 'inv_solve_gn')
0029       imdl.inv_solve_gn = imdl.(opt);
0030    else % we merge
0031       % merge struct trick from:
0032       %  http://stackoverflow.com/questions/38645
0033       for i = fieldnames(imdl.(opt))'
0034          imdl.inv_solve_gn.(i{1})=imdl.(opt).(i{1});
0035       end
0036    end
0037    imdl = rmfield(imdl, opt);

Generated on Fri 30-Dec-2022 19:44:54 by m2html © 2005