DET overloads the determinant function for Analysis objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: DET overloads the determinant function for Analysis objects. CALL: a = det(a1) % only with cdata AOs PARAMETERS: see help for data2D/applymethod for additional parameters M-FILE INFO: Get information about this methods by calling >> ao.getInfo('det') Get information about a specified set-plist by calling: >> ao.getInfo('det', 'None') VERSION: $Id: det.m,v 1.24 2008/09/05 11:15:19 ingo Exp $ HISTORY: 08-05-07 A Monsky Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % DET overloads the determinant function for Analysis objects. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: DET overloads the determinant function for Analysis objects. 0005 % 0006 % CALL: a = det(a1) % only with cdata AOs 0007 % 0008 % PARAMETERS: see help for data2D/applymethod for additional parameters 0009 % 0010 % M-FILE INFO: Get information about this methods by calling 0011 % >> ao.getInfo('det') 0012 % 0013 % Get information about a specified set-plist by calling: 0014 % >> ao.getInfo('det', 'None') 0015 % 0016 % VERSION: $Id: det.m,v 1.24 2008/09/05 11:15:19 ingo Exp $ 0017 % 0018 % HISTORY: 08-05-07 A Monsky 0019 % Creation 0020 % 0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0022 0023 function varargout = det(varargin) 0024 0025 % Check if this is a call for parameters 0026 if utils.helper.isinfocall(varargin{:}) 0027 varargout{1} = getInfo(varargin{3}); 0028 return 0029 end 0030 0031 import utils.const.* 0032 utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename); 0033 0034 % Collect input variable names 0035 in_names = cell(size(varargin)); 0036 for ii = 1:nargin,in_names{ii} = inputname(ii);end 0037 0038 % Collect all AOs 0039 [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names); 0040 0041 % Decide on a deep copy or a modify 0042 bs = copy(as, nargout); 0043 0044 % go through analysis objects 0045 for j=1:numel(bs) 0046 if isa(bs(j).data, 'cdata') 0047 if size(bs(j).data.y,1) ~= size(bs(j).data.y,2) 0048 error('### The y data must be a square matrix.') 0049 end 0050 % Apply method to all AOs 0051 applymethod(bs(j), ao_invars(j), 'det', plist, getDefaultPlist, getInfo); 0052 else 0053 error('### this function works for cdata type AO only') 0054 end 0055 end 0056 0057 % Set outputs 0058 if nargout > 0 0059 varargout{1} = bs; 0060 end 0061 end 0062 0063 %-------------------------------------------------------------------------- 0064 % Get Info Object 0065 %-------------------------------------------------------------------------- 0066 function ii = getInfo(varargin) 0067 0068 if nargin == 1 && strcmpi(varargin{1}, 'None') 0069 sets = {}; 0070 pl = []; 0071 else 0072 sets = {'Default'}; 0073 pl = getDefaultPlist; 0074 end 0075 % Build info object 0076 ii = minfo(mfilename, 'ao', '', utils.const.categories.op, '$Id: det.m,v 1.24 2008/09/05 11:15:19 ingo Exp $', sets, pl); 0077 end 0078 0079 %-------------------------------------------------------------------------- 0080 % Get Default Plist 0081 %-------------------------------------------------------------------------- 0082 function pl = getDefaultPlist() 0083 pl = plist(); 0084 end 0085