Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
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
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
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