00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00034 #ifndef ACADO_TOOLKIT_DENSE_CP_HPP
00035 #define ACADO_TOOLKIT_DENSE_CP_HPP
00036
00037 #include <acado/utils/acado_utils.hpp>
00038 #include <acado/matrix_vector/matrix_vector.hpp>
00039
00040
00041 BEGIN_NAMESPACE_ACADO
00042
00043
00055 class DenseCP{
00056
00057
00058
00059
00060
00061 public:
00062
00064 DenseCP( );
00065
00067 DenseCP( const DenseCP& rhs );
00068
00070 virtual ~DenseCP( );
00071
00073 DenseCP& operator=( const DenseCP& rhs );
00074
00075
00077 returnValue init( uint nV_, uint nC_ );
00078
00079
00080
00081
00082
00083
00084
00086 inline BooleanType isLP () const;
00087
00089 inline BooleanType isQP () const;
00090
00092 inline BooleanType isSDP() const;
00093
00094
00095
00097 inline uint getNV() const;
00098
00100 inline uint getNC() const;
00101
00102
00110 returnValue setQPsolution( const DVector &x_, const DVector &y_ );
00111
00112
00120 DVector getMergedDualSolution( ) const;
00121
00122
00137 returnValue print( const char* const name = DEFAULT_LABEL,
00138 const char* const startString = DEFAULT_START_STRING,
00139 const char* const endString = DEFAULT_END_STRING,
00140 uint width = DEFAULT_WIDTH,
00141 uint precision = DEFAULT_PRECISION,
00142 const char* const colSeparator = DEFAULT_COL_SEPARATOR,
00143 const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
00144 ) const;
00145
00155 returnValue print( const char* const name,
00156 PrintScheme printScheme
00157 ) const;
00158
00159
00176 returnValue printToFile( const char* const filename,
00177 const char* const name = DEFAULT_LABEL,
00178 const char* const startString = DEFAULT_START_STRING,
00179 const char* const endString = DEFAULT_END_STRING,
00180 uint width = DEFAULT_WIDTH,
00181 uint precision = DEFAULT_PRECISION,
00182 const char* const colSeparator = DEFAULT_COL_SEPARATOR,
00183 const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
00184 ) const;
00185
00202 returnValue printToFile( std::ostream& stream,
00203 const char* const name = DEFAULT_LABEL,
00204 const char* const startString = DEFAULT_START_STRING,
00205 const char* const endString = DEFAULT_END_STRING,
00206 uint width = DEFAULT_WIDTH,
00207 uint precision = DEFAULT_PRECISION,
00208 const char* const colSeparator = DEFAULT_COL_SEPARATOR,
00209 const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
00210 ) const;
00211
00223 returnValue printToFile( const char* const filename,
00224 const char* const name,
00225 PrintScheme printScheme
00226 ) const;
00227
00239 returnValue printToFile( std::ostream& stream,
00240 const char* const name,
00241 PrintScheme printScheme
00242 ) const;
00243
00244
00259 returnValue printSolution( const char* const name = DEFAULT_LABEL,
00260 const char* const startString = DEFAULT_START_STRING,
00261 const char* const endString = DEFAULT_END_STRING,
00262 uint width = DEFAULT_WIDTH,
00263 uint precision = DEFAULT_PRECISION,
00264 const char* const colSeparator = DEFAULT_COL_SEPARATOR,
00265 const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
00266 ) const;
00267
00277 returnValue printSolution( const char* const name,
00278 PrintScheme printScheme
00279 ) const;
00280
00297 returnValue printSolutionToFile( const char* const filename,
00298 const char* const name = DEFAULT_LABEL,
00299 const char* const startString = DEFAULT_START_STRING,
00300 const char* const endString = DEFAULT_END_STRING,
00301 uint width = DEFAULT_WIDTH,
00302 uint precision = DEFAULT_PRECISION,
00303 const char* const colSeparator = DEFAULT_COL_SEPARATOR,
00304 const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
00305 ) const;
00306
00323 returnValue printSolutionToFile( std::ostream& stream,
00324 const char* const name = DEFAULT_LABEL,
00325 const char* const startString = DEFAULT_START_STRING,
00326 const char* const endString = DEFAULT_END_STRING,
00327 uint width = DEFAULT_WIDTH,
00328 uint precision = DEFAULT_PRECISION,
00329 const char* const colSeparator = DEFAULT_COL_SEPARATOR,
00330 const char* const rowSeparator = DEFAULT_ROW_SEPARATOR
00331 ) const;
00332
00344 returnValue printSolutionToFile( const char* const filename,
00345 const char* const name,
00346 PrintScheme printScheme
00347 ) const;
00348
00360 returnValue printSolutionToFile( std::ostream& stream,
00361 const char* const name,
00362 PrintScheme printScheme
00363 ) const;
00364
00365
00366
00367
00368
00369 public:
00370
00371
00372
00373
00374
00375 uint nS;
00378
00379
00380
00381 DMatrix H;
00382 DVector g;
00384 DVector lb;
00385 DVector ub;
00387 DMatrix A;
00388 DVector lbA;
00389 DVector ubA;
00391 DMatrix **B;
00392 DVector *lbB;
00393 DVector *ubB;
00396
00397
00398 DVector *x;
00400 DVector *ylb;
00401 DVector *yub;
00403 DVector *ylbA;
00404 DVector *yubA;
00406 DVector **ylbB;
00407 DVector **yubB;
00411
00412
00413 protected:
00414
00415 void copy (const DenseCP& rhs);
00416 void clean();
00417 };
00418
00419
00420 CLOSE_NAMESPACE_ACADO
00421
00422
00423 #include <acado/conic_program/dense_cp.ipp>
00424
00425
00426 #endif // ACADO_TOOLKIT_DENSE_CP_HPP
00427
00428
00429
00430