export_for_loop.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 
35 #ifndef ACADO_TOOLKIT_EXPORT_FOR_LOOP_HPP
36 #define ACADO_TOOLKIT_EXPORT_FOR_LOOP_HPP
37 
38 
42 
43 
45 
46 
57 {
58  //
59  // PUBLIC MEMBER FUNCTIONS:
60  //
61  public:
62 
72  ExportForLoop( const ExportIndex& _loopVariable = emptyConstExportIndex,
73  const ExportIndex& _startValue = emptyConstExportIndex,
74  const ExportIndex& _finalValue = emptyConstExportIndex,
75  const ExportIndex& _increment = constExportIndexValueOne,
76  bool _doLoopUnrolling = false
77  );
78 
83  ExportForLoop( const ExportForLoop& arg
84  );
85 
88  virtual ~ExportForLoop( );
89 
95  );
96 
101  virtual ExportStatement* clone( ) const;
102 
111  returnValue init( const ExportIndex& _loopVariable,
112  const ExportIndex& _startValue,
113  const ExportIndex& _finalValue,
114  const ExportIndex& _increment,
115  bool _doLoopUnrolling
116  );
117 
118 
129  virtual returnValue exportDataDeclaration( std::ostream& stream,
130  const std::string& _realString = "real_t",
131  const std::string& _intString = "int",
132  int _precision = 16
133  ) const;
134 
145  virtual returnValue exportCode( std::ostream& stream,
146  const std::string& _realString = "real_t",
147  const std::string& _intString = "int",
148  int _precision = 16
149  ) const;
150 
151 
157 
163 
165 
166 
167  //
168  // PROTECTED MEMBER FUNCTIONS:
169  //
170  protected:
171 
176  returnValue clear( );
177 
178  private:
179 
180  returnValue sanityCheck( void ) const;
181 
182  //
183  // DATA MEMBERS:
184  //
185  protected:
186 
193 };
194 
195 
197 
198 
199 
200 #endif // ACADO_TOOLKIT_EXPORT_FOR_LOOP_HPP
201 
202 
203 /*
204  * end of file
205  */
ExportIndex loopVariable
ExportForLoop & allocate(MemoryAllocatorPtr allocator)
Allows to pass back messages to the calling function.
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
Allows to export code of a for-loop.
#define CLOSE_NAMESPACE_ACADO
Defines a scalar-valued index variable to be used for exporting code.
const ExportIndex emptyConstExportIndex(int(0))
virtual returnValue exportCode(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
ExportIndex finalValue
returnValue sanityCheck(void) const
virtual ~ExportForLoop()
ExportForLoop(const ExportIndex &_loopVariable=emptyConstExportIndex, const ExportIndex &_startValue=emptyConstExportIndex, const ExportIndex &_finalValue=emptyConstExportIndex, const ExportIndex &_increment=constExportIndexValueOne, bool _doLoopUnrolling=false)
ExportForLoop & unrollLoop()
returnValue clear()
Base class for all kind of statements to be exported by the code generation tool. ...
ExportForLoop & operator=(const ExportForLoop &arg)
const ExportIndex constExportIndexValueOne(int(1))
ExportIndex startValue
#define BEGIN_NAMESPACE_ACADO
ExportIndex increment
returnValue init(const ExportIndex &_loopVariable, const ExportIndex &_startValue, const ExportIndex &_finalValue, const ExportIndex &_increment, bool _doLoopUnrolling)
ExportForLoop & keepLoop()
std::shared_ptr< MemoryAllocator > MemoryAllocatorPtr
Allows to export code for a block of statements.


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