Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
external_packages
qpOASES-3.2.0
examples
qpOASES-3.2.0/examples/example3.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-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
39
#include <qpOASES.hpp>
40
41
43
int
main
( )
44
{
45
USING_NAMESPACE_QPOASES
46
47
/* 1) Define benchmark arguments. */
48
BooleanType
isSparse =
BT_FALSE
;
49
Options
options
;
50
options.
setToMPC
();
51
options.
printLevel
=
PL_NONE
;
52
53
int_t
nWSR
= 600;
54
real_t
maxCPUtime = 10.0;
/* seconds */
55
real_t
maxStationarity, maxFeasibility, maxComplementarity;
56
57
/* 2) Run benchmark. */
58
if
(
runOqpBenchmark
(
"./chain80w/"
,
59
isSparse,
60
options,
61
nWSR,
62
maxCPUtime,
63
maxStationarity,
64
maxFeasibility,
65
maxComplementarity
66
) !=
SUCCESSFUL_RETURN
)
67
{
68
myPrintf
(
"In order to run this example, you need to download example no. 02\nfrom the Online QP Benchmark Collection website first!\n"
);
69
return
-1;
70
}
71
72
/* 3) Print results. */
73
printf(
"\n\n"
);
74
printf(
"OQP Benchmark Results:\n"
);
75
printf(
"======================\n\n"
);
76
printf(
"maximum violation stationarity: %.3e\n"
,maxStationarity );
77
printf(
"maximum violation feasibility: %.3e\n"
,maxFeasibility );
78
printf(
"maximum violation complementarity: %.3e\n"
,maxComplementarity );
79
printf(
"\n"
);
80
printf(
"maximum CPU time: %.3f milliseconds\n\n"
,1000.0*maxCPUtime );
81
82
return
0;
83
}
84
85
86
/*
87
* end of file
88
*/
USING_NAMESPACE_QPOASES
#define USING_NAMESPACE_QPOASES
Definition:
external_packages/qpOASES-3.0beta/include/qpOASES/Types.hpp:123
SUCCESSFUL_RETURN
Definition:
acado_types.hpp:836
example1.options
options
Definition:
example1.py:54
PL_NONE
#define PL_NONE
Definition:
qpOASES_wrapper.h:83
myPrintf
returnValue myPrintf(const char *s)
Definition:
external_packages/qpOASES-3.0beta/src/Utils.cpp:242
int_t
int int_t
Definition:
external_packages/qpOASES-3.2.0/include/qpOASES/Types.hpp:174
example1.nWSR
nWSR
Definition:
example1.py:59
Options::printLevel
PrintLevel printLevel
Definition:
qpOASES-3.0beta/include/qpOASES/Options.hpp:117
BooleanType
BooleanType
Definition:
examples/code_generation/mpc_mhe/getting_started_export/qpoases/INCLUDE/Types.hpp:44
Options
Provides a generic way to set and pass user-specified options.
Definition:
options.hpp:65
runOqpBenchmark
returnValue runOqpBenchmark(const char *path, BooleanType isSparse, const Options &options, int_t &nWSR, real_t &maxCPUtime, real_t &maxStationarity, real_t &maxFeasibility, real_t &maxComplementarity)
Definition:
qpOASES-3.2.0/src/OQPinterface.cpp:569
Options::setToMPC
returnValue setToMPC()
Definition:
qpOASES-3.2.0/src/Options.cpp:191
BT_FALSE
#define BT_FALSE
Definition:
acado_types.hpp:49
main
int main()
Definition:
qpOASES-3.2.0/examples/example3.cpp:43
real_t
double real_t
Definition:
AD_test.c:10
acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:33