qpOASES 3.2.1
An Implementation of the Online Active Set Strategy
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-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
35#ifndef QPOASES_UTILS_HPP
36#define QPOASES_UTILS_HPP
37
38
40
41
43
44
47returnValue print( const real_t* const v,
48 int_t n,
49 const char* name = 0
50 );
51
54returnValue print( const real_t* const v,
55 int_t n,
56 const int_t* const V_idx,
57 const char* name = 0
58 );
59
62returnValue print( const real_t* const M,
63 int_t nrow,
64 int_t ncol,
65 const char* name = 0
66 );
67
70returnValue 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
80returnValue print( const int_t* const index,
81 int_t n,
82 const char* name = 0
83 );
84
85
88returnValue 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
129returnValue 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
139returnValue writeIntoFile( const real_t* const data,
140 int_t n,
141 const char* datafilename,
142 BooleanType append = BT_FALSE
143 );
144
148returnValue writeIntoFile( const int_t* const integer,
149 int_t n,
150 const char* datafilename,
151 BooleanType append = BT_FALSE
152 );
153
158returnValue writeIntoMatFile( FILE* const matFile,
159 const real_t* const data,
160 int_t nRows,
161 int_t nCols,
162 const char* name
163 );
164
169returnValue 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
180
181
184real_t getNorm( const real_t* const v,
185 int_t n,
186 int_t type = 2
187 );
188
189
193inline BooleanType isEqual( real_t x,
194 real_t y,
195 real_t TOL = ZERO
196 );
197
198
202inline BooleanType isZero( real_t x,
203 real_t TOL = ZERO
204 );
205
206
210inline real_t getSign( real_t arg
211 );
212
213
216inline int_t getMax( int_t x,
217 int_t y
218 );
219
222inline int_t getMin( int_t x,
223 int_t y
224 );
225
226
229inline real_t getMax( real_t x,
230 real_t y
231 );
232
235inline real_t getMin( real_t x,
236 real_t y
237 );
238
241inline real_t getAbs( real_t x
242 );
243
246inline 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
319int_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__
341extern "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__)
351extern "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 */
const real_t ZERO
Definition: Constants.hpp:57
returnValue
Defines all symbols for global return values.
Definition: MessageHandling.hpp:65
BooleanType
Definition: Types.hpp:204
@ BT_FALSE
Definition: Types.hpp:205
SubjectToStatus
Definition: Types.hpp:273
PrintLevel
Definition: Types.hpp:213
int int_t
Definition: Types.hpp:180
BEGIN_NAMESPACE_QPOASES typedef double real_t
Definition: Types.hpp:171
#define END_NAMESPACE_QPOASES
Definition: Types.hpp:110
#define BEGIN_NAMESPACE_QPOASES
Definition: Types.hpp:107
returnValue myPrintf(const char *s)
Definition: Utils.cpp:225
real_t getCPUtime()
Definition: Utils.cpp:581
real_t getSqrt(real_t x)
Definition: Utils.ipp:157
returnValue convertPrintLevelToString(PrintLevel value, char *const string)
Definition: Utils.cpp:870
real_t getNorm(const real_t *const v, int_t n, int_t type=2)
Definition: Utils.cpp:603
BEGIN_NAMESPACE_QPOASES returnValue print(const real_t *const v, int_t n, const char *name=0)
Definition: Utils.cpp:76
returnValue writeIntoMatFile(FILE *const matFile, const real_t *const data, int_t nRows, int_t nCols, const char *name)
Definition: Utils.cpp:507
returnValue normaliseConstraints(int_t nV, int_t nC, real_t *A, real_t *lbA, real_t *ubA, int_t type=1)
Definition: Utils.cpp:963
returnValue convertBooleanTypeToString(BooleanType value, char *const string)
Definition: Utils.cpp:812
int_t getMin(int_t x, int_t y)
Definition: Utils.ipp:99
real_t getSign(real_t arg)
Definition: Utils.ipp:74
BooleanType isEqual(real_t x, real_t y, real_t TOL=ZERO)
Definition: Utils.ipp:45
int_t getMax(int_t x, int_t y)
Definition: Utils.ipp:88
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)
Definition: Utils.cpp:631
returnValue readFromFile(real_t *data, int_t nrow, int_t ncol, const char *datafilename)
Definition: Utils.cpp:273
returnValue writeIntoFile(const real_t *const data, int_t nrow, int_t ncol, const char *datafilename, BooleanType append=BT_FALSE)
Definition: Utils.cpp:388
returnValue convertSubjectToStatusToString(SubjectToStatus value, char *const string)
Definition: Utils.cpp:828
real_t getAbs(real_t x)
Definition: Utils.ipp:143
int_t getSimpleStatus(returnValue returnvalue, BooleanType doPrintStatus=BT_FALSE)
Definition: Utils.cpp:912
BooleanType isZero(real_t x, real_t TOL=ZERO)
Definition: Utils.ipp:60
returnValue printCopyrightNotice()
Definition: Utils.cpp:255