export_acado_function.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 
32 #ifndef ACADO_TOOLKIT_EXPORT_ODE_FUNCTION_HPP
33 #define ACADO_TOOLKIT_EXPORT_ODE_FUNCTION_HPP
34 
36 
38 
39 class Function;
40 
51 {
52 public:
55 
62  ExportAcadoFunction( const Function& _f,
63  const std::string& _name = "acadoFcn"
64  );
65 
76  ExportAcadoFunction( const std::string& _name
77  );
78 
80  virtual ~ExportAcadoFunction( );
81 
86  virtual ExportStatement* clone( ) const;
87 
100  returnValue init( const Function& _f,
101  const std::string& _name = "acadoFcn",
102  const uint _numX = 0,
103  const uint _numXA = 0,
104  const uint _numU = 0,
105  const uint _numP = 0,
106  const uint _numDX = 0,
107  const uint _numOD = 0
108  );
109 
120  virtual returnValue exportDataDeclaration( std::ostream& stream,
121  const std::string& _realString = "real_t",
122  const std::string& _intString = "int",
123  int _precision = 16
124  ) const;
125 
136  virtual returnValue exportForwardDeclaration( std::ostream& stream,
137  const std::string& _realString = "real_t",
138  const std::string& _intString = "int",
139  int _precision = 16
140  ) const;
141 
152  virtual returnValue exportCode( std::ostream& stream,
153  const std::string& _realString = "real_t",
154  const std::string& _intString = "int",
155  int _precision = 16
156  ) const;
157 
163  virtual bool isDefined( ) const;
164 
166  unsigned getFunctionDim( void );
167 
170 
173 
175  bool isExternal() const;
176 
177 protected:
181  unsigned numX;
184  unsigned numXA;
187  unsigned numU;
189  unsigned numP;
192  unsigned numDX;
194  unsigned numOD;
196  std::shared_ptr< Function > f;
200  bool external;
201 };
202 
204 
205 #endif // ACADO_TOOLKIT_EXPORT_FUNCTION_HPP
virtual returnValue exportDataDeclaration(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
Allows to setup and evaluate a general function based on SymbolicExpressions.
Definition: function_.hpp:59
ExportVariable getGlobalExportVariable() const
Allows to export code of an ACADO function.
Allows to pass back messages to the calling function.
virtual ExportStatement * clone() const
std::shared_ptr< Function > f
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
#define CLOSE_NAMESPACE_ACADO
Base class for all kind of statements to be exported by the code generation tool. ...
Allows to export code of an arbitrary function.
returnValue setGlobalExportVariable(const ExportVariable &var)
#define BEGIN_NAMESPACE_ACADO
virtual bool isDefined() const
virtual returnValue exportCode(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
virtual returnValue exportForwardDeclaration(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
returnValue init(const Function &_f, const std::string &_name="acadoFcn", const uint _numX=0, const uint _numXA=0, const uint _numU=0, const uint _numP=0, const uint _numDX=0, const uint _numOD=0)
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