0001
0002
0003
0004
0005
0006 classdef least_squares_term
0007 properties
0008 descriptor='';
0009 scale_type='none';
0010 scale = 1.;
0011 weight = 1.;
0012 end
0013
0014 methods
0015 function [lst]=least_squares_term(varargin)
0016
0017 switch nargin
0018
0019
0020
0021 case 0
0022
0023
0024
0025 otherwise
0026 if (nargin == 1) && isa(varargin{1},'least_squares_term')
0027 lst=varargin{1};
0028 else
0029 lst.descriptor=varargin{1};
0030
0031 if (nargin >= 2)
0032 lst.scale_type=varargin{2};
0033 if (nargin >= 3)
0034 lst.scale =varargin{3};
0035 if (nargin >= 4)
0036 lst.weight =varargin{4};
0037
0038 if (nargin > 4)
0039 warning('objective_function:extra_arg',...
0040 'Extra arguments for object of class ''%s''.',...
0041 class(lst));
0042 end
0043 end
0044 end
0045 end
0046 end
0047 end
0048
0049 end
0050 function [desc] =dresp_desc(lst)
0051 desc=cell(size(lst));
0052 for i=1:numel(lst)
0053 desc(i)=cellstr(lst(i).descriptor);
0054 end
0055 end
0056 function [stype ]=dresp_stype(lst)
0057 stype=cell(size(lst));
0058 for i=1:numel(lst)
0059 stype(i)=cellstr(lst(i).scale_type);
0060 end
0061 end
0062 function [scale] =dresp_scale(lst)
0063 scale=zeros(size(lst));
0064 for i=1:numel(lst)
0065 scale(i)=lst(i).scale;
0066 end
0067 end
0068 function [weight]=dresp_weight(lst)
0069 weight=zeros(size(lst));
0070 for i=1:numel(lst)
0071 weight(i)=lst(i).weight;
0072 end
0073 end
0074 function [lower] =dresp_lower(lst)
0075 lower=[];
0076 end
0077 function [upper] =dresp_upper(lst)
0078 upper=[];
0079 end
0080 function [target]=dresp_target(lst)
0081 target=[];
0082 end
0083 end
0084 end