Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
external_packages
qpOASES-3.0beta
examples
qpOASES-3.0beta/examples/example3b.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-2011 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.setToFast();
51
// options.enableFarBounds = BT_TRUE;
52
options.
setToReliable
();
53
// options.numRefinementSteps = 0;
54
55
int
nWSR
= 300;
56
real_t
maxCPUtime = 10.0;
/* seconds */
57
real_t
maxPrimalDeviation=0.0, maxDualDeviation=0.0, maxObjDeviation=0.0;
58
59
/* 2) Run benchmark. */
60
if
(
runOQPbenchmark
(
"./chain80/"
,
61
isSparse,
62
options,
63
nWSR,
64
maxCPUtime,
65
maxPrimalDeviation,
66
maxDualDeviation,
67
maxObjDeviation
68
) !=
SUCCESSFUL_RETURN
)
69
{
70
myPrintf
(
"In order to run this example, you need to download example no. 02\nfrom the Online QP Benchmark Collection website first!\n"
);
71
return
-1;
72
}
73
74
/* 3) Print results. */
75
printf(
"\n\n"
);
76
printf(
"OQP Benchmark Results:\n"
);
77
printf(
"======================\n\n"
);
78
printf(
"maximum primal deviation: %.2e\n"
,maxPrimalDeviation );
79
printf(
"maximum dual deviation: %.2e\n"
,maxDualDeviation );
80
printf(
"maximum objective deviation: %.2e\n"
,maxObjDeviation );
81
printf(
"\n"
);
82
printf(
"maximum CPU time: %.2f milliseconds\n\n"
,1000.0*maxCPUtime );
83
84
return
0;
85
}
86
87
88
/*
89
* end of file
90
*/
runOQPbenchmark
returnValue runOQPbenchmark(const char *path, BooleanType isSparse, const Options &options, int &nWSR, real_t &maxCPUtime, real_t &maxStationarity, real_t &maxFeasibility, real_t &maxComplementarity)
Definition:
qpOASES-3.0beta/src/extras/OQPinterface.cpp:468
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
myPrintf
returnValue myPrintf(const char *s)
Definition:
external_packages/qpOASES-3.0beta/src/Utils.cpp:242
example1.nWSR
nWSR
Definition:
example1.py:59
BooleanType
BooleanType
Definition:
examples/code_generation/mpc_mhe/getting_started_export/qpoases/INCLUDE/Types.hpp:44
main
int main()
Definition:
qpOASES-3.0beta/examples/example3b.cpp:43
Options
Provides a generic way to set and pass user-specified options.
Definition:
options.hpp:65
BT_FALSE
#define BT_FALSE
Definition:
acado_types.hpp:49
real_t
double real_t
Definition:
AD_test.c:10
Options::setToReliable
returnValue setToReliable()
Definition:
qpOASES-3.0beta/src/Options.cpp:139
acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:33