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
00035 #ifndef ACADO_TOOLKIT_IRK_FORWARD_EXPORT_HPP
00036 #define ACADO_TOOLKIT_IRK_FORWARD_EXPORT_HPP
00037
00038 #include <acado/code_generation/integrators/irk_export.hpp>
00039 #include <acado/code_generation/integrators/rk_sensitivities_export.hpp>
00040 #include <acado/code_generation/linear_solvers/linear_solver_generation.hpp>
00041
00042
00043 BEGIN_NAMESPACE_ACADO
00044
00055 class ForwardIRKExport : public ImplicitRungeKuttaExport, public RKSensitivitiesExport
00056 {
00057
00058
00059
00060
00061 public:
00062
00068 ForwardIRKExport( UserInteraction* _userInteraction = 0,
00069 const std::string& _commonHeaderName = ""
00070 );
00071
00076 ForwardIRKExport( const ForwardIRKExport& arg
00077 );
00078
00081 virtual ~ForwardIRKExport( );
00082
00083
00088 ForwardIRKExport& operator=( const ForwardIRKExport& arg
00089 );
00090
00091
00096 virtual returnValue setup( );
00097
00098
00105 virtual returnValue getDataDeclarations( ExportStatementBlock& declarations,
00106 ExportStruct dataStruct = ACADO_ANY
00107 ) const;
00108
00109
00116 virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations
00117 ) const;
00118
00119
00120
00127 virtual returnValue getCode( ExportStatementBlock& code
00128 );
00129
00130
00131 protected:
00132
00133
00142 returnValue getCRSIndex( uint output, ExportIndex row, ExportIndex col );
00143
00144
00151 virtual returnValue prepareInputSystem( ExportStatementBlock& code );
00152
00153
00160 virtual returnValue prepareOutputSystem( ExportStatementBlock& code );
00161
00162
00171 virtual returnValue sensitivitiesInputSystem( ExportStatementBlock* block,
00172 const ExportIndex& index1,
00173 const ExportIndex& index2,
00174 const ExportVariable& Bh,
00175 bool STATES );
00176
00177
00189 virtual returnValue sensitivitiesImplicitSystem( ExportStatementBlock* block,
00190 const ExportIndex& index1,
00191 const ExportIndex& index2,
00192 const ExportIndex& index3,
00193 const ExportIndex& tmp_index1,
00194 const ExportIndex& tmp_index2,
00195 const ExportVariable& Ah,
00196 const ExportVariable& Bh,
00197 const ExportVariable& det,
00198 bool STATES,
00199 uint number );
00200
00201
00212 virtual returnValue sensitivitiesOutputSystem( ExportStatementBlock* block,
00213 const ExportIndex& index1,
00214 const ExportIndex& index2,
00215 const ExportIndex& index3,
00216 const ExportIndex& index4,
00217 const ExportIndex& tmp_index1,
00218 const ExportIndex& tmp_index2,
00219 const ExportVariable& Ah,
00220 const ExportVariable& Bh,
00221 bool STATES,
00222 uint number );
00223
00224
00236 returnValue sensitivitiesOutputs( ExportStatementBlock* block,
00237 const ExportIndex& index0,
00238 const ExportIndex& index1,
00239 const ExportIndex& index2,
00240 const ExportIndex& tmp_index1,
00241 const ExportIndex& tmp_index2,
00242 const ExportIndex& tmp_index3,
00243 const ExportVariable& tmp_meas,
00244 const ExportVariable& time_tmp,
00245 bool STATES,
00246 uint base );
00247
00248
00256 virtual returnValue propagateOutputs( ExportStatementBlock* block,
00257 const ExportIndex& index,
00258 const ExportIndex& index0,
00259 const ExportIndex& index1,
00260 const ExportIndex& index2,
00261 const ExportIndex& index3,
00262 const ExportIndex& tmp_index1,
00263 const ExportIndex& tmp_index2,
00264 const ExportIndex& tmp_index3,
00265 const ExportIndex& tmp_index4,
00266 const ExportVariable& tmp_meas );
00267
00268
00273 ExportVariable getAuxVariable() const;
00274
00275
00276 protected:
00277
00278
00279 };
00280
00281
00282 CLOSE_NAMESPACE_ACADO
00283
00284
00285 #endif // ACADO_TOOLKIT_IRK_FORWARD_EXPORT_HPP
00286
00287