qpOASES
3.1.1
|
00001 /* 00002 * This file is part of qpOASES. 00003 * 00004 * qpOASES -- An Implementation of the Online Active Set Strategy. 00005 * Copyright (C) 2007-2015 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 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 n = 0 00093 ); 00094 00095 00099 returnValue getNumberArray( int** const numberarray 00100 ) const; 00101 00105 returnValue getISortArray( int** const iSortArray 00106 ) const; 00107 00108 00112 int getIndex( int givennumber 00113 ) const; 00114 00118 int getNumber( int physicalindex 00119 ) const; 00120 00121 00124 inline int getLength( ) const; 00125 00128 inline int getLastNumber( ) const; 00129 00130 00135 returnValue addNumber( int addnumber 00136 ); 00137 00140 returnValue removeNumber( int removenumber 00141 ); 00142 00145 returnValue swapNumbers( int number1, 00146 int number2 00147 ); 00148 00151 inline BooleanType isMember( int _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 findInsert( int i 00173 ) const; 00174 00175 00176 /* 00177 * PROTECTED MEMBER VARIABLES 00178 */ 00179 protected: 00180 int* number; 00181 int* iSort; 00183 int length; 00184 int first; 00185 int last; 00186 int lastusedindex; 00187 int 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 */