qpOASES-3.2.0/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-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 {
46 
47  /* 1) Define benchmark arguments. */
48  BooleanType isSparse = BT_FALSE;
50  options.setToMPC();
51  options.printLevel = PL_NONE;
52 
53  int_t nWSR = 300;
54  real_t maxCPUtime = 10.0; /* seconds */
55  real_t maxStationarity, maxFeasibility, maxComplementarity;
56 
57  /* 2) Run benchmark. */
58  if ( runOqpBenchmark( "./chain80/",
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  */
#define PL_NONE
returnValue myPrintf(const char *s)
Provides a generic way to set and pass user-specified options.
Definition: options.hpp:65
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)
returnValue setToMPC()
#define BT_FALSE
Definition: acado_types.hpp:49
double real_t
Definition: AD_test.c:10


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