export_gauss_newton_cn2.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 
00032 #ifndef ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CN2_HPP
00033 #define ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CN2_HPP
00034 
00035 #include <acado/code_generation/export_nlp_solver.hpp>
00036 
00037 BEGIN_NAMESPACE_ACADO
00038 
00048 class ExportGaussNewtonCN2 : public ExportNLPSolver
00049 {
00050 public:
00051 
00057         ExportGaussNewtonCN2(   UserInteraction* _userInteraction = 0,
00058                                                         const std::string& _commonHeaderName = ""
00059                                                         );
00060 
00062         virtual ~ExportGaussNewtonCN2( )
00063         {}
00064 
00069         virtual returnValue setup( );
00070 
00078         virtual returnValue getDataDeclarations(        ExportStatementBlock& declarations,
00079                                                                                                 ExportStruct dataStruct = ACADO_ANY
00080                                                                                                 ) const;
00081 
00089         virtual returnValue getFunctionDeclarations(    ExportStatementBlock& declarations
00090                                                                                                         ) const;
00091 
00092 
00100         virtual returnValue getCode(    ExportStatementBlock& code
00101                                                                         );
00102 
00103 
00108         unsigned getNumQPvars( ) const;
00109 
00114         virtual unsigned getNumStateBounds( ) const;
00115 
00116 protected:
00117 
00124         virtual returnValue setupObjectiveEvaluation( void );
00125 
00131         virtual returnValue setupConstraintsEvaluation( void );
00132 
00137         virtual returnValue setupVariables( );
00138 
00143         virtual returnValue setupMultiplicationRoutines( );
00144 
00149         virtual returnValue setupEvaluation( );
00150 
00151         virtual returnValue setupQPInterface( );
00152 
00153         virtual returnValue setupCondensing( );
00154 
00155         bool performFullCondensing( ) const;
00156 
00157 protected:
00158 
00159         ExportFunction evaluateObjective;
00160 
00161         ExportVariable x0, Dx0;
00162 
00163         ExportFunction setObjQ1Q2;
00164         ExportFunction setObjR1R2;
00165         ExportFunction setObjS1;
00166         ExportFunction setObjQN1QN2;
00167 
00169         ExportVariable H;
00171         ExportVariable A;
00172 
00174         ExportVariable g;
00175 
00177         ExportVariable lb;
00178 
00180         ExportVariable ub;
00181 
00183         ExportVariable lbA;
00184 
00186         ExportVariable ubA;
00187 
00189         ExportVariable xVars;
00190 
00192         ExportVariable yVars;
00193 
00194         std::vector< unsigned > xBoundsIdx;
00195         ExportVariable lbValues, ubValues;
00196         ExportVariable lbAValues, ubAValues;
00197 
00198         ExportFunction condensePrep;
00199         ExportFunction condenseFdb;
00200         ExportFunction expand;
00201 
00202         ExportVariable C, E, QDy, Qd;
00203 
00204         ExportFunction multGxd;
00205         ExportFunction moveGxT;
00206         ExportFunction multGxGx;
00207         ExportFunction multGxGu;
00208         ExportFunction moveGuE;
00209         ExportFunction copyHTH;
00210         ExportFunction copyHTH1;
00211         ExportFunction multQ1d;
00212         ExportFunction multQN1d;
00213         ExportFunction multRDy;
00214         ExportFunction multQDy;
00215         ExportFunction multEQDy;
00216         ExportFunction multQETGx;
00217         ExportFunction multEDu;
00218         ExportFunction multQ1Gx;
00219         ExportFunction multQN1Gx;
00220         ExportFunction multQ1Gu;
00221         ExportFunction multQN1Gu;
00222 
00223         ExportFunction preparation;
00224         ExportFunction feedback;
00225 
00226         ExportFunction getKKT;
00227 
00228         //
00229         // N2 condensing related
00230         //
00231         ExportVariable T1, T2, W1, W2;
00232         ExportVariable sbar, w1, w2;
00233 
00234         ExportFunction multBTW1, macBTW1_R1, multGxTGu, macQEW2, mac_S1T_E;
00235         ExportFunction macATw1QDy, macBTw1, macQSbarW2, macASbar, macS1TSbar;
00236         ExportFunction expansionStep;
00237 
00238         // lagrange multipliers
00239         ExportFunction expansionStep2;
00240 
00241         // H00 and H10 computations
00242         ExportFunction mult_BT_T1, mac_ST_C, multGxTGx, macGxTGx;
00243 };
00244 
00245 CLOSE_NAMESPACE_ACADO
00246 
00247 #endif  // ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CN2_HPP


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