example3.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.setToReliable();
00052 
00053         int nWSR = 600;
00054         real_t maxCPUtime = 10.0; /* seconds */
00055         real_t maxPrimalDeviation, maxDualDeviation, maxObjDeviation;
00056 
00057         /* 2) Run benchmark. */
00058         if ( runOQPbenchmark(   "./chain80w/",
00059                                                         isSparse,
00060                                                         options,
00061                                                         nWSR,
00062                                                         maxCPUtime,
00063                                                         maxPrimalDeviation,
00064                                                         maxDualDeviation,
00065                                                         maxObjDeviation
00066                                                         ) != SUCCESSFUL_RETURN )
00067         {
00068                 myPrintf( "In order to run this example, you need to download example no. 02\nfrom the Online QP Benchmark Collection website first!\n" );
00069                 return -1;
00070         }
00071 
00072         /* 3) Print results. */
00073         printf( "\n\n" );
00074         printf( "OQP Benchmark Results:\n" );
00075         printf( "======================\n\n" );
00076         printf( "maximum primal deviation:     %.2e\n",maxPrimalDeviation );
00077         printf( "maximum dual deviation:       %.2e\n",maxDualDeviation );
00078         printf( "maximum objective deviation:  %.2e\n",maxObjDeviation );
00079         printf( "\n" );
00080         printf( "maximum CPU time:             %.2f milliseconds\n\n",1000.0*maxCPUtime );
00081 
00082         return 0;
00083 }
00084 
00085 
00086 /*
00087  *      end of file
00088  */


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