bfgs_update.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 
00034 #ifndef ACADO_TOOLKIT_BFGS_UPDATE_HPP
00035 #define ACADO_TOOLKIT_BFGS_UPDATE_HPP
00036 
00037 
00038 #include <acado/utils/acado_utils.hpp>
00039 #include <acado/nlp_derivative_approximation/constant_hessian.hpp>
00040 
00041 
00042 BEGIN_NAMESPACE_ACADO
00043 
00044 
00048 enum BFGSModificationType{
00049 
00050     MOD_POWELLS_MODIFICATION,   
00051     MOD_NOCEDALS_MODIFICATION,  
00052     MOD_NO_MODIFICATION         
00053 };
00054 
00055 
00056 
00067 class BFGSupdate : public ConstantHessian
00068 {
00069 
00070     //
00071     // PUBLIC MEMBER FUNCTIONS:
00072     //
00073     public:
00074 
00076         BFGSupdate( );
00077                 
00079         BFGSupdate(     UserInteraction* _userInteraction,
00080                                         uint _nBlocks = 0
00081                                         );
00082 
00084         BFGSupdate( const BFGSupdate& rhs );
00085 
00087         virtual ~BFGSupdate( );
00088 
00090         BFGSupdate& operator=( const BFGSupdate& rhs );
00091 
00092                 virtual NLPderivativeApproximation* clone( ) const;
00093 
00094 
00095 
00096         virtual returnValue initHessian(        BlockMatrix& B,             
00097                                                                                         uint N,                 
00098                                                                                         const OCPiterate& iter  
00099                                                                                         );
00100 
00113         virtual returnValue initScaling(        BlockMatrix& B, 
00114                                                                                         const BlockMatrix& x, 
00115                                                                                         const BlockMatrix& y  
00116                                                                                         );
00117 
00118 
00123         virtual returnValue apply(       BlockMatrix &B, 
00124                                    const BlockMatrix &x, 
00125                                    const BlockMatrix &y   );
00126 
00127 
00128 
00129         inline returnValue setBFGSModification( const BFGSModificationType &modification_
00130                                                                                                 );
00131 
00132 
00133                 inline BooleanType performsBlockUpdates( ) const;
00134 
00135 
00136 
00137 
00138 
00139     //
00140     // PROTECTED MEMBER FUNCTIONS:
00141     //
00142     protected:
00143 
00144 
00145 
00152         virtual returnValue applyUpdate(        BlockMatrix &B, 
00153                                                                                         const BlockMatrix &x, 
00154                                                                                         const BlockMatrix &y  
00155                                                                                         );
00156 
00157 
00158 
00166         virtual returnValue applyBlockDiagonalUpdate(   BlockMatrix &B, 
00167                                                                                                                 const BlockMatrix &x, 
00168                                                                                                                 const BlockMatrix &y  
00169                                                                                                                 );
00170 
00171 
00172 
00173         returnValue getSubBlockLine( const int         &N     ,
00174                                      const int         &line1 ,
00175                                      const int         &line2 ,
00176                                      const int         &offset,
00177                                      const BlockMatrix &M     ,
00178                                            BlockMatrix &x      );
00179 
00180         returnValue setSubBlockLine( const int         &N     ,
00181                                      const int         &line1 ,
00182                                      const int         &line2 ,
00183                                      const int         &offset,
00184                                            BlockMatrix &M     ,
00185                                      const BlockMatrix &x      );
00186 
00187 
00188     //
00189     // PROTECTED DATA MEMBERS:
00190     //
00191     protected:
00192 
00193                 BFGSModificationType modification;
00194 
00195                 uint nBlocks;
00196 
00197 };
00198 
00199 
00200 CLOSE_NAMESPACE_ACADO
00201 
00202 #include <acado/nlp_derivative_approximation/bfgs_update.ipp>
00203 
00204 
00205 #endif  // ACADO_TOOLKIT_BFGS_UPDATE_HPP
00206 
00207 /*
00208  *  end of file
00209  */


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