external_packages/qpOASES-3.2.0/include/qpOASES/Utils.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-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 
35 #ifndef QPOASES_UTILS_HPP
36 #define QPOASES_UTILS_HPP
37 
38 
39 #include <qpOASES/MessageHandling.hpp>
40 
41 
43 
44 
47 returnValue print( const real_t* const v,
48  int_t n,
49  const char* name = 0
50  );
51 
54 returnValue print( const real_t* const v,
55  int_t n,
56  const int_t* const V_idx,
57  const char* name = 0
58  );
59 
62 returnValue print( const real_t* const M,
63  int_t nrow,
64  int_t ncol,
65  const char* name = 0
66  );
67 
70 returnValue print( const real_t* const M,
71  int_t nrow,
72  int_t ncol ,
73  const int_t* const ROW_idx,
74  const int_t* const COL_idx,
75  const char* name = 0
76  );
77 
80 returnValue print( const int_t* const index,
81  int_t n,
82  const char* name = 0
83  );
84 
85 
88 returnValue myPrintf( const char* s
89  );
90 
91 
95 
96 
102  int_t nrow,
103  int_t ncol,
104  const char* datafilename
105  );
106 
112  int_t n,
113  const char* datafilename
114  );
115 
121  int_t n,
122  const char* datafilename
123  );
124 
125 
129 returnValue writeIntoFile( const real_t* const data,
130  int_t nrow,
131  int_t ncol,
132  const char* datafilename,
133  BooleanType append = BT_FALSE
134  );
135 
139 returnValue writeIntoFile( const real_t* const data,
140  int_t n,
141  const char* datafilename,
142  BooleanType append = BT_FALSE
143  );
144 
148 returnValue writeIntoFile( const int_t* const integer,
149  int_t n,
150  const char* datafilename,
151  BooleanType append = BT_FALSE
152  );
153 
158 returnValue writeIntoMatFile( FILE* const matFile,
159  const real_t* const data,
160  int_t nRows,
161  int_t nCols,
162  const char* name
163  );
164 
169 returnValue writeIntoMatFile( FILE* const matFile,
170  const int_t* const data,
171  int_t nRows,
172  int_t nCols,
173  const char* name
174  );
175 
176 
179 real_t getCPUtime( );
180 
181 
184 real_t getNorm( const real_t* const v,
185  int_t n,
186  int_t type = 2
187  );
188 
189 
193 inline BooleanType isEqual( real_t x,
194  real_t y,
195  real_t TOL = ZERO
196  );
197 
198 
202 inline BooleanType isZero( real_t x,
203  real_t TOL = ZERO
204  );
205 
206 
210 inline real_t getSign( real_t arg
211  );
212 
213 
216 inline int_t getMax( int_t x,
217  int_t y
218  );
219 
222 inline int_t getMin( int_t x,
223  int_t y
224  );
225 
226 
229 inline real_t getMax( real_t x,
230  real_t y
231  );
232 
235 inline real_t getMin( real_t x,
236  real_t y
237  );
238 
241 inline real_t getAbs( real_t x
242  );
243 
246 inline real_t getSqrt( real_t x
247  );
248 
249 
253  int_t nC,
254  const real_t* const H,
255  const real_t* const g,
256  const real_t* const A,
257  const real_t* const lb,
258  const real_t* const ub,
259  const real_t* const lbA,
260  const real_t* const ubA,
261  const real_t* const x,
262  const real_t* const y,
263  real_t& stat,
264  real_t& feas,
265  real_t& cmpl,
266  const real_t* const workingSetB = 0,
267  const real_t* const workingSetC = 0,
268  BooleanType hasIdentityHessian = BT_FALSE
269  );
270 
274  const real_t* const H,
275  const real_t* const g,
276  const real_t* const lb,
277  const real_t* const ub,
278  const real_t* const x,
279  const real_t* const y,
280  real_t& stat,
281  real_t& feas,
282  real_t& cmpl,
283  const real_t* const workingSetB = 0,
284  BooleanType hasIdentityHessian = BT_FALSE
285  );
286 
287 
291  char* const string
293  );
294 
298  char* const string
300  );
301 
305  char* const string
307  );
308 
309 
319 int_t getSimpleStatus( returnValue returnvalue,
320  BooleanType doPrintStatus = BT_FALSE
321  );
322 
323 
328  int_t nC,
329  real_t* A,
331  real_t* lbA,
333  real_t* ubA,
335  int_t type = 1
336  );
337 
338 
339 #ifdef __DEBUG__
340 
341 extern "C" void gdb_printmat( const char *fname,
342  real_t *M,
343  int_t n,
344  int_t m,
345  int_t ldim
346  );
347 #endif /* __DEBUG__ */
348 
349 
350 #if defined(__DSPACE__) || defined(__XPCTARGET__) || defined(__C_WRAPPER__)
351 extern "C" void __cxa_pure_virtual( void );
352 #endif /* __DSPACE__ || __XPCTARGET__*/
353 
354 
355 
357 
358 
359 #include <qpOASES/Utils.ipp>
360 
361 #endif /* QPOASES_UTILS_HPP */
362 
363 
364 /*
365  * end of file
366  */
real_t getSqrt(real_t x)
BooleanType isZero(real_t x, real_t TOL=ZERO)
returnValue getKktViolation(int_t nV, int_t nC, const real_t *const H, const real_t *const g, const real_t *const A, const real_t *const lb, const real_t *const ub, const real_t *const lbA, const real_t *const ubA, const real_t *const x, const real_t *const y, real_t &stat, real_t &feas, real_t &cmpl, const real_t *const workingSetB=0, const real_t *const workingSetC=0, BooleanType hasIdentityHessian=BT_FALSE)
Allows to pass back messages to the calling function.
returnValue writeIntoFile(const real_t *const data, int_t nrow, int_t ncol, const char *datafilename, BooleanType append=BT_FALSE)
const double ZERO
returnValue readFromFile(real_t *data, int_t nrow, int_t ncol, const char *datafilename)
returnValue normaliseConstraints(int_t nV, int_t nC, real_t *A, real_t *lbA, real_t *ubA, int_t type=1)
real_t getNorm(const real_t *const v, int_t n, int_t type=2)
returnValue convertBooleanTypeToString(BooleanType value, char *const string)
real_t getAbs(real_t x)
BEGIN_NAMESPACE_QPOASES returnValue print(const real_t *const v, int_t n, const char *name=0)
#define v
PrintLevel
returnValue writeIntoMatFile(FILE *const matFile, const real_t *const data, int_t nRows, int_t nCols, const char *name)
returnValue convertPrintLevelToString(PrintLevel value, char *const string)
int_t getMin(int_t x, int_t y)
returnValue convertSubjectToStatusToString(SubjectToStatus value, char *const string)
real_t getSign(real_t arg)
#define BT_FALSE
Definition: acado_types.hpp:49
double real_t
Definition: AD_test.c:10
int_t getSimpleStatus(returnValue returnvalue, BooleanType doPrintStatus=BT_FALSE)
returnValue myPrintf(const char *s)
int_t getMax(int_t x, int_t y)
BooleanType isEqual(real_t x, real_t y, real_t TOL=ZERO)


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