dense_cp.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_DENSE_CP_HPP
35 #define ACADO_TOOLKIT_DENSE_CP_HPP
36 
39 
40 
42 
43 
55 class DenseCP{
56 
57 
58  //
59  // PUBLIC MEMBER FUNCTIONS:
60  //
61  public:
62 
64  DenseCP( );
65 
67  DenseCP( const DenseCP& rhs );
68 
70  virtual ~DenseCP( );
71 
73  DenseCP& operator=( const DenseCP& rhs );
74 
75 
77  returnValue init( uint nV_, uint nC_ );
78 
79 
80 
81 // returnValue setBounds( const DVector &lb,
82 // const DVector &ub );
83 
84 
86  inline BooleanType isLP () const;
87 
89  inline BooleanType isQP () const;
90 
92  inline BooleanType isSDP() const;
93 
94 
95 
97  inline uint getNV() const;
98 
100  inline uint getNC() const;
101 
102 
110  returnValue setQPsolution( const DVector &x_, const DVector &y_ );
111 
112 
121 
122 
137  returnValue print( const char* const name = DEFAULT_LABEL,
138  const char* const startString = DEFAULT_START_STRING,
139  const char* const endString = DEFAULT_END_STRING,
140  uint width = DEFAULT_WIDTH,
142  const char* const colSeparator = DEFAULT_COL_SEPARATOR,
143  const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
144  ) const;
145 
155  returnValue print( const char* const name,
156  PrintScheme printScheme
157  ) const;
158 
159 
176  returnValue printToFile( const char* const filename,
177  const char* const name = DEFAULT_LABEL,
178  const char* const startString = DEFAULT_START_STRING,
179  const char* const endString = DEFAULT_END_STRING,
180  uint width = DEFAULT_WIDTH,
182  const char* const colSeparator = DEFAULT_COL_SEPARATOR,
183  const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
184  ) const;
185 
202  returnValue printToFile( std::ostream& stream,
203  const char* const name = DEFAULT_LABEL,
204  const char* const startString = DEFAULT_START_STRING,
205  const char* const endString = DEFAULT_END_STRING,
206  uint width = DEFAULT_WIDTH,
208  const char* const colSeparator = DEFAULT_COL_SEPARATOR,
209  const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
210  ) const;
211 
223  returnValue printToFile( const char* const filename,
224  const char* const name,
225  PrintScheme printScheme
226  ) const;
227 
239  returnValue printToFile( std::ostream& stream,
240  const char* const name,
241  PrintScheme printScheme
242  ) const;
243 
244 
259  returnValue printSolution( const char* const name = DEFAULT_LABEL,
260  const char* const startString = DEFAULT_START_STRING,
261  const char* const endString = DEFAULT_END_STRING,
262  uint width = DEFAULT_WIDTH,
264  const char* const colSeparator = DEFAULT_COL_SEPARATOR,
265  const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
266  ) const;
267 
277  returnValue printSolution( const char* const name,
278  PrintScheme printScheme
279  ) const;
280 
297  returnValue printSolutionToFile( const char* const filename,
298  const char* const name = DEFAULT_LABEL,
299  const char* const startString = DEFAULT_START_STRING,
300  const char* const endString = DEFAULT_END_STRING,
301  uint width = DEFAULT_WIDTH,
303  const char* const colSeparator = DEFAULT_COL_SEPARATOR,
304  const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
305  ) const;
306 
323  returnValue printSolutionToFile( std::ostream& stream,
324  const char* const name = DEFAULT_LABEL,
325  const char* const startString = DEFAULT_START_STRING,
326  const char* const endString = DEFAULT_END_STRING,
327  uint width = DEFAULT_WIDTH,
329  const char* const colSeparator = DEFAULT_COL_SEPARATOR,
330  const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
331  ) const;
332 
344  returnValue printSolutionToFile( const char* const filename,
345  const char* const name,
346  PrintScheme printScheme
347  ) const;
348 
360  returnValue printSolutionToFile( std::ostream& stream,
361  const char* const name,
362  PrintScheme printScheme
363  ) const;
364 
365 
366  //
367  // PUBLIC DATA MEMBERS:
368  //
369  public:
370 
371 
372  // DIMENSIONS OF THE CP:
373  // ---------------------
374 
378  // DENSE CP IN MATRIX-VECTOR FORMAT:
379  // -------------------------------------------------------
380 
391  DMatrix **B;
396  // SOLUTION OF THE DENSE CP:
397  // -------------------------------------------------------
411  // PROTECTED MEMBER FUNCTIONS:
412  // ---------------------------
413  protected:
414 
415  void copy (const DenseCP& rhs);
416  void clean();
417 };
418 
419 
421 
422 
423 #include <acado/conic_program/dense_cp.ipp>
424 
425 
426 #endif // ACADO_TOOLKIT_DENSE_CP_HPP
427 
428 /*
429  * end of file
430  */
const char DEFAULT_END_STRING[4]
DVector lb
Definition: dense_cp.hpp:384
DenseCP()
Definition: dense_cp.cpp:44
DVector ub
Definition: dense_cp.hpp:385
DenseCP & operator=(const DenseCP &rhs)
Definition: dense_cp.cpp:76
const uint DEFAULT_PRECISION
BooleanType isSDP() const
Allows to pass back messages to the calling function.
const char DEFAULT_COL_SEPARATOR[2]
DVector g
Definition: dense_cp.hpp:382
returnValue print(const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const
Definition: dense_cp.cpp:283
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
returnValue setQPsolution(const DVector &x_, const DVector &y_)
Definition: dense_cp.cpp:204
BooleanType isQP() const
DVector * yub
Definition: dense_cp.hpp:401
#define CLOSE_NAMESPACE_ACADO
const char DEFAULT_START_STRING[3]
DMatrix ** B
Definition: dense_cp.hpp:391
DVector ** yubB
Definition: dense_cp.hpp:407
DMatrix H
Definition: dense_cp.hpp:381
DVector * yubA
Definition: dense_cp.hpp:404
uint getNC() const
void clean()
Definition: dense_cp.cpp:167
DVector getMergedDualSolution() const
Definition: dense_cp.cpp:257
Data class for storing generic conic programs.
Definition: dense_cp.hpp:55
DVector * ylbA
Definition: dense_cp.hpp:403
virtual ~DenseCP()
Definition: dense_cp.cpp:70
uint nS
Definition: dense_cp.hpp:375
PrintScheme
void copy(const DenseCP &rhs)
Definition: dense_cp.cpp:88
uint getNV() const
DVector * x
Definition: dense_cp.hpp:398
DVector * lbB
Definition: dense_cp.hpp:392
void rhs(const real_t *x, real_t *f)
DVector ubA
Definition: dense_cp.hpp:389
const uint DEFAULT_WIDTH
DMatrix A
Definition: dense_cp.hpp:387
BooleanType isLP() const
const char DEFAULT_ROW_SEPARATOR[6]
returnValue printToFile(const char *const filename, const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const
Definition: dense_cp.cpp:320
#define BEGIN_NAMESPACE_ACADO
DVector lbA
Definition: dense_cp.hpp:388
DVector * ylb
Definition: dense_cp.hpp:400
returnValue printSolutionToFile(const char *const filename, const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const
Definition: dense_cp.cpp:450
DVector ** ylbB
Definition: dense_cp.hpp:406
returnValue printSolution(const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const
Definition: dense_cp.cpp:399
returnValue init(uint nV_, uint nC_)
Definition: dense_cp.cpp:195
const char DEFAULT_LABEL[1]
DVector * ubB
Definition: dense_cp.hpp:393


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