dense_cp.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_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     // PUBLIC MEMBER FUNCTIONS:
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 //         returnValue setBounds( const DVector &lb,
00082 //                                const DVector &ub  );
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     // PUBLIC DATA MEMBERS:
00368     //
00369     public:
00370 
00371 
00372     // DIMENSIONS OF THE CP:
00373     // ---------------------
00374 
00375     uint         nS;    
00378     // DENSE CP IN MATRIX-VECTOR FORMAT:
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     // SOLUTION OF THE DENSE CP:
00397     // -------------------------------------------------------
00398     DVector       *x;    
00400     DVector     *ylb;    
00401     DVector     *yub;    
00403     DVector    *ylbA;    
00404     DVector    *yubA;    
00406     DVector   **ylbB;    
00407     DVector   **yubB;    
00411     // PROTECTED MEMBER FUNCTIONS:
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  *  end of file
00430  */


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 11:58:04