qpOASES  3.2.1
An Implementation of the Online Active Set Strategy
Indexlist.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of qpOASES.
3  *
4  * qpOASES -- An Implementation of the Online Active Set Strategy.
5  * Copyright (C) 2007-2017 by Hans Joachim Ferreau, Andreas Potschka,
6  * Christian Kirches et al. All rights reserved.
7  *
8  * qpOASES is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * qpOASES is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with qpOASES; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23 
24 
36 #ifndef QPOASES_INDEXLIST_HPP
37 #define QPOASES_INDEXLIST_HPP
38 
39 
40 #include <qpOASES/Utils.hpp>
41 
42 
44 
45 
55 class Indexlist
56 {
57  /*
58  * FRIENDS
59  */
60  friend class DenseMatrix;
61  friend class SymDenseMat;
62  friend class SparseMatrix;
63  friend class SparseMatrixRow;
64  friend class SymSparseMat;
65 
66  /*
67  * PUBLIC MEMBER FUNCTIONS
68  */
69  public:
71  Indexlist( );
72 
74  Indexlist( int_t n
75  );
76 
78  Indexlist( const Indexlist& rhs
79  );
80 
82  ~Indexlist( );
83 
85  Indexlist& operator=( const Indexlist& rhs
86  );
87 
88 
92  returnValue init( int_t n = 0
93  );
94 
95 
99  returnValue getNumberArray( int_t** const numberarray
100  ) const;
101 
105  returnValue getISortArray( int_t** const iSortArray
106  ) const;
107 
108 
112  int_t getIndex( int_t givennumber
113  ) const;
114 
118  int_t getNumber( int_t physicalindex
119  ) const;
120 
121 
124  inline int_t getLength( ) const;
125 
128  inline int_t getLastNumber( ) const;
129 
130 
135  returnValue addNumber( int_t addnumber
136  );
137 
140  returnValue removeNumber( int_t removenumber
141  );
142 
145  returnValue swapNumbers( int_t number1,
146  int_t number2
147  );
148 
151  inline BooleanType isMember( int_t _number
152  ) const;
153 
154 
155  /*
156  * PROTECTED MEMBER FUNCTIONS
157  */
158  protected:
161  returnValue clear( );
162 
165  returnValue copy( const Indexlist& rhs
166  );
167 
173  ) const;
174 
175 
176  /*
177  * PROTECTED MEMBER VARIABLES
178  */
179  protected:
188 };
189 
191 
192 #include <qpOASES/Indexlist.ipp>
193 
194 #endif /* QPOASES_INDEXLIST_HPP */
195 
196 
197 /*
198  * end of file
199  */
returnValue addNumber(int_t addnumber)
Definition: Indexlist.cpp:167
#define BEGIN_NAMESPACE_QPOASES
Definition: Types.hpp:107
Indexlist()
Definition: Indexlist.cpp:50
#define END_NAMESPACE_QPOASES
Definition: Types.hpp:110
Interfaces matrix-vector operations tailored to symmetric sparse matrices.
Definition: Matrices.hpp:936
returnValue getNumberArray(int_t **const numberarray) const
Definition: Indexlist.cpp:132
int int_t
Definition: Types.hpp:180
int_t getLength() const
Definition: Indexlist.ipp:60
int_t first
Definition: Indexlist.hpp:184
returnValue swapNumbers(int_t number1, int_t number2)
Definition: Indexlist.cpp:217
Interfaces matrix-vector operations tailored to symmetric dense matrices.
Definition: Matrices.hpp:511
BooleanType isMember(int_t _number) const
Definition: Indexlist.ipp:78
returnValue getISortArray(int_t **const iSortArray) const
Definition: Indexlist.cpp:146
Interfaces matrix-vector operations tailored to general sparse matrices.
Definition: Matrices.hpp:751
int_t lastusedindex
Definition: Indexlist.hpp:186
returnValue clear()
Definition: Indexlist.cpp:248
int_t physicallength
Definition: Indexlist.hpp:187
Interfaces matrix-vector operations tailored to general dense matrices.
Definition: Matrices.hpp:328
returnValue init(int_t n=0)
Definition: Indexlist.cpp:108
Interfaces matrix-vector operations tailored to general sparse matrices.
Definition: Matrices.hpp:557
int_t length
Definition: Indexlist.hpp:183
Indexlist & operator=(const Indexlist &rhs)
Definition: Indexlist.cpp:92
int_t getIndex(int_t givennumber) const
Definition: Indexlist.cpp:157
returnValue
Defines all symbols for global return values.
Definition: MessageHandling.hpp:64
int_t getLastNumber() const
Definition: Indexlist.ipp:69
returnValue removeNumber(int_t removenumber)
Definition: Indexlist.cpp:187
returnValue copy(const Indexlist &rhs)
Definition: Indexlist.cpp:269
int_t findInsert(int_t i) const
Definition: Indexlist.cpp:295
Stores and manages index lists.
Definition: Indexlist.hpp:55
int_t last
Definition: Indexlist.hpp:185
int_t * number
Definition: Indexlist.hpp:180
~Indexlist()
Definition: Indexlist.cpp:83
int_t getNumber(int_t physicalindex) const
Definition: Indexlist.ipp:47
BooleanType
Definition: Types.hpp:203
int_t * iSort
Definition: Indexlist.hpp:181