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


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