qpOASES 3.2.1
An Implementation of the Online Active Set Strategy
Indexlist.ipp
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
37
38
39/*****************************************************************************
40 * P U B L I C *
41 *****************************************************************************/
42
43
44/*
45 * g e t N u m b e r
46 */
47inline int_t Indexlist::getNumber( int_t physicalindex ) const
48{
49 /* consistency check */
50 if ( ( physicalindex < 0 ) || ( physicalindex > length ) )
52
53 return number[physicalindex];
54}
55
56
57/*
58 * g e t L e n g t h
59 */
61{
62 return length;
63}
64
65
66/*
67 * g e t L a s t N u m b e r
68 */
70{
71 return number[length-1];
72}
73
74
75/*
76 * g e t L a s t N u m b e r
77 */
78inline BooleanType Indexlist::isMember( int_t _number ) const
79{
80 if ( getIndex( _number ) >= 0 )
81 return BT_TRUE;
82 else
83 return BT_FALSE;
84}
85
86
88
89
90/*
91 * end of file
92 */
@ RET_INDEXLIST_OUTOFBOUNDS
Definition MessageHandling.hpp:84
BooleanType
Definition Types.hpp:204
@ BT_TRUE
Definition Types.hpp:206
@ BT_FALSE
Definition Types.hpp:205
int int_t
Definition Types.hpp:180
#define END_NAMESPACE_QPOASES
Definition Types.hpp:110
#define BEGIN_NAMESPACE_QPOASES
Definition Types.hpp:107
int_t getIndex(int_t givennumber) const
Definition Indexlist.cpp:157
int_t getNumber(int_t physicalindex) const
Definition Indexlist.ipp:47
int_t getLength() const
Definition Indexlist.ipp:60
int_t length
Definition Indexlist.hpp:183
BooleanType isMember(int_t _number) const
Definition Indexlist.ipp:78
int_t getLastNumber() const
Definition Indexlist.ipp:69
int_t * number
Definition Indexlist.hpp:180