Mercurial > hg > ltpda
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@ao/mtimes.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,76 @@ +% MTIMES implements mtimes operator for analysis objects. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION: MTIMES implements mtimes operator for analysis objects. +% +% CALL: a = a1*scalar +% a = a1*a2 +% +% <a href="matlab:utils.helper.displayMethodInfo('ao', 'mtimes')">Parameters Description</a> +% +% VERSION: $Id: mtimes.m,v 1.40 2011/04/08 08:56:17 hewitson Exp $ +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function varargout = mtimes(varargin) + + % Settings + op = 'mtimes'; + opname = 'matrix multiply'; + opsym = '*'; + + if nargout == 0 + error('### A %s operator can not be used as a modifier.', opname); + end + + callerIsMethod = utils.helper.callerIsMethod; + + if callerIsMethod + aosNames = {}; + else + % collect input variable names + for ii = 1:nargin,aosNames{ii} = inputname(ii);end + end + + % apply operator + res = ao.elementOp(callerIsMethod, @getInfo, @getDefaultPlist, op, opname, opsym, aosNames, varargin(:)); + + % Set output + varargout = utils.helper.setoutputs(nargout, res); + +end + +%-------------------------------------------------------------------------- +% Get Info Object +%-------------------------------------------------------------------------- +function ii = getInfo(varargin) + + if nargin == 1 && strcmpi(varargin{1}, 'None') + sets = {}; + pls = []; + else + sets = {'Default'}; + pls = getDefaultPlist; + end + % Build info object + 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); + ii.setArgsmin(2); + ii.setModifier(false); +end + +%-------------------------------------------------------------------------- +% Get Default Plist +%-------------------------------------------------------------------------- +function plout = getDefaultPlist() + persistent pl; + if ~exist('pl', 'var') || isempty(pl) + pl = buildplist(); + end + plout = pl; +end + +function pl = buildplist() + pl = plist.EMPTY_PLIST; +end +% END +