qpoases/EXAMPLES/example1b.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-2008 by Hans Joachim Ferreau et al. All rights reserved.
6  *
7  * qpOASES is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * qpOASES is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with qpOASES; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  */
22 
23 
34 #include <QProblemB.hpp>
35 
36 
38 int main( )
39 {
40  /* Setup data of first QP. */
41  real_t H[2*2] = { 1.0, 0.0, 0.0, 0.5 };
42  real_t g[2] = { 1.5, 1.0 };
43  real_t lb[2] = { 0.5, -2.0 };
44  real_t ub[2] = { 5.0, 2.0 };
45 
46  /* Setup data of second QP. */
47  real_t g_new[2] = { 1.0, 1.5 };
48  real_t lb_new[2] = { 0.0, -1.0 };
49  real_t ub_new[2] = { 5.0, -0.5 };
50 
51 
52  /* Setting up QProblemB object. */
53  QProblemB example( 2 );
54 
55  /* Solve first QP. */
56  int nWSR = 10;
57  example.init( H,g,lb,ub, nWSR,0 );
58 
59  /* Solve second QP. */
60  nWSR = 10;
61  example.hotstart( g_new,lb_new,ub_new, nWSR,0 );
62 
63  return 0;
64 }
65 
66 
67 /*
68  * end of file
69  */
Implements the online active set strategy for box-constrained QPs.
returnValue init(const real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int &nWSR, const real_t *const yOpt=0, real_t *const cputime=0)
returnValue hotstart(const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int &nWSR, real_t *const cputime)
double real_t
Definition: AD_test.c:10


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