Indexlist.h
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-2015 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_H
37 #define QPOASES_INDEXLIST_H
38 
39 
40 #include <qpOASES_e/Utils.h>
41 
42 
44 
45 
55 typedef struct
56 {
57  int number[NVCMAX];
58  int iSort[NVCMAX];
60  int length;
61  int first;
62  int last;
63  int lastusedindex;
64  int physicallength;
65 } Indexlist;
66 
67 
68 
70 void IndexlistCON( Indexlist* _THIS,
71  int n
72  );
73 
76 void IndexlistCPY( Indexlist* FROM,
77  Indexlist* TO
78  );
79 
84  int n
85  );
86 
87 
92  int** const numberarray
93  );
94 
99  int** const iSortArray
100  );
101 
102 
106 int Indexlist_getIndex( Indexlist* _THIS,
107  int givennumber
108  );
109 
113 static inline int Indexlist_getNumber( Indexlist* _THIS,
114  int physicalindex
115  );
116 
117 
120 static inline int Indexlist_getLength( Indexlist* _THIS
121  );
122 
125 static inline int Indexlist_getLastNumber( Indexlist* _THIS
126  );
127 
128 
134  int addnumber
135  );
136 
140  int removenumber
141  );
142 
146  int number1,
147  int number2
148  );
149 
152 static inline BooleanType Indexlist_isMember( Indexlist* _THIS,
153  int _number
154  );
155 
156 
161 int Indexlist_findInsert( Indexlist* _THIS,
162  int i
163  );
164 
165 
166 
167 /*
168  * g e t N u m b e r
169  */
170 static inline int Indexlist_getNumber( Indexlist* _THIS, int physicalindex )
171 {
172  /* consistency check */
173  if ( ( physicalindex < 0 ) || ( physicalindex > _THIS->length ) )
175 
176  return _THIS->number[physicalindex];
177 }
178 
179 
180 /*
181  * g e t L e n g t h
182  */
183 static inline int Indexlist_getLength( Indexlist* _THIS )
184 {
185  return _THIS->length;
186 }
187 
188 
189 /*
190  * g e t L a s t N u m b e r
191  */
192 static inline int Indexlist_getLastNumber( Indexlist* _THIS )
193 {
194  return _THIS->number[_THIS->length-1];
195 }
196 
197 
198 /*
199  * g e t L a s t N u m b e r
200  */
201 static inline BooleanType Indexlist_isMember( Indexlist* _THIS, int _number )
202 {
203  if ( Indexlist_getIndex( _THIS,_number ) >= 0 )
204  return BT_TRUE;
205  else
206  return BT_FALSE;
207 }
208 
209 
211 
212 
213 #endif /* QPOASES_INDEXLIST_H */
214 
215 
216 /*
217  * end of file
218  */
static int Indexlist_getLastNumber(Indexlist *_THIS)
Definition: Indexlist.h:192
int Indexlist_getIndex(Indexlist *_THIS, int givennumber)
Definition: Indexlist.c:129
returnValue Indexlist_removeNumber(Indexlist *_THIS, int removenumber)
Definition: Indexlist.c:160
static BooleanType Indexlist_isMember(Indexlist *_THIS, int _number)
Definition: Indexlist.h:201
int Indexlist_findInsert(Indexlist *_THIS, int i)
Definition: Indexlist.c:219
Allows to pass back messages to the calling function.
returnValue Indexlist_getISortArray(Indexlist *_THIS, int **const iSortArray)
Definition: Indexlist.c:118
void IndexlistCON(Indexlist *_THIS, int n)
Definition: Indexlist.c:49
returnValue Indexlist_swapNumbers(Indexlist *_THIS, int number1, int number2)
Definition: Indexlist.c:190
returnValue Indexlist_addNumber(Indexlist *_THIS, int addnumber)
Definition: Indexlist.c:139
static int Indexlist_getLength(Indexlist *_THIS)
Definition: Indexlist.h:183
returnValue Indexlist_init(Indexlist *_THIS, int n)
Definition: Indexlist.c:86
static int Indexlist_getNumber(Indexlist *_THIS, int physicalindex)
Definition: Indexlist.h:170
void IndexlistCPY(Indexlist *FROM, Indexlist *TO)
Definition: Indexlist.c:60
#define BT_TRUE
Definition: acado_types.hpp:47
returnValue Indexlist_getNumberArray(Indexlist *_THIS, int **const numberarray)
Definition: Indexlist.c:105
#define BT_FALSE
Definition: acado_types.hpp:49


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:41