condensing_based_cp_solver.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
34 #ifndef ACADO_TOOLKIT_CONDENSING_BASED_CP_SOLVER_HPP
35 #define ACADO_TOOLKIT_CONDENSING_BASED_CP_SOLVER_HPP
36 
41 
42 
43 
45 
46 
60 
61 
62  //
63  // PUBLIC MEMBER FUNCTIONS:
64  //
65  public:
66 
69 
70  CondensingBasedCPsolver( UserInteraction* _userInteraction,
71  uint nConstraints_,
72  const DVector& blockDims_
73  );
74 
77 
79  virtual ~CondensingBasedCPsolver( );
80 
83 
84 
86  virtual BandedCPsolver* clone() const;
87 
88 
90  virtual returnValue init( const OCPiterate &iter_ );
91 
92 
94  virtual returnValue prepareSolve( BandedCP& cp
95  );
96 
106  virtual returnValue solve( BandedCP& cp
107  );
108 
110  virtual returnValue finalizeSolve( BandedCP& cp
111  );
112 
113 
114  inline uint getNX( ) const;
115  inline uint getNXA( ) const;
116  inline uint getNP( ) const;
117  inline uint getNU( ) const;
118  inline uint getNW( ) const;
119 
120  inline uint getNC( ) const;
121  inline uint getNF( ) const;
122  inline uint getNA( ) const;
123 
124  inline uint getNumPoints( ) const;
125 
126 
127  virtual returnValue getParameters ( DVector &p_ ) const;
128  virtual returnValue getFirstControl ( DVector &u0_ ) const;
129 
130 
136  virtual returnValue getVarianceCovariance( DMatrix &var );
137 
138 
139  virtual returnValue setRealTimeParameters( const DVector& DeltaX,
140  const DVector& DeltaP = emptyConstVector
141  );
142 
144 
145 
146  virtual returnValue freezeCondensing( );
147 
148  virtual returnValue unfreezeCondensing( );
149 
150 
151 
152  //
153  // PROTECTED MEMBER FUNCTIONS:
154  //
155  protected:
156 
160  virtual returnValue initializeCPsolver( InfeasibleQPhandling infeasibleQPhandling
161  );
162 
163 
168  virtual returnValue solveQP( uint maxIter,
169  InfeasibleQPhandling infeasibleQPhandling = IQH_UNDEFINED
170  );
171 
172 
173 
174 
175 
176  virtual returnValue solveCPsubproblem( );
177 
178 
179 
186  returnValue projectHessian( DMatrix &H_, double dampingFactor );
187 
188 
189  // --------
190  // SQP DATA
191  // --------
192 
196  );
197 
198 
202  );
203 
204 
205  returnValue generateHessianBlockLine ( uint nn, uint rowOffset, uint& rowOffset1 );
206  returnValue generateConstraintBlockLine( uint nn, uint rowOffset, uint& rowOffset1 );
207  returnValue generateStateBoundBlockLine( uint nn, uint rowOffset, uint& rowOffset1 );
208  returnValue generateConstraintVectors ( uint nn, uint rowOffset, uint& rowOffset1 );
209  returnValue generateStateBoundVectors ( uint nn, uint rowOffset, uint& rowOffset1 );
210 
211 
214 
215 
217 
219  );
220 
221 
223  virtual returnValue setupRelaxedQPdata( InfeasibleQPhandling infeasibleQPhandling,
224  DenseCP& _denseCPrelaxed
225  ) const;
226 
228  virtual returnValue setupRelaxedQPdataL1( DenseCP& _denseCPrelaxed
229  ) const;
230 
232  virtual returnValue setupRelaxedQPdataL2( DenseCP& _denseCPrelaxed
233  ) const;
234 
235 
236 
237  //
238  // DATA MEMBERS:
239  //
240  protected:
241 
245 
247 
248 
249  // THE CONDENSING OPERATORS:
250  // -----------------------------------------------------
255  // ------------------------------------------------
256 
257 
258  // DENSE QP IN BLOCK-MATRIX FORM:
259  // ----------------------------------------------------------------------
260 
268  // ----------------------------------------------------------------------
269 
270 
273 
275 
278 };
279 
280 
282 
283 
284 #include <acado/conic_solver/condensing_based_cp_solver.ipp>
285 
286 
287 #endif // ACADO_TOOLKIT_CONDENSING_BASED_CP_SOLVER_HPP
288 
289 /*
290  * end of file
291  */
Data class for storing generic optimization variables.
Definition: ocp_iterate.hpp:57
Implements a very rudimentary block sparse matrix class.
returnValue projectHessian(DMatrix &H_, double dampingFactor)
virtual returnValue initializeCPsolver(InfeasibleQPhandling infeasibleQPhandling)
virtual returnValue finalizeSolve(BandedCP &cp)
virtual returnValue getFirstControl(DVector &u0_) const
BooleanType areRealTimeParametersDefined() const
CondensingStatus
virtual returnValue unfreezeCondensing()
returnValue expand(BandedCP &cp)
Allows to pass back messages to the calling function.
returnValue generateHessianBlockLine(uint nn, uint rowOffset, uint &rowOffset1)
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
virtual returnValue setupRelaxedQPdata(InfeasibleQPhandling infeasibleQPhandling, DenseCP &_denseCPrelaxed) const
virtual returnValue freezeCondensing()
Base class for algorithms solving banded conic programs arising in optimal control.
returnValue computeCondensingOperator(BandedCP &cp)
virtual returnValue solveQP(uint maxIter, InfeasibleQPhandling infeasibleQPhandling=IQH_UNDEFINED)
#define CLOSE_NAMESPACE_ACADO
returnValue generateConstraintBlockLine(uint nn, uint rowOffset, uint &rowOffset1)
returnValue generateStateBoundVectors(uint nn, uint rowOffset, uint &rowOffset1)
virtual BandedCPsolver * clone() const
Abstract base class for algorithms solving quadratic programs.
uint getNumPoints() const
static const DVector emptyConstVector
Definition: vector.hpp:336
Data class for storing generic conic programs.
Definition: dense_cp.hpp:55
CondensingBasedCPsolver & operator=(const CondensingBasedCPsolver &rhs)
virtual returnValue getVarianceCovariance(DMatrix &var)
virtual returnValue prepareSolve(BandedCP &cp)
InfeasibleQPhandling
virtual returnValue getParameters(DVector &p_) const
Encapsulates all user interaction for setting options, logging data and plotting results.
virtual returnValue solve(BandedCP &cp)
returnValue generateStateBoundBlockLine(uint nn, uint rowOffset, uint &rowOffset1)
void rhs(const real_t *x, real_t *f)
virtual returnValue setRealTimeParameters(const DVector &DeltaX, const DVector &DeltaP=emptyConstVector)
returnValue generateConstraintVectors(uint nn, uint rowOffset, uint &rowOffset1)
virtual returnValue setupRelaxedQPdataL2(DenseCP &_denseCPrelaxed) const
#define BEGIN_NAMESPACE_ACADO
returnValue condense(BandedCP &cp)
virtual returnValue solveCPsubproblem()
Solves banded conic programs arising in optimal control using condensing.
virtual returnValue init(const OCPiterate &iter_)
virtual returnValue setupRelaxedQPdataL1(DenseCP &_denseCPrelaxed) const
Base class for algorithms solving conic programs.
Data class for storing conic programs arising from optimal control.
Definition: banded_cp.hpp:56


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:31