EIG overloads the determinant function for Analysis objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: EIG overloads the determinant function for Analysis objects. CALL: e = eig (a,pl) % only with data = cdata INPUTS: pl - a parameter list a - input analysis object OUTPUTS: like matlab function PARAMETERS: 'option' - a string or value that can be submited i.e. 'nobalance' to disable balancing options are the same as for the matlab function. REMARKS: See help for data2D/applymethod for additional parameters. M-FILE INFO: Get information about this methods by calling >> ao.getInfo('eig') Get information about a specified set-plist by calling: >> ao.getInfo('eig', 'None') VERSION: $Id: eig.m,v 1.26 2008/09/05 11:15:19 ingo Exp $ HISTORY: 08-05-07 A Monsky Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % EIG overloads the determinant function for Analysis objects. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: EIG overloads the determinant function for Analysis objects. 0005 % 0006 % CALL: e = eig (a,pl) % only with data = cdata 0007 % 0008 % INPUTS: pl - a parameter list 0009 % a - input analysis object 0010 % 0011 % OUTPUTS: like matlab function 0012 % 0013 % PARAMETERS: 'option' - a string or value that can be submited 0014 % i.e. 'nobalance' to disable balancing options are the 0015 % same as for the matlab function. 0016 % 0017 % REMARKS: See help for data2D/applymethod for additional parameters. 0018 % 0019 % M-FILE INFO: Get information about this methods by calling 0020 % >> ao.getInfo('eig') 0021 % 0022 % Get information about a specified set-plist by calling: 0023 % >> ao.getInfo('eig', 'None') 0024 % 0025 % VERSION: $Id: eig.m,v 1.26 2008/09/05 11:15:19 ingo Exp $ 0026 % 0027 % HISTORY: 08-05-07 A Monsky 0028 % Creation 0029 % 0030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0031 0032 % These options removed in the recoding. If we really need this feature 0033 % then I say that this method can't use the ao/applymethod() method, but 0034 % must be coded up individually. 0035 % [v, d] = eig (a,pl) 0036 % [v, d] = eig (a) 0037 0038 function varargout = eig(varargin) 0039 0040 % Check if this is a call for parameters 0041 if utils.helper.isinfocall(varargin{:}) 0042 varargout{1} = getInfo(varargin{3}); 0043 return 0044 end 0045 0046 import utils.const.* 0047 utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename); 0048 0049 % Collect input variable names 0050 in_names = cell(size(varargin)); 0051 for ii = 1:nargin,in_names{ii} = inputname(ii);end 0052 0053 % Collect all AOs 0054 [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names); 0055 pl = utils.helper.collect_objects(varargin(:), 'plist', in_names); 0056 0057 % Decide on a deep copy or a modify 0058 bs = copy(as, nargout); 0059 0060 % Combine plists 0061 pl = combine(pl, getDefaultPlist); 0062 0063 %% go through analysis objects 0064 for j=1:numel(bs) 0065 if isa(bs(j).data, 'cdata') 0066 if size(bs(j).data.y,1) ~= size(bs(j).data.y,2) 0067 error('### The y data must be a square matrix.') 0068 end 0069 % Apply method to all AOs 0070 applymethod(bs(j), ao_invars(j), 'eig', pl, getDefaultPlist, getInfo); 0071 else 0072 error('### this function works for cdata type AO only') 0073 end 0074 end 0075 0076 % Set output 0077 if nargout > 0 0078 varargout{1} = bs; 0079 end 0080 end 0081 0082 %-------------------------------------------------------------------------- 0083 % Get Info Object 0084 %-------------------------------------------------------------------------- 0085 function ii = getInfo(varargin) 0086 if nargin == 1 && strcmpi(varargin{1}, 'None') 0087 sets = {}; 0088 pl = []; 0089 else 0090 sets = {'Default'}; 0091 pl = getDefaultPlist; 0092 end 0093 % Build info object 0094 ii = minfo(mfilename, 'ao', '', utils.const.categories.op, '$Id: eig.m,v 1.26 2008/09/05 11:15:19 ingo Exp $', sets, pl); 0095 end 0096 0097 %-------------------------------------------------------------------------- 0098 % Get Default Plist 0099 %-------------------------------------------------------------------------- 0100 function pl = getDefaultPlist() 0101 pl = plist('option', ''); 0102 end 0103 0104