examples/code_generation/mpc_mhe/getting_started_export/qpoases/SRC/CyclingManager.cpp
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-2008 by Hans Joachim Ferreau et al. All rights reserved.
6  *
7  * qpOASES is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * qpOASES is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with qpOASES; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  */
22 
23 
36 #include <CyclingManager.hpp>
37 
38 
39 /*****************************************************************************
40  * P U B L I C *
41  *****************************************************************************/
42 
43 
44 /*
45  * C y c l i n g M a n a g e r
46  */
48  nC( 0 )
49 {
51 }
52 
53 
54 /*
55  * C y c l i n g M a n a g e r
56  */
58  nC( rhs.nC ),
60 {
61  int i;
62 
63  for( i=0; i<nV+nC; ++i )
64  status[i] = rhs.status[i];
65 }
66 
67 
68 /*
69  * ~ C y c l i n g M a n a g e r
70  */
72 {
73 }
74 
75 
76 /*
77  * o p e r a t o r =
78  */
80 {
81  int i;
82 
83  if ( this != &rhs )
84  {
85  nV = rhs.nV;
86  nC = rhs.nC;
87 
88  for( i=0; i<nV+nC; ++i )
89  status[i] = rhs.status[i];
90 
92  }
93 
94  return *this;
95 }
96 
97 
98 
99 /*
100  * i n i t
101  */
103 {
104  nV = _nV;
105  nC = _nC;
106 
108 
109  return SUCCESSFUL_RETURN;
110 }
111 
112 
113 
114 /*
115  * s e t C y c l i n g S t a t u s
116  */
118  BooleanType isBound, CyclingStatus _status
119  )
120 {
121  if ( isBound == BT_TRUE )
122  {
123  /* Set cycling status of a bound. */
124  if ( ( number >= 0 ) && ( number < nV ) )
125  {
126  status[number] = _status;
127  return SUCCESSFUL_RETURN;
128  }
129  else
131  }
132  else
133  {
134  /* Set cycling status of a constraint. */
135  if ( ( number >= 0 ) && ( number < nC ) )
136  {
137  status[nV+number] = _status;
138  return SUCCESSFUL_RETURN;
139  }
140  else
142  }
143 }
144 
145 
146 /*
147  * g e t C y c l i n g S t a t u s
148  */
150 {
151  if ( isBound == BT_TRUE )
152  {
153  /* Return cycling status of a bound. */
154  if ( ( number >= 0 ) && ( number < nV ) )
155  return status[number];
156  }
157  else
158  {
159  /* Return cycling status of a constraint. */
160  if ( ( number >= 0 ) && ( number < nC ) )
161  return status[nV+number];
162  }
163 
164  return CYC_NOT_INVOLVED;
165 }
166 
167 
168 /*
169  * c l e a r C y c l i n g D a t a
170  */
172 {
173  int i;
174 
175  /* Reset all status values ... */
176  for( i=0; i<nV+nC; ++i )
178 
179  /* ... and the main cycling flag. */
181 
182  return SUCCESSFUL_RETURN;
183 }
184 
185 
186 /*
187  * end of file
188  */
Allows to pass back messages to the calling function.
CyclingStatus getCyclingStatus(int number, BooleanType isBound) const
void rhs(const real_t *x, real_t *f)
#define BT_TRUE
Definition: acado_types.hpp:47
#define BT_FALSE
Definition: acado_types.hpp:49
returnValue setCyclingStatus(int number, BooleanType isBound, CyclingStatus _status)


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