qpOASES_e.c
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-2015 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 
36 #include <qpOASES_e.h>
37 
38 
40 
41 #include "qpOASES_e_matlab_utils.h"
42 #include "qpOASES_e_matlab_utils.c"
43 
44 
45 /*
46  * Q P r o b l e m _ q p O A S E S
47  */
48 int QProblem_qpOASES( int nV, int nC, HessianType hessianType, int nP,
49  DenseMatrix* H, double* g, DenseMatrix* A,
50  double* lb, double* ub,
51  double* lbA, double* ubA,
52  int nWSRin, real_t maxCpuTimeIn,
53  const double* const x0, Options* options,
54  int nOutputs, mxArray* plhs[],
55  const double* const guessedBounds, const double* const guessedConstraints,
56  const double* const _R
57  )
58 {
59  int i,k;
60  int nWSRout;
61  real_t maxCpuTimeOut;
62  returnValue returnvalue;
63  static char msg[QPOASES_MAX_STRING_LENGTH];
64 
65  real_t *g_current, *lb_current, *ub_current, *lbA_current, *ubA_current;
66 
67  /* 1) Setup initial QP. */
68  static QProblem QP;
69  static Bounds bounds;
70  static Constraints constraints;
71 
72  QProblemCON( &QP,nV,nC,hessianType );
73  QProblem_setOptions( &QP,*options );
74 
75  /* 2) Solve initial QP. */
76  BoundsCON( &bounds,nV );
77  ConstraintsCON( &constraints,nC );
78 
79  if (guessedBounds != 0) {
80  for (i = 0; i < nV; i++) {
81  if ( qpOASES_isEqual(guessedBounds[i],-1.0,QPOASES_TOL) == BT_TRUE ) {
82  Bounds_setupBound( &bounds,i,ST_LOWER );
83  } else if ( qpOASES_isEqual(guessedBounds[i],1.0,QPOASES_TOL) == BT_TRUE ) {
84  Bounds_setupBound( &bounds,i,ST_UPPER );
85  } else if ( qpOASES_isEqual(guessedBounds[i],0.0,QPOASES_TOL) == BT_TRUE ) {
86  Bounds_setupBound( &bounds,i,ST_INACTIVE );
87  } else {
88  snprintf(msg, QPOASES_MAX_STRING_LENGTH,
89  "ERROR (qpOASES_e): Only {-1, 0, 1} allowed for status of bounds!");
90  myMexErrMsgTxt(msg);
91  return -1;
92  }
93  }
94  }
95 
96  if (guessedConstraints != 0) {
97  for (i = 0; i < nC; i++) {
98  if ( qpOASES_isEqual(guessedConstraints[i],-1.0,QPOASES_TOL) == BT_TRUE ) {
99  Constraints_setupConstraint( &constraints,i,ST_LOWER );
100  } else if ( qpOASES_isEqual(guessedConstraints[i],1.0,QPOASES_TOL) == BT_TRUE ) {
101  Constraints_setupConstraint( &constraints,i,ST_UPPER );
102  } else if ( qpOASES_isEqual(guessedConstraints[i],0.0,QPOASES_TOL) == BT_TRUE ) {
103  Constraints_setupConstraint( &constraints,i,ST_INACTIVE );
104  } else {
105  snprintf(msg, QPOASES_MAX_STRING_LENGTH,
106  "ERROR (qpOASES_e): Only {-1, 0, 1} allowed for status of constraints!");
107  myMexErrMsgTxt(msg);
108  return -1;
109  }
110  }
111  }
112 
113  nWSRout = nWSRin;
114  maxCpuTimeOut = (maxCpuTimeIn >= 0.0) ? maxCpuTimeIn : QPOASES_INFTY;
115 
116  returnvalue = QProblem_initMW( &QP, H,g,A,lb,ub,lbA,ubA,
117  &nWSRout,&maxCpuTimeOut,
118  x0,0,
119  (guessedBounds != 0) ? &bounds : 0, (guessedConstraints != 0) ? &constraints : 0,
120  _R
121  );
122 
123  /* 3) Solve remaining QPs and assign lhs arguments. */
124  /* Set up pointers to the current QP vectors */
125  g_current = g;
126  lb_current = lb;
127  ub_current = ub;
128  lbA_current = lbA;
129  ubA_current = ubA;
130 
131  /* Loop through QP sequence. */
132  for ( k=0; k<nP; ++k )
133  {
134  if ( k > 0 )
135  {
136  /* update pointers to the current QP vectors */
137  g_current = &(g[k*nV]);
138  if ( lb != 0 )
139  lb_current = &(lb[k*nV]);
140  if ( ub != 0 )
141  ub_current = &(ub[k*nV]);
142  if ( lbA != 0 )
143  lbA_current = &(lbA[k*nC]);
144  if ( ubA != 0 )
145  ubA_current = &(ubA[k*nC]);
146 
147  nWSRout = nWSRin;
148  maxCpuTimeOut = (maxCpuTimeIn >= 0.0) ? maxCpuTimeIn : QPOASES_INFTY;
149  returnvalue = QProblem_hotstart( &QP,g_current,lb_current,ub_current,lbA_current,ubA_current, &nWSRout,&maxCpuTimeOut );
150  }
151 
152  /* write results into output vectors */
153  obtainOutputs( k,&QP,returnvalue,nWSRout,maxCpuTimeOut,
154  nOutputs,plhs,nV,nC,-1 );
155  }
156 
157  /* QP.writeQpDataIntoMatFile( "qpDataMat0.mat" ); */
158 
159  return 0;
160 }
161 
162 
163 
164 /*
165  * Q P r o b l e m B _ q p O A S E S
166  */
167 int QProblemB_qpOASES( int nV, HessianType hessianType, int nP,
168  DenseMatrix* H, double* g,
169  double* lb, double* ub,
170  int nWSRin, real_t maxCpuTimeIn,
171  const double* const x0, Options* options,
172  int nOutputs, mxArray* plhs[],
173  const double* const guessedBounds,
174  const double* const _R
175  )
176 {
177  int i,k;
178  int nWSRout;
179  real_t maxCpuTimeOut;
180  returnValue returnvalue;
181  static char msg[QPOASES_MAX_STRING_LENGTH];
182 
183  real_t *g_current, *lb_current, *ub_current;
184 
185  /* 1) Setup initial QP. */
186  static QProblemB QP;
187  static Bounds bounds;
188 
189  QProblemBCON( &QP,nV,hessianType );
190  QProblemB_setOptions( &QP,*options );
191 
192  /* 2) Solve initial QP. */
193  BoundsCON( &bounds,nV );
194  if (guessedBounds != 0) {
195  for (i = 0; i < nV; i++) {
196  if ( qpOASES_isEqual(guessedBounds[i],-1.0,QPOASES_TOL) == BT_TRUE ) {
197  Bounds_setupBound( &bounds,i,ST_LOWER );
198  } else if ( qpOASES_isEqual(guessedBounds[i],1.0,QPOASES_TOL) == BT_TRUE ) {
199  Bounds_setupBound( &bounds,i,ST_UPPER );
200  } else if ( qpOASES_isEqual(guessedBounds[i],0.0,QPOASES_TOL) == BT_TRUE ) {
201  Bounds_setupBound( &bounds,i,ST_INACTIVE );
202  } else {
203  snprintf(msg, QPOASES_MAX_STRING_LENGTH,
204  "ERROR (qpOASES_e): Only {-1, 0, 1} allowed for status of bounds!");
205  myMexErrMsgTxt(msg);
206  return -1;
207  }
208  }
209  }
210 
211  nWSRout = nWSRin;
212  maxCpuTimeOut = (maxCpuTimeIn >= 0.0) ? maxCpuTimeIn : QPOASES_INFTY;
213 
214  returnvalue = QProblemB_initMW( &QP, H,g,lb,ub,
215  &nWSRout,&maxCpuTimeOut,
216  x0,0,
217  (guessedBounds != 0) ? &bounds : 0,
218  _R
219  );
220 
221  /* 3) Solve remaining QPs and assign lhs arguments. */
222  /* Set up pointers to the current QP vectors */
223  g_current = g;
224  lb_current = lb;
225  ub_current = ub;
226 
227  /* Loop through QP sequence. */
228  for ( k=0; k<nP; ++k )
229  {
230  if ( k > 0 )
231  {
232  /* update pointers to the current QP vectors */
233  g_current = &(g[k*nV]);
234  if ( lb != 0 )
235  lb_current = &(lb[k*nV]);
236  if ( ub != 0 )
237  ub_current = &(ub[k*nV]);
238 
239  nWSRout = nWSRin;
240  maxCpuTimeOut = (maxCpuTimeIn >= 0.0) ? maxCpuTimeIn : QPOASES_INFTY;
241  returnvalue = QProblemB_hotstart( &QP,g_current,lb_current,ub_current, &nWSRout,&maxCpuTimeOut );
242  }
243 
244  /* write results into output vectors */
245  obtainOutputsSB( k,&QP,returnvalue,nWSRout,maxCpuTimeOut,
246  nOutputs,plhs,nV,-1 );
247  }
248 
249  return 0;
250 }
251 
252 
253 
254 /*
255  * m e x F u n c t i o n
256  */
257 void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[] )
258 {
259  /* inputs */
260  static DenseMatrix H;
261  static DenseMatrix A;
262 
263  real_t *g=0, *lb=0, *ub=0, *lbA=0, *ubA=0;
264  HessianType hessianType = HST_UNKNOWN;
265  double *x0=0, *R_for=0;
266  static real_t R[NVMAX*NVMAX];
267  double *guessedBounds=0, *guessedConstraints=0;
268 
269  int H_idx=-1, g_idx=-1, A_idx=-1, lb_idx=-1, ub_idx=-1, lbA_idx=-1, ubA_idx=-1;
270  int options_idx=-1, x0_idx=-1, auxInput_idx=-1;
271 
272  /* dimensions */
273  unsigned int nV=0, nC=0, nP=0;
274  BooleanType isSimplyBoundedQp = BT_FALSE;
275 
276  int numberOfColumns;
277  int nWSRin;
278  real_t maxCpuTimeIn;
279  static char msg[QPOASES_MAX_STRING_LENGTH];
280 
281  /* Setup default options */
282  static Options options;
283  Options_setToDefault( &options );
284  options.printLevel = PL_LOW;
285  #ifdef __DEBUG__
286  options.printLevel = PL_HIGH;
287  #endif
288  #ifdef __SUPPRESSANYOUTPUT__
289  options.printLevel = PL_NONE;
290  #endif
291 
292 
293  /* I) CONSISTENCY CHECKS: */
294  /* 1a) Ensure that qpOASES is called with a feasible number of input arguments. */
295  if ( ( nrhs < 4 ) || ( nrhs > 9 ) )
296  {
297  myMexErrMsgTxt( "ERROR (qpOASES_e): Invalid number of input arguments!\nType 'help qpOASES' for further information." );
298  return;
299  }
300 
301  /* 2) Check for proper number of output arguments. */
302  if ( nlhs > 6 )
303  {
304  myMexErrMsgTxt( "ERROR (qpOASES_e): At most six output arguments are allowed: \n [x,fval,exitflag,iter,lambda,auxOutput]!" );
305  return;
306  }
307  if ( nlhs < 1 )
308  {
309  myMexErrMsgTxt( "ERROR (qpOASES_e): At least one output argument is required: [x,...]!" );
310  return;
311  }
312 
313 
314  /* II) PREPARE RESPECTIVE QPOASES FUNCTION CALL: */
315  /* Choose between QProblem and QProblemB object and assign the corresponding
316  * indices of the input pointer array in to order to access QP data correctly. */
317  g_idx = 1;
318 
319  if ( mxIsEmpty(prhs[0]) == 1 )
320  {
321  H_idx = -1;
322  nV = (int)mxGetM( prhs[ g_idx ] ); /* if Hessian is empty, row number of gradient vector */
323  }
324  else
325  {
326  H_idx = 0;
327  nV = (int)mxGetM( prhs[ H_idx ] ); /* row number of Hessian matrix */
328  }
329 
330  nP = (int)mxGetN( prhs[ g_idx ] ); /* number of columns of the gradient matrix (vectors series have to be stored columnwise!) */
331 
332  if ( nrhs <= 6 )
333  isSimplyBoundedQp = BT_TRUE;
334  else
335  isSimplyBoundedQp = BT_FALSE;
336 
337 
338  /* 0) Check whether options are specified .*/
339  if ( isSimplyBoundedQp == BT_TRUE )
340  {
341  if ( ( nrhs >= 5 ) && ( !mxIsEmpty(prhs[4]) ) && ( mxIsStruct(prhs[4]) ) )
342  options_idx = 4;
343  }
344  else
345  {
346  /* Consistency check */
347  if ( ( !mxIsEmpty(prhs[4]) ) && ( mxIsStruct(prhs[4]) ) )
348  {
349  myMexErrMsgTxt( "ERROR (qpOASES_e): Fifth input argument must not be a struct when solving QP with general constraints!\nType 'help qpOASES' for further information." );
350  return;
351  }
352 
353  if ( ( nrhs >= 8 ) && ( !mxIsEmpty(prhs[7]) ) && ( mxIsStruct(prhs[7]) ) )
354  options_idx = 7;
355  }
356 
357  /* Is the third argument constraint Matrix A? */
358  numberOfColumns = (int)mxGetN(prhs[2]);
359 
360  /* 1) Simply bounded QP. */
361  if ( ( isSimplyBoundedQp == BT_TRUE ) ||
362  ( ( numberOfColumns == 1 ) && ( nV != 1 ) ) )
363  {
364  lb_idx = 2;
365  ub_idx = 3;
366 
367  if ( ( nrhs >= 6 ) && ( !mxIsEmpty(prhs[5]) ) )
368  {
369  /* auxInput specified */
370  if ( mxIsStruct(prhs[5]) )
371  {
372  auxInput_idx = 5;
373  x0_idx = -1;
374  }
375  else
376  {
377  auxInput_idx = -1;
378  x0_idx = 5;
379  }
380  }
381  else
382  {
383  auxInput_idx = -1;
384  x0_idx = -1;
385  }
386  }
387  else
388  {
389  A_idx = 2;
390 
391  /* If constraint matrix is empty, use a QProblemB object! */
392  if ( mxIsEmpty( prhs[ A_idx ] ) )
393  {
394  lb_idx = 3;
395  ub_idx = 4;
396 
397  nC = 0;
398  }
399  else
400  {
401  lb_idx = 3;
402  ub_idx = 4;
403  lbA_idx = 5;
404  ubA_idx = 6;
405 
406  nC = (int)mxGetM( prhs[ A_idx ] ); /* row number of constraint matrix */
407  }
408 
409  if ( ( nrhs >= 9 ) && ( !mxIsEmpty(prhs[8]) ) )
410  {
411  /* auxInput specified */
412  if ( mxIsStruct(prhs[8]) )
413  {
414  auxInput_idx = 8;
415  x0_idx = -1;
416  }
417  else
418  {
419  auxInput_idx = -1;
420  x0_idx = 8;
421  }
422  }
423  else
424  {
425  auxInput_idx = -1;
426  x0_idx = -1;
427  }
428  }
429 
430 
431  /* ensure that data is given in real_t precision */
432  if ( ( ( H_idx >= 0 ) && ( mxIsDouble( prhs[ H_idx ] ) == 0 ) ) ||
433  ( mxIsDouble( prhs[ g_idx ] ) == 0 ) )
434  {
435  myMexErrMsgTxt( "ERROR (qpOASES_e): All data has to be provided in double precision!" );
436  return;
437  }
438 
439  /* check if supplied data contains 'NaN' or 'Inf' */
440  if (containsNaNorInf( prhs,H_idx,BT_FALSE ) == BT_TRUE)
441  return;
442 
443  if (containsNaNorInf( prhs,g_idx,BT_FALSE ) == BT_TRUE)
444  return;
445 
446  if (containsNaNorInf( prhs,lb_idx,BT_TRUE ) == BT_TRUE)
447  return;
448 
449  if (containsNaNorInf( prhs,ub_idx,BT_TRUE ) == BT_TRUE)
450  return;
451 
452  /* Check inputs dimensions and assign pointers to inputs. */
453  if ( ( H_idx >= 0 ) && ( ( mxGetN( prhs[ H_idx ] ) != nV ) || ( mxGetM( prhs[ H_idx ] ) != nV ) ) )
454  {
455  snprintf(msg, QPOASES_MAX_STRING_LENGTH, "ERROR (qpOASES_e): Hessian matrix dimension mismatch (%ld != %d)!",
456  (long int)mxGetN(prhs[H_idx]), nV);
457  myMexErrMsgTxt(msg);
458  return;
459  }
460 
461  if ( nC > 0 )
462  {
463  /* ensure that data is given in real_t precision */
464  if ( mxIsDouble( prhs[ A_idx ] ) == 0 )
465  {
466  myMexErrMsgTxt( "ERROR (qpOASES_e): All data has to be provided in real_t precision!" );
467  return;
468  }
469 
470  /* Check inputs dimensions and assign pointers to inputs. */
471  if ( mxGetN( prhs[ A_idx ] ) != nV )
472  {
473  snprintf(msg, QPOASES_MAX_STRING_LENGTH, "ERROR (qpOASES_e): Constraint matrix input dimension mismatch (%ld != %d)!",
474  (long int)mxGetN(prhs[A_idx]), nV);
475  myMexErrMsgTxt(msg);
476  return;
477  }
478 
479  if (containsNaNorInf( prhs,A_idx,BT_FALSE ) == BT_TRUE)
480  return;
481 
482  if (containsNaNorInf( prhs,lbA_idx,BT_TRUE ) == BT_TRUE)
483  return;
484 
485  if (containsNaNorInf( prhs,ubA_idx,BT_TRUE ) == BT_TRUE)
486  return;
487  }
488 
489  /* check dimensions and copy auxInputs */
490  if ( smartDimensionCheck( &g,nV,nP, BT_FALSE,prhs,g_idx ) != SUCCESSFUL_RETURN )
491  return;
492 
493  if ( smartDimensionCheck( &lb,nV,nP, BT_TRUE,prhs,lb_idx ) != SUCCESSFUL_RETURN )
494  return;
495 
496  if ( smartDimensionCheck( &ub,nV,nP, BT_TRUE,prhs,ub_idx ) != SUCCESSFUL_RETURN )
497  return;
498 
499  if ( smartDimensionCheck( &x0,nV,1, BT_TRUE,prhs,x0_idx ) != SUCCESSFUL_RETURN )
500  return;
501 
502  if ( nC > 0 )
503  {
504  if ( smartDimensionCheck( &lbA,nC,nP, BT_TRUE,prhs,lbA_idx ) != SUCCESSFUL_RETURN )
505  return;
506 
507  if ( smartDimensionCheck( &ubA,nC,nP, BT_TRUE,prhs,ubA_idx ) != SUCCESSFUL_RETURN )
508  return;
509  }
510 
511  if ( auxInput_idx >= 0 )
512  setupAuxiliaryInputs( prhs[auxInput_idx],nV,nC, &hessianType,&x0,&guessedBounds,&guessedConstraints,&R_for );
513 
514  /* convert Cholesky factor to C storage format */
515  if ( R_for != 0 )
516  {
517  convertFortranToC( R_for, nV,nV, R );
518  }
519 
520  /* III) ACTUALLY PERFORM QPOASES FUNCTION CALL: */
521  nWSRin = 5*(nV+nC);
522  maxCpuTimeIn = -1.0;
523 
524  if ( options_idx > 0 )
525  setupOptions( &options,prhs[options_idx],&nWSRin,&maxCpuTimeIn );
526 
527  /* make a deep-copy of the user-specified Hessian matrix (possibly sparse) */
528  if ( H_idx >= 0 )
529  setupHessianMatrix( prhs[H_idx],nV, &H );
530 
531  /* make a deep-copy of the user-specified constraint matrix (possibly sparse) */
532  if ( ( nC > 0 ) && ( A_idx >= 0 ) )
533  setupConstraintMatrix( prhs[A_idx],nV,nC, &A );
534 
535  allocateOutputs( nlhs,plhs,nV,nC,nP,-1 );
536 
537  if ( nC == 0 )
538  {
539  /* Call qpOASES (using QProblemB class). */
540  QProblemB_qpOASES( nV,hessianType, nP,
541  ( H_idx >= 0 ) ? &H : 0, g,
542  lb,ub,
543  nWSRin,maxCpuTimeIn,
544  x0,&options,
545  nlhs,plhs,
546  guessedBounds,
547  ( R_for != 0 ) ? R : 0
548  );
549  return;
550  }
551  else
552  {
553  /* Call qpOASES (using QProblem class). */
554  QProblem_qpOASES( nV,nC,hessianType, nP,
555  ( H_idx >= 0 ) ? &H : 0, g, ( ( nC > 0 ) && ( A_idx >= 0 ) ) ? &A : 0,
556  lb,ub,lbA,ubA,
557  nWSRin,maxCpuTimeIn,
558  x0,&options,
559  nlhs,plhs,
560  guessedBounds,guessedConstraints,
561  ( R_for != 0 ) ? R : 0
562  );
563  return;
564  }
565 }
566 
567 /*
568  * end of file
569  */
void QProblemBCON(QProblemB *_THIS, int _nV, HessianType _hessianType)
Definition: QProblemB.c:45
returnValue Bounds_setupBound(Bounds *_THIS, int number, SubjectToStatus _status)
Definition: Bounds.c:125
USING_NAMESPACE_QPOASES int QProblem_qpOASES(int nV, int nC, HessianType hessianType, int nP, DenseMatrix *H, double *g, DenseMatrix *A, double *lb, double *ub, double *lbA, double *ubA, int nWSRin, real_t maxCpuTimeIn, const double *const x0, Options *options, int nOutputs, mxArray *plhs[], const double *const guessedBounds, const double *const guessedConstraints, const double *const _R)
Definition: qpOASES_e.c:48
BooleanType containsNaNorInf(const mxArray *prhs[], int_t rhs_index, bool mayContainInf)
static BooleanType qpOASES_isEqual(real_t x, real_t y, real_t TOL)
Definition: Utils.h:371
#define ST_LOWER
returnValue setupHessianMatrix(const mxArray *prhsH, int_t nV, SymmetricMatrix **H, sparse_int_t **Hir, sparse_int_t **Hjc, real_t **Hv)
Implements the online active set strategy for box-constrained QPs.
#define myMexErrMsgTxt
returnValue setupOptions(Options *options, const mxArray *optionsPtr, int &nWSRin)
Allows to pass back messages to the calling function.
returnValue QProblem_initMW(QProblem *_THIS, DenseMatrix *_H, const real_t *const _g, DenseMatrix *_A, const real_t *const _lb, const real_t *const _ub, const real_t *const _lbA, const real_t *const _ubA, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Constraints *const guessedConstraints, const real_t *const _R)
Definition: QProblem.c:355
returnValue smartDimensionCheck(real_t **input, unsigned int m, unsigned int n, BooleanType emptyAllowed, const mxArray *prhs[], int idx)
returnValue Constraints_setupConstraint(Constraints *_THIS, int number, SubjectToStatus _status)
Definition: Constraints.c:127
returnValue convertFortranToC(const real_t *const A_for, int nV, int nC, real_t *const A)
#define PL_NONE
#define ST_INACTIVE
returnValue obtainOutputsSB(int k, QProblemB *qp, returnValue returnvalue, int _nWSRout, double _cpuTime, int nlhs, mxArray *plhs[], int nV, int handle)
int QProblemB_qpOASES(int nV, HessianType hessianType, int nP, DenseMatrix *H, double *g, double *lb, double *ub, int nWSRin, real_t maxCpuTimeIn, const double *const x0, Options *options, int nOutputs, mxArray *plhs[], const double *const guessedBounds, const double *const _R)
Definition: qpOASES_e.c:167
#define PL_HIGH
Interfaces matrix-vector operations tailored to general dense matrices.
void allocateOutputs(int nlhs, mxArray *plhs[], int nV, int nC=0, int nP=1)
returnValue setupAuxiliaryInputs(const mxArray *auxInput, uint_t nV, uint_t nC, HessianType *hessianType, double **x0, double **guessedBounds, double **guessedConstraints, double **R)
int_t QProblemB_hotstart(const real_t *const g, const real_t *const lb, const real_t *const ub, int_t *const nWSR, real_t *const cputime, real_t *const x, real_t *const y, real_t *const obj, int_t *const status)
Provides a generic way to set and pass user-specified options.
Definition: options.hpp:65
#define PL_LOW
static returnValue QProblemB_setOptions(QProblemB *_THIS, Options _options)
Definition: QProblemB.h:1299
static const real_t QPOASES_INFTY
void obtainOutputs(int k, QProblemB *qp, returnValue returnvalue, int nWSRin, int nlhs, mxArray *plhs[], int nV, int nC=0)
#define BT_TRUE
Definition: acado_types.hpp:47
returnValue Options_setToDefault(Options *_THIS)
Definition: Options.c:112
#define HST_UNKNOWN
returnValue setupConstraintMatrix(const mxArray *prhsA, int_t nV, int_t nC, Matrix **A, sparse_int_t **Air, sparse_int_t **Ajc, real_t **Av)
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Definition: qpOASES_e.c:257
#define QPOASES_MAX_STRING_LENGTH
#define BT_FALSE
Definition: acado_types.hpp:49
Manages working sets of bounds (= box constraints).
int_t QProblem_hotstart(const real_t *const g, const real_t *const lb, const real_t *const ub, const real_t *const lbA, const real_t *const ubA, int_t *const nWSR, real_t *const cputime, real_t *const x, real_t *const y, real_t *const obj, int_t *const status)
#define ST_UPPER
double real_t
Definition: AD_test.c:10
Implements the online active set strategy for QPs with general constraints.
void QProblemCON(QProblem *_THIS, int _nV, int _nC, HessianType _hessianType)
Definition: QProblem.c:51
static const real_t QPOASES_TOL
void ConstraintsCON(Constraints *_THIS, int _n)
Definition: Constraints.c:50
returnValue QProblemB_initMW(QProblemB *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const real_t *const _R)
Definition: QProblemB.c:273
#define R
static returnValue QProblem_setOptions(QProblem *_THIS, Options _options)
Definition: QProblem.h:1818
void BoundsCON(Bounds *_THIS, int _n)
Definition: Bounds.c:50


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