


Product of expressions.
Usage:
>> Product(obj1, obj2);
Parameters:
obj1 [Expression]
obj2 [Expression]
Licence:
This file is part of ACADO Toolkit - (http://www.acadotoolkit.org/)
ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
Copyright (C) 2008-2009 by Boris Houska and Hans Joachim Ferreau, K.U.Leuven.
Developed within the Optimization in Engineering Center (OPTEC) under
supervision of Moritz Diehl. All rights reserved.
ACADO Toolkit is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
ACADO Toolkit is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with ACADO Toolkit; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Author: David Ariens
Date: 2009


0001 %Product of expressions. 0002 % 0003 % Usage: 0004 % >> Product(obj1, obj2); 0005 % 0006 % Parameters: 0007 % obj1 [Expression] 0008 % obj2 [Expression] 0009 % 0010 % Licence: 0011 % This file is part of ACADO Toolkit - (http://www.acadotoolkit.org/) 0012 % 0013 % ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. 0014 % Copyright (C) 2008-2009 by Boris Houska and Hans Joachim Ferreau, K.U.Leuven. 0015 % Developed within the Optimization in Engineering Center (OPTEC) under 0016 % supervision of Moritz Diehl. All rights reserved. 0017 % 0018 % ACADO Toolkit is free software; you can redistribute it and/or 0019 % modify it under the terms of the GNU Lesser General Public 0020 % License as published by the Free Software Foundation; either 0021 % version 3 of the License, or (at your option) any later version. 0022 % 0023 % ACADO Toolkit is distributed in the hope that it will be useful, 0024 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0025 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0026 % Lesser General Public License for more details. 0027 % 0028 % You should have received a copy of the GNU Lesser General Public 0029 % License along with ACADO Toolkit; if not, write to the Free Software 0030 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 0031 % 0032 % Author: David Ariens 0033 % Date: 2009 0034 % 0035 classdef Product < acado.BinaryOperator 0036 properties(SetAccess='private') 0037 0038 end 0039 0040 methods 0041 function obj = Product(obj1, obj2) 0042 if (isa(obj1, 'numeric')) 0043 obj1 = acado.DoubleConstant(obj1); 0044 elseif (isa(obj2, 'numeric')) 0045 obj2 = acado.DoubleConstant(obj2); 0046 end 0047 0048 obj.obj1 = obj1; 0049 obj.obj2 = obj2; 0050 end 0051 0052 function s = toString(obj) 0053 s = sprintf(' (%s)*(%s) ', obj.obj1.toString, obj.obj2.toString); 0054 end 0055 end 0056 0057 end 0058