export_arithmetic_statement.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
27 
34 #ifndef ACADO_TOOLKIT_EXPORT_ARITHMETIC_STATEMENT_HPP
35 #define ACADO_TOOLKIT_EXPORT_ARITHMETIC_STATEMENT_HPP
36 
40 
42 
60 {
61  friend class ExportVariable;
62 
63  //
64  // PUBLIC MEMBER FUNCTIONS:
65  //
66  public:
67 
71 
84  const ExportVariable& _rhs1,
86  const ExportVariable& _rhs2,
88  const ExportVariable& _rhs3 = 0
89  );
90 
92  virtual ~ExportArithmeticStatement( );
93 
98  virtual ExportStatement* clone( ) const;
99 
110  virtual returnValue exportDataDeclaration( std::ostream& stream,
111  const std::string& _realString = "real_t",
112  const std::string& _intString = "int",
113  int _precision = 16
114  ) const;
115 
126  virtual returnValue exportCode( std::ostream& stream,
127  const std::string& _realString = "real_t",
128  const std::string& _intString = "int",
129  int _precision = 16
130  ) const;
131 
133 
134  //
135  // PROTECTED MEMBER FUNCTIONS:
136  //
137  protected:
138 
150  returnValue exportCodeAddSubtract( std::ostream& stream,
151  const std::string& _sign = "+",
152  const std::string& _realString = "real_t",
153  const std::string& _intString = "int"
154  ) const;
155 
167  returnValue exportCodeMultiply( std::ostream& stream,
168  bool transposeRhs1 = false,
169  const std::string& _realString = "real_t",
170  const std::string& _intString = "int"
171  ) const;
172 
184  returnValue exportCodeAssign( std::ostream& stream,
185  const std::string& _op = "=",
186  const std::string& _realString = "real_t",
187  const std::string& _intString = "int"
188  ) const;
189 
190 
191  protected:
192 
193  // Refactor this guys as shared pointers
204 
205  private:
206  std::string getAssignString( ) const;
207 
208  uint getNumRows( ) const;
209  uint getNumCols( ) const;
210 };
211 
212 
214 
215 
216 #endif // ACADO_TOOLKIT_EXPORT_ARITHMETIC_STATEMENT_HPP
217 
218 // end of file.
ExportArithmeticStatement & allocate(MemoryAllocatorPtr allocator)
Allows to pass back messages to the calling function.
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
returnValue exportCodeAddSubtract(std::ostream &stream, const std::string &_sign="+", const std::string &_realString="real_t", const std::string &_intString="int") const
#define CLOSE_NAMESPACE_ACADO
returnValue exportCodeAssign(std::ostream &stream, const std::string &_op="=", const std::string &_realString="real_t", const std::string &_intString="int") const
Allows to export code of different arithmetic statements.
virtual returnValue exportCode(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
ExportStatementOperator
returnValue exportCodeMultiply(std::ostream &stream, bool transposeRhs1=false, const std::string &_realString="real_t", const std::string &_intString="int") const
Base class for all kind of statements to be exported by the code generation tool. ...
#define BEGIN_NAMESPACE_ACADO
virtual returnValue exportDataDeclaration(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
virtual ExportStatement * clone() const
std::shared_ptr< MemoryAllocator > MemoryAllocatorPtr
Defines a matrix-valued variable to be used for exporting code.


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:33