qpOASES-3.0beta/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-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 {
46 
47  /* 1) Define benchmark arguments. */
48  BooleanType isSparse = BT_FALSE;
50  options.setToFast();
51 // options.setToReliable();
52 
53  int nWSR = 600;
54  real_t maxCPUtime = 10.0; /* seconds */
55  real_t maxPrimalDeviation, maxDualDeviation, maxObjDeviation;
56 
57  /* 2) Run benchmark. */
58  if ( runOQPbenchmark( "./chain80w/",
59  isSparse,
60  options,
61  nWSR,
62  maxCPUtime,
63  maxPrimalDeviation,
64  maxDualDeviation,
65  maxObjDeviation
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 primal deviation: %.2e\n",maxPrimalDeviation );
77  printf( "maximum dual deviation: %.2e\n",maxDualDeviation );
78  printf( "maximum objective deviation: %.2e\n",maxObjDeviation );
79  printf( "\n" );
80  printf( "maximum CPU time: %.2f milliseconds\n\n",1000.0*maxCPUtime );
81 
82  return 0;
83 }
84 
85 
86 /*
87  * end of file
88  */
returnValue runOQPbenchmark(const char *path, BooleanType isSparse, const Options &options, int &nWSR, real_t &maxCPUtime, real_t &maxStationarity, real_t &maxFeasibility, real_t &maxComplementarity)
returnValue myPrintf(const char *s)
Provides a generic way to set and pass user-specified options.
Definition: options.hpp:65
#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