diff --git a/private/tfocs_initialize.m b/private/tfocs_initialize.m index 7706a49..d724e50 100644 --- a/private/tfocs_initialize.m +++ b/private/tfocs_initialize.m @@ -40,13 +40,13 @@ ); % Calling the solver with a no arguments returns the default options structure -if nargin < 1 || ( nargin ==1 && isstruct( smoothF ) ) +if narginn < 1 || ( narginn ==1 && isstruct( smoothF ) ) opts = odef; % remove the "CG" options for now, since they are undocumented opts = rmfield(opts,'cg_restart'); opts = rmfield(opts,'cg_type'); % if any default options are passed in (e.g. by tfocs_SCD), add those now: - if ( nargin ==1 && isstruct( smoothF ) ) + if ( narginn ==1 && isstruct( smoothF ) ) for f = fieldnames( smoothF )' opts.( f{1} ) = smoothF.( f{1} ); end @@ -54,7 +54,7 @@ out = []; x = opts; - if nargout == 0, + if nargoutt == 0, disp('====== TFOCS default options ======='); % disp('Format is fieldname: { [default] ''Usage type. % Description''}'); @@ -110,11 +110,11 @@ assert( ismember(class(smoothF),F_types),'smoothF is of wrong type' ); assert( ismember(class(affineF),F_types),'affineF is of wrong type' ); assert( ismember(class(projectorF),F_types),'projectorF 3 is of wrong type' ); -if nargin >= 4 +if narginn >= 4 x0_types = {'cell','double','single','tfocs_tuple'}; assert( ismember(class(x0),x0_types),'x0 is of wrong type' ); end -if nargin >= 5 && ~isempty(opts) +if narginn >= 5 && ~isempty(opts) assert( ismember(class(opts),{'struct'}),'opts is of wrong type' ); end @@ -132,7 +132,7 @@ % Process the options structure, merging it with the default options % (merge "opts" into "odef") def_fields = fieldnames(odef)'; % default options -if nargin > 4 && ~isempty(opts), +if narginn > 4 && ~isempty(opts), use_fields = zeros(size(def_fields)); opt_fields = fieldnames(opts)'; % user-supplied options for k = opt_fields, @@ -380,7 +380,7 @@ smoothF = tfunc_scale( smoothF, -1 ); end if countOps, - apply_smooth = @(x)solver_apply( 1:(1+(nargout>1)), smoothF, x ); + apply_smooth = @(x)solver_apply( 1:(1+(nargoutt>1)), smoothF, x ); else apply_smooth = smoothF; end @@ -396,7 +396,7 @@ projectorF = prox_stack( projectorF ); end if countOps, - apply_projector = @(varargin)solver_apply( 4:(4+(nargout>1)), projectorF, varargin{:} ); + apply_projector = @(varargin)solver_apply( 4:(4+(nargoutt>1)), projectorF, varargin{:} ); else apply_projector = projectorF; end @@ -560,7 +560,7 @@ stopFcn = { stopFcn }; end errs = zeros(1,length(errFcn)); -if nargout == 1, +if nargoutt == 1, saveHist = false; end if saveHist, diff --git a/tfocs.m b/tfocs.m index a99015e..8933a8b 100644 --- a/tfocs.m +++ b/tfocs.m @@ -66,6 +66,10 @@ % out contains extra information collected during the run % opts structure containing the options used +% Nov 17 2016, hack for Matlab R2016b not allowing nargin/nargout in +% tfocs_initialize: +narginn = nargin; nargoutt = nargout; + % User has requested viewing the default values of "opts" if nargin == 0 || ( nargin==1 && isstruct(smoothF) ) if nargout == 0 diff --git a/tfocs_AT.m b/tfocs_AT.m index 44f1631..434c469 100644 --- a/tfocs_AT.m +++ b/tfocs_AT.m @@ -6,6 +6,10 @@ % help tfocs_help % for a full explanation. +% Nov 17 2016, hack for Matlab R2016b not allowing nargin/nargout in +% tfocs_initialize: +narginn = nargin; nargoutt = nargout; + % Initialization alg = 'AT'; algorithm = 'Auslender & Teboulle''s single-projection method'; diff --git a/tfocs_GRA.m b/tfocs_GRA.m index ba44c4d..e51d12e 100644 --- a/tfocs_GRA.m +++ b/tfocs_GRA.m @@ -4,6 +4,10 @@ % Implements a standard gradient method. A variety of calling sequences % are supported; type 'help tfocs_help' for a full explanation. +% Nov 17 2016, hack for Matlab R2016b not allowing nargin/nargout in +% tfocs_initialize: +narginn = nargin; nargoutt = nargout; + % Initialization alg = 'GRA'; algorithm = 'Proximal gradient descent'; diff --git a/tfocs_LLM.m b/tfocs_LLM.m index cf7172b..097ab65 100644 --- a/tfocs_LLM.m +++ b/tfocs_LLM.m @@ -6,6 +6,10 @@ % help tfocs_help % for a full explanation. +% Nov 17 2016, hack for Matlab R2016b not allowing nargin/nargout in +% tfocs_initialize: +narginn = nargin; nargoutt = nargout; + % Initialization alg = 'LLM'; algorithm = 'Lan/Lu/Monteiro''s two-projection method'; diff --git a/tfocs_N07.m b/tfocs_N07.m index 5811178..6415658 100644 --- a/tfocs_N07.m +++ b/tfocs_N07.m @@ -6,6 +6,10 @@ % help tfocs_help % for a full explanation. +% Nov 17 2016, hack for Matlab R2016b not allowing nargin/nargout in +% tfocs_initialize: +narginn = nargin; nargoutt = nargout; + % Initialization alg = 'N07'; algorithm = 'Nesterov''s 2007 two-projection method'; diff --git a/tfocs_N83.m b/tfocs_N83.m index 15814c0..a91ebe2 100644 --- a/tfocs_N83.m +++ b/tfocs_N83.m @@ -6,6 +6,10 @@ % help tfocs_help % for a full explanation. +% Nov 17 2016, hack for Matlab R2016b not allowing nargin/nargout in +% tfocs_initialize: +narginn = nargin; nargoutt = nargout; + % Initialization alg = 'N83'; algorithm = 'Nesterov''s 1983 single-projection method'; diff --git a/tfocs_TS.m b/tfocs_TS.m index e27ed9c..b8255b4 100644 --- a/tfocs_TS.m +++ b/tfocs_TS.m @@ -6,6 +6,10 @@ % help tfocs_help % for a full explanation. +% Nov 17 2016, hack for Matlab R2016b not allowing nargin/nargout in +% tfocs_initialize: +narginn = nargin; nargoutt = nargout; + % Initialization alg = 'TS'; algorithm = 'Tseng''s single-projection modification of Nesterov''s 2007 method';