dirk_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 
00035 #ifndef ACADO_TOOLKIT_DIRK_EXPORT_HPP
00036 #define ACADO_TOOLKIT_DIRK_EXPORT_HPP
00037 
00038 #include <acado/code_generation/integrators/irk_export.hpp>
00039 
00040 
00041 BEGIN_NAMESPACE_ACADO
00042 
00043 
00054 class DiagonallyImplicitRKExport : public ForwardIRKExport
00055 {
00056     //
00057     // PUBLIC MEMBER FUNCTIONS:
00058     //
00059 
00060     public:
00061 
00067         DiagonallyImplicitRKExport(     UserInteraction* _userInteraction = 0,
00068                                                         const std::string& _commonHeaderName = ""
00069                                                         );
00070 
00075         DiagonallyImplicitRKExport(     const DiagonallyImplicitRKExport& arg
00076                                                         );
00077 
00080         virtual ~DiagonallyImplicitRKExport( );
00081 
00082 
00087                 DiagonallyImplicitRKExport& operator=(  const DiagonallyImplicitRKExport& arg
00088                                                                                 );
00089 
00090 
00100                 virtual returnValue solveInputSystem(   ExportStatementBlock* block,
00101                                                                                 const ExportIndex& index1,
00102                                                                                 const ExportIndex& index2,
00103                                                                                 const ExportIndex& index3,
00104                                                                                 const ExportIndex& tmp_index,
00105                                                                                 const ExportVariable& Ah );
00106 
00107 
00114                 virtual returnValue prepareInputSystem( ExportStatementBlock& code );
00115 
00116 
00125                 virtual returnValue solveOutputSystem(  ExportStatementBlock* block,
00126                                                                                 const ExportIndex& index1,
00127                                                                                 const ExportIndex& index2,
00128                                                                                 const ExportIndex& index3,
00129                                                                                 const ExportIndex& tmp_index,
00130                                                                                 const ExportVariable& Ah,
00131                                                                                 bool DERIVATIVES = false );
00132 
00133 
00144                 virtual returnValue sensitivitiesOutputSystem(  ExportStatementBlock* block,
00145                                                                                                 const ExportIndex& index1,
00146                                                                                                 const ExportIndex& index2,
00147                                                                                                 const ExportIndex& index3,
00148                                                                                                 const ExportIndex& index4,
00149                                                                                                 const ExportIndex& tmp_index1,
00150                                                                                                 const ExportIndex& tmp_index2,
00151                                                                                                 const ExportVariable& Ah,
00152                                                                                                 const ExportVariable& Bh,
00153                                                                                                 bool STATES,
00154                                                                                                 uint number             );
00155 
00156 
00163                 virtual returnValue prepareOutputSystem( ExportStatementBlock& code );
00164 
00165 
00173                 virtual DMatrix formMatrix( const DMatrix& mass, const DMatrix& jacobian );
00174 
00175 
00184                 virtual returnValue solveImplicitSystem(        ExportStatementBlock* block,
00185                                                                                         const ExportIndex& index1,
00186                                                                                         const ExportIndex& index2,
00187                                                                                         const ExportIndex& index3,
00188                                                                                         const ExportIndex& tmp_index,
00189                                                                                         const ExportVariable& Ah,
00190                                                                                         const ExportVariable& C,
00191                                                                                         const ExportVariable& det,
00192                                                                                         bool DERIVATIVES = false        );
00193 
00194 
00206                 virtual returnValue sensitivitiesImplicitSystem(        ExportStatementBlock* block,
00207                                                                                                         const ExportIndex& index1,
00208                                                                                                         const ExportIndex& index2,
00209                                                                                                         const ExportIndex& index3,
00210                                                                                                         const ExportIndex& tmp_index1,
00211                                                                                                         const ExportIndex& tmp_index2,
00212                                                                                                         const ExportVariable& Ah,
00213                                                                                                         const ExportVariable& Bh,
00214                                                                                                         const ExportVariable& det,
00215                                                                                                         bool STATES,
00216                                                                                                         uint number             );
00217 
00218 
00230                 virtual returnValue evaluateMatrix(     ExportStatementBlock* block,
00231                                                                                 const ExportIndex& index1,
00232                                                                                 const ExportIndex& index2,
00233                                                                                 const ExportIndex& tmp_index,
00234                                                                                 const ExportVariable& Ah,
00235                                                                                 const ExportVariable& C,
00236                                                                                 bool evaluateB,
00237                                                                                 bool DERIVATIVES );
00238 
00239 
00248                 virtual returnValue evaluateStatesImplicitSystem(       ExportStatementBlock* block,
00249                                                                                         const ExportVariable& Ah,
00250                                                                                         const ExportVariable& C,
00251                                                                                         const ExportIndex& stage,
00252                                                                                         const ExportIndex& i,
00253                                                                                         const ExportIndex& j );
00254 
00255 
00263                 virtual returnValue evaluateRhsImplicitSystem(  ExportStatementBlock* block,
00264                                                                                                                 const ExportIndex& stage );
00265 
00266 
00271                 virtual returnValue setup( );
00272 
00273 
00274         protected:
00275                 
00276 
00277 
00278     protected:
00279     
00280 
00281 };
00282 
00283 
00284 //
00285 // Create the integrator
00286 //
00287 inline DiagonallyImplicitRKExport* createDiagonallyImplicitRKExport(    UserInteraction* _userInteraction,
00288                 const std::string &_commonHeaderName    )
00289 {
00290         int sensGen;
00291         _userInteraction->get( DYNAMIC_SENSITIVITY, sensGen );
00292         if ( (ExportSensitivityType)sensGen == FORWARD ) {
00293                 return new DiagonallyImplicitRKExport(_userInteraction, _commonHeaderName);
00294         }
00295         else {
00296                 ACADOERROR( RET_INVALID_OPTION );
00297                 return new DiagonallyImplicitRKExport(_userInteraction, _commonHeaderName);
00298         }
00299 }
00300 
00301 
00302 CLOSE_NAMESPACE_ACADO
00303 
00304 
00305 #endif  // ACADO_TOOLKIT_DIRK_EXPORT_HPP
00306 
00307 // end of file.


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