example3b.cpp
Go to the documentation of this file.
00001 /*
00002  *      This file is part of qpOASES.
00003  *
00004  *      qpOASES -- An Implementation of the Online Active Set Strategy.
00005  *      Copyright (C) 2007-2011 by Hans Joachim Ferreau, Andreas Potschka,
00006  *      Christian Kirches et al. All rights reserved.
00007  *
00008  *      qpOASES is free software; you can redistribute it and/or
00009  *      modify it under the terms of the GNU Lesser General Public
00010  *      License as published by the Free Software Foundation; either
00011  *      version 2.1 of the License, or (at your option) any later version.
00012  *
00013  *      qpOASES is distributed in the hope that it will be useful,
00014  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  *      See the GNU Lesser General Public License for more details.
00017  *
00018  *      You should have received a copy of the GNU Lesser General Public
00019  *      License along with qpOASES; if not, write to the Free Software
00020  *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00021  *
00022  */
00023 
00024 
00039 #include <qpOASES.hpp>
00040 
00041 
00043 int main( )
00044 {
00045         USING_NAMESPACE_QPOASES
00046 
00047         /* 1) Define benchmark arguments. */
00048         BooleanType isSparse = BT_FALSE;
00049         Options options;
00050 //      options.setToFast();
00051 //      options.enableFarBounds = BT_TRUE;
00052         options.setToReliable();
00053 //      options.numRefinementSteps = 0;
00054         
00055         int nWSR = 300;
00056         real_t maxCPUtime = 10.0; /* seconds */
00057         real_t maxPrimalDeviation=0.0, maxDualDeviation=0.0, maxObjDeviation=0.0;
00058 
00059         /* 2) Run benchmark. */
00060         if ( runOQPbenchmark(   "./chain80/",
00061                                                         isSparse,
00062                                                         options,
00063                                                         nWSR,
00064                                                         maxCPUtime,
00065                                                         maxPrimalDeviation,
00066                                                         maxDualDeviation,
00067                                                         maxObjDeviation
00068                                                         ) != SUCCESSFUL_RETURN )
00069         {
00070                 myPrintf( "In order to run this example, you need to download example no. 02\nfrom the Online QP Benchmark Collection website first!\n" );
00071                 return -1;
00072         }
00073 
00074         /* 3) Print results. */
00075         printf( "\n\n" );
00076         printf( "OQP Benchmark Results:\n" );
00077         printf( "======================\n\n" );
00078         printf( "maximum primal deviation:     %.2e\n",maxPrimalDeviation );
00079         printf( "maximum dual deviation:       %.2e\n",maxDualDeviation );
00080         printf( "maximum objective deviation:  %.2e\n",maxObjDeviation );
00081         printf( "\n" );
00082         printf( "maximum CPU time:             %.2f milliseconds\n\n",1000.0*maxCPUtime );
00083 
00084         return 0;
00085 }
00086 
00087 
00088 /*
00089  *      end of file
00090  */


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 11:58:09