constraint_element.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_CONSTRAINT_ELEMENT_HPP
00036 #define ACADO_TOOLKIT_CONSTRAINT_ELEMENT_HPP
00037 
00038 
00039 #include <acado/symbolic_expression/expression.hpp>
00040 #include <acado/function/function.hpp>
00041 #include <acado/variables_grid/variables_grid.hpp>
00042 
00043 
00044 BEGIN_NAMESPACE_ACADO
00045 
00046 
00057 class ConstraintElement{
00058 
00059     //
00060     // PUBLIC MEMBER FUNCTIONS:
00061     //
00062     public:
00063 
00065         ConstraintElement( );
00066 
00068         ConstraintElement( const Grid& grid_, int nFcn_, int nB_ );
00069 
00071         ConstraintElement( const ConstraintElement& rhs );
00072 
00074         virtual ~ConstraintElement( );
00075 
00077         ConstraintElement& operator=( const ConstraintElement& rhs );
00078 
00079 
00080 
00081 // ==========================================================================
00082 //
00083 //                               INITIALIZATION
00084 //
00085 // ==========================================================================
00086 
00087 
00092         returnValue init(  const OCPiterate& iter  );
00093 
00094 
00095 
00096 // =======================================================================================
00097 //
00098 //                                  DEFINITION OF SEEDS:
00099 //
00100 // =======================================================================================
00101 
00102 
00103 
00109     virtual returnValue setForwardSeed( BlockMatrix *xSeed_ ,   
00110                                         BlockMatrix *xaSeed_,   
00111                                         BlockMatrix *pSeed_ ,   
00112                                         BlockMatrix *uSeed_ ,   
00113                                         BlockMatrix *wSeed_ ,   
00114                                         int          order       );
00115 
00116 
00117 
00124     virtual returnValue setUnitForwardSeed( );
00125 
00126 
00127 
00133     virtual returnValue setBackwardSeed( BlockMatrix *seed,    
00134                                          int          order      );
00135 
00136 
00137 
00138 
00139 
00140 
00141 // =======================================================================================
00142 //
00143 //                               RESULTS OF THE EVALUATION
00144 //
00145 // =======================================================================================
00146 
00147 
00152     virtual returnValue getResiduum( BlockMatrix &lower_residuum, 
00153                                      BlockMatrix &upper_residuum   );
00154 
00155 
00156 
00162     virtual returnValue getForwardSensitivities( BlockMatrix *D  ,
00165                                                  int order         );
00166 
00167 
00168 
00174     virtual returnValue getBackwardSensitivities( BlockMatrix *D  ,
00177                                                   int order         );
00178 
00179 
00180 
00181 
00182 //  =========================================================================
00183 //
00184 //                               MISCELLANEOUS:
00185 //
00186 //  =========================================================================
00187 
00188 
00190         inline Grid& getGrid();
00191 
00195         inline int getNX    () const;
00196 
00200         inline int getNXA   () const;
00201 
00205         inline int getNU   () const;
00206 
00210         inline int getNP   () const;
00211 
00215         inline int getNW  () const;
00216 
00217 
00218 
00220         inline BooleanType isAffine() const;
00221 
00222         returnValue get(Function& function_, DMatrix& lb_, DMatrix& ub_);
00223 
00224 // ==========================================================================
00225 //
00226 //                          PROTECTED MEMBER FUNCTIONS:
00227 //
00228 // ==========================================================================
00229 
00230     protected:
00231 
00232                 virtual returnValue initializeEvaluationPoints( const OCPiterate& iter
00233                                                                                                                 );
00234 
00235 
00236 
00237     //
00238     // DATA MEMBERS:
00239     //
00240     protected:
00241 
00242 
00243         // DEFINITIONS OF THE CONSTRAINT FUNCTION, GRID, AND BOUNDS:
00244         // ---------------------------------------------------------
00245 
00246         Grid             grid   ;   
00247         Function        *fcn    ;   
00248         double         **lb     ;   
00249         double         **ub     ;   
00251         EvaluationPoint  *z      ;   
00252         EvaluationPoint  *JJ     ;
00253 
00254 
00255         // LOW_LEVEL EVALUATION INDICES:
00256         // ----------------------------- 
00257 
00258         int            **y_index;   
00259         int             *t_index;   
00262         // DIMENSIONS:
00263         // ----------------------
00264 
00265         int              nx     ;   
00266         int              na     ;   
00267         int              nu     ;   
00268         int              np     ;   
00269         int              nw     ;   
00270         int              ny     ;   
00272         int              nFcn   ;   
00273         int              nB     ;   
00276         // INPUT STORAGE:
00277         // ------------------------
00278         BlockMatrix      *xSeed   ;   
00279         BlockMatrix      *xaSeed  ;   
00280         BlockMatrix      *pSeed   ;   
00281         BlockMatrix      *uSeed   ;   
00282         BlockMatrix      *wSeed   ;   
00284         BlockMatrix      *bSeed   ;   
00286         BlockMatrix      *xSeed2  ;   
00287         BlockMatrix      *xaSeed2 ;   
00288         BlockMatrix      *pSeed2  ;   
00289         BlockMatrix      *uSeed2  ;   
00290         BlockMatrix      *wSeed2  ;   
00292         BlockMatrix      *bSeed2  ;   
00295         // RESULTS:
00296         // ------------------------
00297         BlockMatrix      residuumL;   
00298         BlockMatrix      residuumU;   
00300         BlockMatrix      dForward ;   
00301         BlockMatrix      dBackward;   
00303         CondensingType   condType ;   
00305 };
00306 
00307 
00308 CLOSE_NAMESPACE_ACADO
00309 
00310 
00311 
00312 #include <acado/constraint/constraint_element.ipp>
00313 
00314 
00315 #endif  // ACADO_TOOLKIT_CONSTRAINT_ELEMENT_HPP
00316 
00317 /*
00318  *    end of file
00319  */


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