inv_solve_abs_CG

PURPOSE ^

inv_solve_abs_CG is deprecated in favour of inv_solve_cg

SYNOPSIS ^

function img= inv_solve_abs_CG(imdl,varargin);

DESCRIPTION ^

 inv_solve_abs_CG is deprecated in favour of inv_solve_cg

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

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

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