qpOASES  3.2.1
An Implementation of the Online Active Set Strategy
include/qpOASES/Indexlist.hpp
Go to the documentation of this file.
00001 /*
00002  *  This file is part of qpOASES.
00003  *
00004  *  qpOASES -- An Implementation of the Online Active Set Strategy.
00005  *  Copyright (C) 2007-2017 by Hans Joachim Ferreau, Andreas Potschka,
00006  *  Christian Kirches et al. All rights reserved.
00007  *
00008  *  qpOASES is free software; you can redistribute it and/or
00009  *  modify it under the terms of the GNU Lesser General Public
00010  *  License as published by the Free Software Foundation; either
00011  *  version 2.1 of the License, or (at your option) any later version.
00012  *
00013  *  qpOASES is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  *  See the GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public
00019  *  License along with qpOASES; if not, write to the Free Software
00020  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00021  *
00022  */
00023 
00024 
00036 #ifndef QPOASES_INDEXLIST_HPP
00037 #define QPOASES_INDEXLIST_HPP
00038 
00039 
00040 #include <qpOASES/Utils.hpp>
00041 
00042 
00043 BEGIN_NAMESPACE_QPOASES
00044 
00045 
00055 class Indexlist
00056 {
00057     /*
00058      *  FRIENDS
00059      */
00060     friend class DenseMatrix;
00061     friend class SymDenseMat;
00062     friend class SparseMatrix;
00063     friend class SparseMatrixRow;
00064     friend class SymSparseMat;
00065 
00066     /*
00067      *  PUBLIC MEMBER FUNCTIONS
00068      */
00069     public:
00071         Indexlist( );
00072 
00074         Indexlist(  int_t n 
00075                     );
00076 
00078         Indexlist(  const Indexlist& rhs    
00079                     );
00080 
00082         ~Indexlist( );
00083 
00085         Indexlist& operator=(   const Indexlist& rhs    
00086                                 );
00087 
00088 
00092         returnValue init(   int_t n = 0 
00093                             );
00094 
00095 
00099         returnValue getNumberArray( int_t** const numberarray   
00100                                     ) const;
00101 
00105         returnValue getISortArray(  int_t** const iSortArray    
00106                                     ) const;
00107 
00108 
00112         int_t getIndex( int_t givennumber   
00113                         ) const;
00114 
00118         int_t getNumber(    int_t physicalindex 
00119                             ) const;
00120 
00121 
00124         inline int_t getLength( ) const;
00125 
00128         inline int_t getLastNumber( ) const;
00129 
00130 
00135         returnValue addNumber(  int_t addnumber         
00136                                 );
00137 
00140         returnValue removeNumber(   int_t removenumber  
00141                                     );
00142 
00145         returnValue swapNumbers(    int_t number1,      
00146                                     int_t number2           
00147                                     );
00148 
00151         inline BooleanType isMember(    int_t _number       
00152                                         ) const;
00153 
00154 
00155     /*
00156      *  PROTECTED MEMBER FUNCTIONS
00157      */
00158     protected:
00161         returnValue clear( );
00162 
00165         returnValue copy(   const Indexlist& rhs    
00166                             );
00167 
00172         int_t findInsert(   int_t i
00173                             ) const;
00174 
00175 
00176     /*
00177      *  PROTECTED MEMBER VARIABLES
00178      */
00179     protected:
00180         int_t* number;          
00181         int_t* iSort;           
00183         int_t   length;         
00184         int_t   first;          
00185         int_t   last;           
00186         int_t   lastusedindex;  
00187         int_t   physicallength; 
00188 };
00189 
00190 END_NAMESPACE_QPOASES
00191 
00192 #include <qpOASES/Indexlist.ipp>
00193 
00194 #endif  /* QPOASES_INDEXLIST_HPP */
00195 
00196 
00197 /*
00198  *  end of file
00199  */