00001 /* 00002 * This file is part of qpOASES. 00003 * 00004 * qpOASES -- An Implementation of the Online Active Set Strategy. 00005 * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 00006 * 00007 * qpOASES is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * qpOASES is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with qpOASES; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 * 00021 */ 00022 00023 00034 #include <QProblemB.hpp> 00035 00036 00038 int main( ) 00039 { 00040 /* Setup data of first QP. */ 00041 real_t H[2*2] = { 1.0, 0.0, 0.0, 0.5 }; 00042 real_t g[2] = { 1.5, 1.0 }; 00043 real_t lb[2] = { 0.5, -2.0 }; 00044 real_t ub[2] = { 5.0, 2.0 }; 00045 00046 /* Setup data of second QP. */ 00047 real_t g_new[2] = { 1.0, 1.5 }; 00048 real_t lb_new[2] = { 0.0, -1.0 }; 00049 real_t ub_new[2] = { 5.0, -0.5 }; 00050 00051 00052 /* Setting up QProblemB object. */ 00053 QProblemB example( 2 ); 00054 00055 /* Solve first QP. */ 00056 int nWSR = 10; 00057 example.init( H,g,lb,ub, nWSR,0 ); 00058 00059 /* Solve second QP. */ 00060 nWSR = 10; 00061 example.hotstart( g_new,lb_new,ub_new, nWSR,0 ); 00062 00063 return 0; 00064 } 00065 00066 00067 /* 00068 * end of file 00069 */