linear_solver_export.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 
00027 
00034 #ifndef ACADO_TOOLKIT_EXPORT_LINEAR_SOLVER_HPP
00035 #define ACADO_TOOLKIT_EXPORT_LINEAR_SOLVER_HPP
00036 
00037 #include <acado/code_generation/export_acado_function.hpp>
00038 #include <acado/code_generation/export_variable.hpp>
00039 #include <acado/code_generation/export_algorithm.hpp>
00040 #include <acado/code_generation/export_arithmetic_statement.hpp>
00041 #include <acado/code_generation/export_function_call.hpp>
00042 #include <acado/code_generation/export_for_loop.hpp>
00043 #include <acado/function/function.hpp>
00044 
00045 #include <acado/user_interaction/options.hpp>
00046 
00047 
00048 BEGIN_NAMESPACE_ACADO
00049 
00050 
00062 class ExportLinearSolver : public ExportAlgorithm
00063 {
00064     //
00065     // PUBLIC MEMBER FUNCTIONS:
00066     //
00067     public:
00068 
00074         ExportLinearSolver(     UserInteraction* _userInteraction = 0,
00075                                                         const std::string& _commonHeaderName = ""
00076                                                         );
00077 
00079         virtual ~ExportLinearSolver( );
00080 
00085                 virtual returnValue setup( ) = 0;
00086 
00087 
00099                 returnValue init(       const uint newDim,
00100                                                         const bool& reuse = true,
00101                                                         const bool& unrolling = false
00102                                                         );
00103 
00104 
00117                 returnValue init(       const uint newDim,
00118                                                         const bool& reuse,
00119                                                         const bool& unrolling,
00120                                                         const std::string& newId
00121                                                         );
00122 
00124                 returnValue init(       unsigned _nRows,
00125                                                         unsigned _nCols,
00126                                                         unsigned _nBacksolves,
00127                                                         bool _reuse,
00128                                                         bool _unroll,
00129                                                         const std::string& _id
00130                                                         );
00131 
00138                 virtual returnValue getDataDeclarations(        ExportStatementBlock& declarations,
00139                                                                                                         ExportStruct dataStruct = ACADO_ANY
00140                                                                                                         ) const = 0;
00141 
00142 
00149                 virtual returnValue getFunctionDeclarations(    ExportStatementBlock& declarations
00150                                                                                                                 ) const = 0;
00151 
00152 
00159                 virtual returnValue getCode(    ExportStatementBlock& code
00160                                                                                 ) = 0;
00161 
00162 
00169                 virtual returnValue appendVariableNames( std::stringstream& string ) = 0;
00170 
00171 
00176                 uint getDim() const;
00177 
00178 
00183                 virtual ExportVariable getGlobalExportVariable( const uint factor ) const;
00184                 
00185                 
00190                 bool getReuse() const;
00191                 
00192                 
00199                 returnValue setReuse( const bool& reuse );
00200                 
00201                 
00208                 bool getUnrolling() const;
00209                 
00210                 
00218                 returnValue setUnrolling( const bool& unrolling );
00219                 
00220                 
00225                 const std::string getNameSolveFunction(); 
00226                 
00227                 
00234                 const std::string getNameSolveReuseFunction(); 
00235 
00236 
00237         //
00238     // PROTECTED MEMBER FUNCTIONS:
00239     //
00240     protected:
00241 
00242 
00243     protected:
00244     
00245                 std::string identifier;                                                 
00247                 bool UNROLLING;                                         
00248                 bool REUSE;                                                     
00249                 uint dim;                                                                       
00251                 unsigned nRows;                                                         
00252                 unsigned nCols;                                                         
00253                 unsigned nBacksolves;                                           
00255                 // DEFINITION OF THE EXPORTVARIABLES
00256                 ExportVariable A;                                                       
00257                 ExportVariable b;                                                       
00259                 ExportFunction solve;                                           
00260                 ExportFunction solveTriangular;                         
00261                 ExportFunction solveReuse;                                      
00263                 ExportVariable determinant;                                     
00264 };
00265 
00266 
00267 CLOSE_NAMESPACE_ACADO
00268 
00269 
00270 #endif  // ACADO_TOOLKIT_EXPORT_LINEAR_SOLVER_HPP
00271 
00272 // end of file.


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:37:51