export_for_loop.hpp
Go to the documentation of this file.
00001 /*
00002  *    This file is part of ACADO Toolkit.
00003  *
00004  *    ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
00005  *    Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
00006  *    Milan Vukov, Rien Quirynen, KU Leuven.
00007  *    Developed within the Optimization in Engineering Center (OPTEC)
00008  *    under supervision of Moritz Diehl. All rights reserved.
00009  *
00010  *    ACADO Toolkit is free software; you can redistribute it and/or
00011  *    modify it under the terms of the GNU Lesser General Public
00012  *    License as published by the Free Software Foundation; either
00013  *    version 3 of the License, or (at your option) any later version.
00014  *
00015  *    ACADO Toolkit is distributed in the hope that it will be useful,
00016  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *    Lesser General Public License for more details.
00019  *
00020  *    You should have received a copy of the GNU Lesser General Public
00021  *    License along with ACADO Toolkit; if not, write to the Free Software
00022  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  */
00025 
00026 
00035 #ifndef ACADO_TOOLKIT_EXPORT_FOR_LOOP_HPP
00036 #define ACADO_TOOLKIT_EXPORT_FOR_LOOP_HPP
00037 
00038 
00039 #include <acado/utils/acado_utils.hpp>
00040 #include <acado/code_generation/export_index.hpp>
00041 #include <acado/code_generation/export_statement_block.hpp>
00042 
00043 
00044 BEGIN_NAMESPACE_ACADO
00045 
00046 
00056 class ExportForLoop : public ExportStatementBlock
00057 {
00058         //
00059         // PUBLIC MEMBER FUNCTIONS:
00060         //
00061         public:
00062 
00072                 ExportForLoop(  const ExportIndex& _loopVariable = emptyConstExportIndex,
00073                                                 const ExportIndex& _startValue = emptyConstExportIndex,
00074                                                 const ExportIndex& _finalValue = emptyConstExportIndex,
00075                                                 const ExportIndex& _increment = constExportIndexValueOne,
00076                                                 bool _doLoopUnrolling = false
00077                                                 );
00078 
00083                 ExportForLoop(  const ExportForLoop& arg
00084                                                 );
00085 
00088                 virtual ~ExportForLoop( );
00089 
00094                 ExportForLoop& operator=(       const ExportForLoop& arg
00095                                                                         );
00096 
00101                 virtual ExportStatement* clone( ) const;
00102 
00111                 returnValue init(       const ExportIndex& _loopVariable,
00112                                                         const ExportIndex& _startValue,
00113                                                         const ExportIndex& _finalValue,
00114                                                         const ExportIndex& _increment,
00115                                                         bool _doLoopUnrolling
00116                                                         );
00117 
00118 
00129                 virtual returnValue exportDataDeclaration(      std::ostream& stream,
00130                                                                                                         const std::string& _realString = "real_t",
00131                                                                                                         const std::string& _intString = "int",
00132                                                                                                         int _precision = 16
00133                                                                                                         ) const;
00134 
00145                 virtual returnValue exportCode( std::ostream& stream,
00146                                                                                 const std::string& _realString = "real_t",
00147                                                                                 const std::string& _intString = "int",
00148                                                                                 int _precision = 16
00149                                                                                 ) const;
00150 
00151 
00156                 ExportForLoop& unrollLoop( );
00157 
00162                 ExportForLoop& keepLoop( );
00163 
00164                 ExportForLoop& allocate(MemoryAllocatorPtr allocator);
00165 
00166 
00167         //
00168         // PROTECTED MEMBER FUNCTIONS:
00169         //
00170         protected:
00171 
00176                 returnValue clear( );
00177 
00178         private:
00179 
00180                 returnValue sanityCheck( void ) const;
00181 
00182         //
00183         // DATA MEMBERS:
00184         //
00185         protected:
00186 
00187                 ExportIndex loopVariable;               
00188                 ExportIndex startValue;                 
00189                 ExportIndex finalValue;                 
00190                 ExportIndex increment;                  
00192                 bool doLoopUnrolling;   
00193 };
00194 
00195 
00196 CLOSE_NAMESPACE_ACADO
00197 
00198 
00199 
00200 #endif  // ACADO_TOOLKIT_EXPORT_FOR_LOOP_HPP
00201 
00202 
00203 /*
00204  *      end of file
00205  */


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 11:58:09