comparison m-toolbox/classes/@ao/mtimes.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % MTIMES implements mtimes operator for analysis objects.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: MTIMES implements mtimes operator for analysis objects.
5 %
6 % CALL: a = a1*scalar
7 % a = a1*a2
8 %
9 % <a href="matlab:utils.helper.displayMethodInfo('ao', 'mtimes')">Parameters Description</a>
10 %
11 % VERSION: $Id: mtimes.m,v 1.40 2011/04/08 08:56:17 hewitson Exp $
12 %
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
15 function varargout = mtimes(varargin)
16
17 % Settings
18 op = 'mtimes';
19 opname = 'matrix multiply';
20 opsym = '*';
21
22 if nargout == 0
23 error('### A %s operator can not be used as a modifier.', opname);
24 end
25
26 callerIsMethod = utils.helper.callerIsMethod;
27
28 if callerIsMethod
29 aosNames = {};
30 else
31 % collect input variable names
32 for ii = 1:nargin,aosNames{ii} = inputname(ii);end
33 end
34
35 % apply operator
36 res = ao.elementOp(callerIsMethod, @getInfo, @getDefaultPlist, op, opname, opsym, aosNames, varargin(:));
37
38 % Set output
39 varargout = utils.helper.setoutputs(nargout, res);
40
41 end
42
43 %--------------------------------------------------------------------------
44 % Get Info Object
45 %--------------------------------------------------------------------------
46 function ii = getInfo(varargin)
47
48 if nargin == 1 && strcmpi(varargin{1}, 'None')
49 sets = {};
50 pls = [];
51 else
52 sets = {'Default'};
53 pls = getDefaultPlist;
54 end
55 % Build info object
56 ii = minfo(mfilename, 'ao', 'ltpda', utils.const.categories.aop, '$Id: mtimes.m,v 1.40 2011/04/08 08:56:17 hewitson Exp $', sets, pls);
57 ii.setArgsmin(2);
58 ii.setModifier(false);
59 end
60
61 %--------------------------------------------------------------------------
62 % Get Default Plist
63 %--------------------------------------------------------------------------
64 function plout = getDefaultPlist()
65 persistent pl;
66 if ~exist('pl', 'var') || isempty(pl)
67 pl = buildplist();
68 end
69 plout = pl;
70 end
71
72 function pl = buildplist()
73 pl = plist.EMPTY_PLIST;
74 end
75 % END
76