qpOASES 3.2.1
An Implementation of the Online Active Set Strategy
SubjectTo.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 O f T y p e
46 */
48{
49 int_t i;
50 int_t numberOfType = 0;
51
52 if ( type != 0 )
53 {
54 for( i=0; i<n; ++i )
55 if ( type[i] == _type )
56 ++numberOfType;
57 }
58
59 return numberOfType;
60}
61
62
63/*
64 * g e t T y p e
65 */
67{
68 if ( ( i >= 0 ) && ( i < n ) )
69 return type[i];
70
71 return ST_UNKNOWN;
72}
73
74
75/*
76 * g e t S t a t u s
77 */
79{
80 if ( ( i >= 0 ) && ( i < n ) )
81 return status[i];
82
83 return ST_UNDEFINED;
84}
85
86
87/*
88 * s e t T y p e
89 */
91{
92 if ( ( i >= 0 ) && ( i < n ) )
93 {
94 type[i] = value;
95 return SUCCESSFUL_RETURN;
96 }
97 else
99}
100
101
102/*
103 * s e t S t a t u s
104 */
106{
107 if ( ( i >= 0 ) && ( i < n ) )
108 {
109 status[i] = value;
110 return SUCCESSFUL_RETURN;
111 }
112 else
114}
115
116
117/*
118 * s e t N o L o w e r
119 */
120inline void SubjectTo::setNoLower( BooleanType _status )
121{
122 noLower = _status;
123}
124
125
126/*
127 * s e t N o U p p e r
128 */
129inline void SubjectTo::setNoUpper( BooleanType _status )
130{
131 noUpper = _status;
132}
133
134
135/*
136 * h a s N o L o w e r
137 */
139{
140 return noLower;
141}
142
143
144/*
145 * h a s N o U p p p e r
146 */
148{
149 return noUpper;
150}
151
152
154
155
156/*
157 * end of file
158 */
returnValue
Defines all symbols for global return values.
Definition MessageHandling.hpp:65
@ RET_INDEX_OUT_OF_BOUNDS
Definition MessageHandling.hpp:70
@ SUCCESSFUL_RETURN
Definition MessageHandling.hpp:68
#define THROWERROR(retval)
Definition MessageHandling.hpp:456
BooleanType
Definition Types.hpp:204
SubjectToType
Definition Types.hpp:262
@ ST_UNKNOWN
Definition Types.hpp:267
SubjectToStatus
Definition Types.hpp:273
@ ST_UNDEFINED
Definition Types.hpp:279
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 n
Definition SubjectTo.hpp:210
int_t getNumberOfType(SubjectToType _type) const
Definition SubjectTo.ipp:47
SubjectToType getType(int_t i) const
Definition SubjectTo.ipp:66
void setNoUpper(BooleanType _status)
Definition SubjectTo.ipp:129
returnValue setStatus(int_t i, SubjectToStatus value)
Definition SubjectTo.ipp:105
BooleanType noUpper
Definition SubjectTo.hpp:216
void setNoLower(BooleanType _status)
Definition SubjectTo.ipp:120
BooleanType hasNoLower() const
Definition SubjectTo.ipp:138
SubjectToStatus * status
Definition SubjectTo.hpp:213
BooleanType hasNoUpper() const
Definition SubjectTo.ipp:147
BooleanType noLower
Definition SubjectTo.hpp:215
SubjectToType * type
Definition SubjectTo.hpp:212
returnValue setType(int_t i, SubjectToType value)
Definition SubjectTo.ipp:90
SubjectToStatus getStatus(int_t i) const
Definition SubjectTo.ipp:78