QProblemB.h
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 
38 #ifndef QPOASES_QPROBLEMB_H
39 #define QPOASES_QPROBLEMB_H
40 
41 
42 #include <qpOASES_e/Bounds.h>
43 #include <qpOASES_e/Options.h>
44 #include <qpOASES_e/Matrices.h>
45 #include <qpOASES_e/Flipper.h>
46 
47 
49 
50 
51 
63 typedef struct
64 {
68  real_t g[NVMAX];
69  real_t lb[NVMAX];
70  real_t ub[NVMAX];
72  Bounds bounds;
74  real_t R[NVMAX*NVMAX];
75  BooleanType haveCholesky;
77  real_t x[NVMAX];
78  real_t y[NVMAX+NCMAX];
80  real_t tau;
82  QProblemStatus status;
84  BooleanType infeasible;
85  BooleanType unbounded;
87  HessianType hessianType;
88  real_t regVal;
90  unsigned int count;
92  real_t delta_xFR_TMP[NVMAX];
94  real_t ramp0;
95  real_t ramp1;
96  int rampOffset;
100  Flipper flipper;
102  TabularOutput tabularOutput;
103 } QProblemB;
104 
105 
111 void QProblemBCON( QProblemB* _THIS,
112  int _nV,
113  HessianType _hessianType
114  );
115 
116 void QProblemBCPY( QProblemB* FROM,
117  QProblemB* TO
118  );
119 
120 
125 
126 
141  DenseMatrix *_H,
142  const real_t* const _g,
143  const real_t* const _lb,
145  const real_t* const _ub,
147  int* nWSR,
149  real_t* const cputime
151  );
152 
167  real_t* const _H,
169  const real_t* const _g,
170  const real_t* const _lb,
172  const real_t* const _ub,
174  int* nWSR,
176  real_t* const cputime
178  );
179 
194  const char* const H_file,
196  const char* const g_file,
197  const char* const lb_file,
199  const char* const ub_file,
201  int* nWSR,
203  real_t* const cputime
205  );
206 
228  DenseMatrix *_H,
229  const real_t* const _g,
230  const real_t* const _lb,
232  const real_t* const _ub,
234  int* nWSR,
236  real_t* const cputime,
238  const real_t* const xOpt,
240  const real_t* const yOpt,
242  Bounds* const guessedBounds,
244  const real_t* const _R
248  );
249 
271  real_t* const _H,
273  const real_t* const _g,
274  const real_t* const _lb,
276  const real_t* const _ub,
278  int* nWSR,
280  real_t* const cputime,
282  const real_t* const xOpt,
284  const real_t* const yOpt,
286  Bounds* const guessedBounds,
288  const real_t* const _R
292  );
293 
315  const char* const H_file,
317  const char* const g_file,
318  const char* const lb_file,
320  const char* const ub_file,
322  int* nWSR,
324  real_t* const cputime,
326  const real_t* const xOpt,
328  const real_t* const yOpt,
330  Bounds* const guessedBounds,
332  const char* const R_file
335  );
336 
337 
355  const real_t* const g_new,
356  const real_t* const lb_new,
358  const real_t* const ub_new,
360  int* nWSR,
362  real_t* const cputime
364  );
365 
385  const char* const g_file,
386  const char* const lb_file,
388  const char* const ub_file,
390  int* nWSR,
392  real_t* const cputime
394  );
395 
415  const real_t* const g_new,
416  const real_t* const lb_new,
418  const real_t* const ub_new,
420  int* nWSR,
422  real_t* const cputime,
424  Bounds* const guessedBounds
426  );
427 
450  const char* const g_file,
451  const char* const lb_file,
453  const char* const ub_file,
455  int* nWSR,
457  real_t* const cputime,
459  Bounds* const guessedBounds
461  );
462 
463 
468  real_t* workingSet
469  );
470 
475  real_t* workingSetB
476  );
477 
482  real_t* workingSetC
483  );
484 
485 
489 static inline returnValue QProblemB_getBounds( QProblemB* _THIS,
490  Bounds* _bounds
491  );
492 
493 
496 static inline int QProblemB_getNV( QProblemB* _THIS );
497 
500 static inline int QProblemB_getNFR( QProblemB* _THIS );
501 
504 static inline int QProblemB_getNFX( QProblemB* _THIS );
505 
508 static inline int QProblemB_getNFV( QProblemB* _THIS );
509 
512 int QProblemB_getNZ( QProblemB* _THIS );
513 
514 
519 
523  const real_t* const _x
524  );
525 
530  real_t* const xOpt
531  );
532 
537  real_t* const yOpt
538  );
539 
540 
543 static inline QProblemStatus QProblemB_getStatus( QProblemB* _THIS );
544 
545 
549 static inline BooleanType QProblemB_isInitialised( QProblemB* _THIS );
550 
554 static inline BooleanType QProblemB_isSolved( QProblemB* _THIS );
555 
559 static inline BooleanType QProblemB_isInfeasible( QProblemB* _THIS );
560 
564 static inline BooleanType QProblemB_isUnbounded( QProblemB* _THIS );
565 
566 
569 static inline HessianType QProblemB_getHessianType( QProblemB* _THIS );
570 
573 static inline returnValue QProblemB_setHessianType( QProblemB* _THIS,
574  HessianType _hessianType
575  );
576 
580 static inline BooleanType QProblemB_usingRegularisation( QProblemB* _THIS );
581 
584 static inline Options QProblemB_getOptions( QProblemB* _THIS );
585 
588 static inline returnValue QProblemB_setOptions( QProblemB* _THIS,
589  Options _options
590  );
591 
594 static inline PrintLevel QProblemB_getPrintLevel( QProblemB* _THIS );
595 
599  PrintLevel _printlevel
600  );
601 
604 static inline unsigned int QProblemB_getCount( QProblemB* _THIS );
605 
608 static inline returnValue QProblemB_resetCounter( QProblemB* _THIS );
609 
610 
614 
618 
619 
626 
631 
636  const real_t* const lb_new,
637  const real_t* const ub_new
638  );
639 
649 
656 
657 
664  const real_t* const xOpt,
666  const real_t* const yOpt,
668  Bounds* const guessedBounds,
669  Bounds* auxiliaryBounds
671  );
672 
678  const real_t* const lb,
679  const real_t* const ub
680  );
681 
686  const real_t* const b,
687  BooleanType transposed,
688  real_t* const a
689  );
690 
696  const real_t* const b,
697  BooleanType transposed,
698  BooleanType removingBound,
699  real_t* const a
700  );
701 
702 
706  const real_t* const g_new,
707  const real_t* const lb_new,
708  const real_t* const ub_new,
709  real_t* const delta_g,
710  real_t* const delta_lb,
711  real_t* const delta_ub,
712  BooleanType* Delta_bB_isZero
713  );
714 
715 
720  DenseMatrix *_H,
721  const real_t* const _g,
722  const real_t* const _lb,
724  const real_t* const _ub
726  );
727 
735  real_t* const _H,
737  const real_t* const _g,
738  const real_t* const _lb,
740  const real_t* const _ub
742  );
743 
753  const char* const H_file,
755  const char* const g_file,
756  const char* const lb_file,
758  const char* const ub_file
760  );
761 
768  const char* const g_file,
769  const char* const lb_file,
771  const char* const ub_file,
773  real_t* const g_new,
774  real_t* const lb_new,
775  real_t* const ub_new
776  );
777 
778 
785  returnValue returnvalue,
786  BooleanType doThrowError
787  );
788 
789 
794  const real_t* const cputime,
795  real_t starttime,
796  int nWSR
797  );
798 
799 
804 
805 
808 static inline returnValue QProblemB_setHM( QProblemB* _THIS,
810  );
811 
817 static inline returnValue QProblemB_setH( QProblemB* _THIS,
818  real_t* const H_new
819  );
820 
824 static inline returnValue QProblemB_setG( QProblemB* _THIS,
825  const real_t* const g_new
826  );
827 
831 static inline returnValue QProblemB_setLB( QProblemB* _THIS,
832  const real_t* const lb_new
833  );
834 
839 static inline returnValue QProblemB_setLBn( QProblemB* _THIS,
840  int number,
841  real_t value
842  );
843 
847 static inline returnValue QProblemB_setUB( QProblemB* _THIS,
848  const real_t* const ub_new
849  );
850 
855 static inline returnValue QProblemB_setUBn( QProblemB* _THIS,
856  int number,
857  real_t value
858  );
859 
860 
863 static inline void QProblemB_computeGivens( real_t xold,
864  real_t yold,
865  real_t* xnew,
866  real_t* ynew,
867  real_t* c,
868  real_t* s
869  );
870 
873 static inline void QProblemB_applyGivens( real_t c,
874  real_t s,
875  real_t nu,
876  real_t xold,
878  real_t yold,
880  real_t* xnew,
882  real_t* ynew
884  );
885 
886 
887 
892  const real_t* const g_new,
893  const real_t* const lb_new,
894  const real_t* const ub_new
895  );
896 
901 
902 
905  real_t curFarBound,
906  int nRamp,
907  const real_t* const lb_new,
908  real_t* const lb_new_far,
909  const real_t* const ub_new,
910  real_t* const ub_new_far
911  );
912 
913 
914 
919  int nIdx,
920  const int* const idxList,
921  Bounds* const subjectTo,
922  const real_t* const num,
923  const real_t* const den,
924  real_t epsNum,
925  real_t epsDen,
926  real_t* t,
927  int* BC_idx
928  );
929 
933 static inline BooleanType QProblemB_isBlocking( QProblemB* _THIS,
934  real_t num,
935  real_t den,
936  real_t epsNum,
937  real_t epsDen,
938  real_t* t
940  );
941 
942 
955  const real_t* const xOpt,
956  const real_t* const yOpt,
957  Bounds* const guessedBounds,
958  const real_t* const _R,
959  int* nWSR,
961  real_t* const cputime
963  );
964 
978  const real_t* const g_new,
979  const real_t* const lb_new,
981  const real_t* const ub_new,
983  int* nWSR,
985  real_t* const cputime,
987  int nWSRperformed,
991  BooleanType isFirstCall
992  );
993 
994 
1008  const real_t* const g_new,
1009  const real_t* const lb_new,
1011  const real_t* const ub_new,
1013  int* nWSR,
1015  real_t* const cputime,
1017  int nWSRperformed,
1020  BooleanType isFirstCall
1021  );
1022 
1023 
1032  Bounds* const auxiliaryBounds,
1033  BooleanType setupAfresh
1035  );
1036 
1040  const real_t* const xOpt,
1042  const real_t* const yOpt
1044  );
1045 
1051 
1058  BooleanType useRelaxation
1059  );
1060 
1061 
1068  Bounds* const guessedBounds
1069  );
1070 
1075  const real_t* const delta_g,
1076  const real_t* const delta_lb,
1077  const real_t* const delta_ub,
1078  BooleanType Delta_bB_isZero,
1079  real_t* const delta_xFX,
1080  real_t* const delta_xFR,
1081  real_t* const delta_yFX
1082  );
1083 
1090  const real_t* const delta_g,
1091  const real_t* const delta_lb,
1092  const real_t* const delta_ub,
1093  const real_t* const delta_xFX,
1094  const real_t* const delta_xFR,
1095  const real_t* const delta_yFX,
1096  int* BC_idx,
1097  SubjectToStatus* BC_status
1098  );
1099 
1105  int BC_idx,
1106  SubjectToStatus BC_status
1107  );
1108 
1112 
1118  Bounds* const guessedBounds
1119  );
1120 
1121 
1126  int number,
1127  SubjectToStatus B_status,
1128  BooleanType updateCholesky
1129  );
1130 
1136  int number,
1137  BooleanType updateCholesky
1138  );
1139 
1140 
1144  int iter,
1145  int BC_idx,
1146  SubjectToStatus BC_status,
1147  real_t homotopyLength,
1148  BooleanType isFirstCall
1149  );
1150 
1151 
1152 
1153 /*
1154  * g e t B o u n d s
1155  */
1156 static inline returnValue QProblemB_getBounds( QProblemB* _THIS, Bounds* _bounds )
1157 {
1158  int nV = QProblemB_getNV( _THIS );
1159 
1160  if ( nV == 0 )
1162 
1163  *_bounds = _THIS->bounds;
1164 
1165  return SUCCESSFUL_RETURN;
1166 }
1167 
1168 
1169 /*
1170  * g e t N V
1171  */
1172 static inline int QProblemB_getNV( QProblemB* _THIS )
1173 {
1174  return Bounds_getNV( &(_THIS->bounds) );
1175 }
1176 
1177 
1178 /*
1179  * g e t N F R
1180  */
1181 static inline int QProblemB_getNFR( QProblemB* _THIS )
1182 {
1183  return Bounds_getNFR( &(_THIS->bounds) );
1184 }
1185 
1186 
1187 /*
1188  * g e t N F X
1189  */
1190 static inline int QProblemB_getNFX( QProblemB* _THIS )
1191 {
1192  return Bounds_getNFX( &(_THIS->bounds) );
1193 }
1194 
1195 
1196 /*
1197  * g e t N F V
1198  */
1199 static inline int QProblemB_getNFV( QProblemB* _THIS )
1200 {
1201  return Bounds_getNFV( &(_THIS->bounds) );
1202 }
1203 
1204 
1205 /*
1206  * g e t S t a t u s
1207  */
1209 {
1210  return _THIS->status;
1211 }
1212 
1213 
1214 /*
1215  * i s I n i t i a l i s e d
1216  */
1218 {
1219  if ( _THIS->status == QPS_NOTINITIALISED )
1220  return BT_FALSE;
1221  else
1222  return BT_TRUE;
1223 }
1224 
1225 
1226 /*
1227  * i s S o l v e d
1228  */
1230 {
1231  if ( _THIS->status == QPS_SOLVED )
1232  return BT_TRUE;
1233  else
1234  return BT_FALSE;
1235 }
1236 
1237 
1238 /*
1239  * i s I n f e a s i b l e
1240  */
1242 {
1243  return _THIS->infeasible;
1244 }
1245 
1246 
1247 /*
1248  * i s U n b o u n d e d
1249  */
1251 {
1252  return _THIS->unbounded;
1253 }
1254 
1255 
1256 /*
1257  * g e t H e s s i a n T y p e
1258  */
1260 {
1261  return _THIS->hessianType;
1262 }
1263 
1264 
1265 /*
1266  * s e t H e s s i a n T y p e
1267  */
1268 static inline returnValue QProblemB_setHessianType( QProblemB* _THIS, HessianType _hessianType )
1269 {
1270  _THIS->hessianType = _hessianType;
1271  return SUCCESSFUL_RETURN;
1272 }
1273 
1274 
1275 /*
1276  * u s i n g R e g u l a r i s a t i o n
1277  */
1279 {
1280  if ( _THIS->regVal > QPOASES_ZERO )
1281  return BT_TRUE;
1282  else
1283  return BT_FALSE;
1284 }
1285 
1286 
1287 /*
1288  * g e t O p t i o n s
1289  */
1290 static inline Options QProblemB_getOptions( QProblemB* _THIS )
1291 {
1292  return _THIS->options;
1293 }
1294 
1295 
1296 /*
1297  * s e t O p t i o n s
1298  */
1300  Options _options
1301  )
1302 {
1303  OptionsCPY( &_options,&(_THIS->options) );
1304  Options_ensureConsistency( &(_THIS->options) );
1305 
1306  QProblemB_setPrintLevel( _THIS,_THIS->options.printLevel );
1307 
1308  return SUCCESSFUL_RETURN;
1309 }
1310 
1311 
1312 /*
1313  * g e t P r i n t L e v e l
1314  */
1316 {
1317  return _THIS->options.printLevel;
1318 }
1319 
1320 
1321 
1322 /*
1323  * g e t C o u n t
1324  */
1325 static inline unsigned int QProblemB_getCount( QProblemB* _THIS )
1326 {
1327  return _THIS->count;
1328 }
1329 
1330 
1331 /*
1332  * r e s e t C o u n t e r
1333  */
1335 {
1336  _THIS->count = 0;
1337  return SUCCESSFUL_RETURN;
1338 }
1339 
1340 
1341 
1342 /*****************************************************************************
1343  * P R O T E C T E D *
1344  *****************************************************************************/
1345 
1346 
1347 /*
1348  * s e t H
1349  */
1351 {
1352  if ( H_new == 0 )
1353  return QProblemB_setH( _THIS,(real_t*)0 );
1354  else
1355  return QProblemB_setH( _THIS,DenseMatrix_getVal(H_new) );
1356 }
1357 
1358 
1359 /*
1360  * s e t H
1361  */
1362 static inline returnValue QProblemB_setH( QProblemB* _THIS, real_t* const H_new )
1363 {
1364  /* if null pointer is passed, Hessian is set to zero matrix
1365  * (or stays identity matrix) */
1366  if ( H_new == 0 )
1367  {
1368  if ( _THIS->hessianType == HST_IDENTITY )
1369  return SUCCESSFUL_RETURN;
1370 
1371  _THIS->hessianType = HST_ZERO;
1372 
1373  _THIS->H = 0;
1374  }
1375  else
1376  {
1377  DenseMatrixCON( _THIS->H,QProblemB_getNV( _THIS ),QProblemB_getNV( _THIS ),QProblemB_getNV( _THIS ),H_new );
1378  }
1379 
1380  return SUCCESSFUL_RETURN;
1381 }
1382 
1383 
1384 /*
1385  * s e t G
1386  */
1387 static inline returnValue QProblemB_setG( QProblemB* _THIS, const real_t* const g_new )
1388 {
1389  unsigned int nV = (unsigned int)QProblemB_getNV( _THIS );
1390 
1391  if ( nV == 0 )
1393 
1394  if ( g_new == 0 )
1396 
1397  memcpy( _THIS->g,g_new,nV*sizeof(real_t) );
1398 
1399  return SUCCESSFUL_RETURN;
1400 }
1401 
1402 
1403 /*
1404  * s e t L B
1405  */
1406 static inline returnValue QProblemB_setLB( QProblemB* _THIS, const real_t* const lb_new )
1407 {
1408  unsigned int i;
1409  unsigned int nV = (unsigned int)QProblemB_getNV( _THIS );
1410 
1411  if ( nV == 0 )
1413 
1414  if ( lb_new != 0 )
1415  {
1416  memcpy( _THIS->lb,lb_new,nV*sizeof(real_t) );
1417  }
1418  else
1419  {
1420  /* if no lower bounds are specified, set them to -infinity */
1421  for( i=0; i<nV; ++i )
1422  _THIS->lb[i] = -QPOASES_INFTY;
1423  }
1424 
1425  return SUCCESSFUL_RETURN;
1426 }
1427 
1428 
1429 /*
1430  * s e t L B
1431  */
1432 static inline returnValue QProblemB_setLBn( QProblemB* _THIS, int number, real_t value )
1433 {
1434  int nV = QProblemB_getNV( _THIS );
1435 
1436  if ( nV == 0 )
1438 
1439  if ( ( number >= 0 ) && ( number < nV ) )
1440  {
1441  _THIS->lb[number] = value;
1442  return SUCCESSFUL_RETURN;
1443  }
1444  else
1445  {
1447  }
1448 }
1449 
1450 
1451 /*
1452  * s e t U B
1453  */
1454 static inline returnValue QProblemB_setUB( QProblemB* _THIS, const real_t* const ub_new )
1455 {
1456  unsigned int i;
1457  unsigned int nV = (unsigned int)QProblemB_getNV( _THIS );
1458 
1459  if ( nV == 0 )
1461 
1462  if ( ub_new != 0 )
1463  {
1464  memcpy( _THIS->ub,ub_new,nV*sizeof(real_t) );
1465  }
1466  else
1467  {
1468  /* if no upper bounds are specified, set them to infinity */
1469  for( i=0; i<nV; ++i )
1470  _THIS->ub[i] = QPOASES_INFTY;
1471  }
1472 
1473  return SUCCESSFUL_RETURN;
1474 }
1475 
1476 
1477 /*
1478  * s e t U B
1479  */
1480 static inline returnValue QProblemB_setUBn( QProblemB* _THIS, int number, real_t value )
1481 {
1482  int nV = QProblemB_getNV( _THIS );
1483 
1484  if ( nV == 0 )
1486 
1487  if ( ( number >= 0 ) && ( number < nV ) )
1488  {
1489  _THIS->ub[number] = value;
1490 
1491  return SUCCESSFUL_RETURN;
1492  }
1493  else
1494  {
1496  }
1497 }
1498 
1499 
1500 /*
1501  * c o m p u t e G i v e n s
1502  */
1503 static inline void QProblemB_computeGivens( real_t xold, real_t yold,
1504  real_t* xnew, real_t* ynew, real_t* c, real_t* s
1505  )
1506 {
1507  real_t t, mu;
1508 
1509  if ( fabs( yold ) <= QPOASES_ZERO )
1510  {
1511  *c = 1.0;
1512  *s = 0.0;
1513 
1514  *xnew = xold;
1515  *ynew = yold;
1516  }
1517  else
1518  {
1519  mu = fabs( xold );
1520  if ( fabs( yold ) > mu )
1521  mu = fabs( yold );
1522 
1523  t = mu * sqrt( (xold/mu)*(xold/mu) + (yold/mu)*(yold/mu) );
1524 
1525  if ( xold < 0.0 )
1526  t = -t;
1527 
1528  *c = xold/t;
1529  *s = yold/t;
1530  *xnew = t;
1531  *ynew = 0.0;
1532  }
1533 
1534  return;
1535 }
1536 
1537 
1538 /*
1539  * a p p l y G i v e n s
1540  */
1541 static inline void QProblemB_applyGivens( real_t c, real_t s, real_t nu, real_t xold, real_t yold,
1542  real_t* xnew, real_t* ynew
1543  )
1544 {
1545  #ifdef __USE_THREE_MULTS_GIVENS__
1546 
1547  /* Givens plane rotation requiring only three multiplications,
1548  * cf. Hammarling, S.: A note on modifications to the givens plane rotation.
1549  * J. Inst. Maths Applics, 13:215-218, 1974. */
1550  *xnew = xold*c + yold*s;
1551  *ynew = (*xnew+xold)*nu - yold;
1552 
1553  #else
1554 
1555  /* Usual Givens plane rotation requiring four multiplications. */
1556  *xnew = c*xold + s*yold;
1557  *ynew = -s*xold + c*yold;
1558 
1559  #endif
1560 
1561  return;
1562 }
1563 
1564 
1565 /*
1566  * i s B l o c k i n g
1567  */
1569  real_t num,
1570  real_t den,
1571  real_t epsNum,
1572  real_t epsDen,
1573  real_t* t
1574  )
1575 {
1576  if ( ( den >= epsDen ) && ( num >= epsNum ) )
1577  {
1578  if ( num < (*t)*den )
1579  return BT_TRUE;
1580  }
1581 
1582  return BT_FALSE;
1583 }
1584 
1585 
1587 
1588 
1589 #endif /* QPOASES_QPROBLEMB_H */
1590 
1591 
1592 /*
1593  * end of file
1594  */
void QProblemBCON(QProblemB *_THIS, int _nV, HessianType _hessianType)
Definition: QProblemB.c:45
returnValue QProblemB_getWorkingSetBounds(QProblemB *_THIS, real_t *workingSetB)
Definition: QProblemB.c:763
static int QProblemB_getNV(QProblemB *_THIS)
Definition: QProblemB.h:1172
static QProblemStatus QProblemB_getStatus(QProblemB *_THIS)
Definition: QProblemB.h:1208
IntermediateState sqrt(const Expression &arg)
returnValue QProblemB_determineDataShift(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, real_t *const delta_g, real_t *const delta_lb, real_t *const delta_ub, BooleanType *Delta_bB_isZero)
Definition: QProblemB.c:1617
returnValue QProblemB_computeCholesky(QProblemB *_THIS)
Definition: QProblemB.c:1324
unsigned int count
Definition: QProblemB.h:90
returnValue QProblemB_setupAuxiliaryQPbounds(QProblemB *_THIS, BooleanType useRelaxation)
Definition: QProblemB.c:2770
returnValue QProblemB_setupQPdata(QProblemB *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
Definition: QProblemB.c:1694
static int Bounds_getNFV(Bounds *_THIS)
Definition: Bounds.h:463
returnValue QProblemB_hotstart(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime)
Definition: QProblemB.c:471
Implements the online active set strategy for box-constrained QPs.
returnValue QProblemB_getDualSolution(QProblemB *_THIS, real_t *const yOpt)
Definition: QProblemB.c:905
returnValue QProblemB_setupInitialCholesky(QProblemB *_THIS)
Definition: QProblemB.c:435
static BooleanType QProblemB_isInfeasible(QProblemB *_THIS)
Definition: QProblemB.h:1241
returnValue QProblemB_reset(QProblemB *_THIS)
Definition: QProblemB.c:153
DenseMatrix * H
Definition: QProblemB.h:65
static returnValue QProblemB_setLBn(QProblemB *_THIS, int number, real_t value)
Definition: QProblemB.h:1432
returnValue QProblemB_backsolveRrem(QProblemB *_THIS, const real_t *const b, BooleanType transposed, BooleanType removingBound, real_t *const a)
Definition: QProblemB.c:1559
returnValue QProblemB_getWorkingSet(QProblemB *_THIS, real_t *workingSet)
Definition: QProblemB.c:754
returnValue QProblemB_solveQP(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, int nWSRperformed, BooleanType isFirstCall)
Definition: QProblemB.c:2289
returnValue QProblemB_setupQPdataM(QProblemB *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
Definition: QProblemB.c:1680
real_t QProblemB_getRelativeHomotopyLength(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new)
Definition: QProblemB.c:2001
static returnValue QProblemB_setHM(QProblemB *_THIS, DenseMatrix *H_new)
Definition: QProblemB.h:1350
Allows to pass back messages to the calling function.
static int QProblemB_getNFX(QProblemB *_THIS)
Definition: QProblemB.h:1190
returnValue QProblemB_setupAuxiliaryQP(QProblemB *_THIS, Bounds *const guessedBounds)
Definition: QProblemB.c:2838
returnValue QProblemB_backsolveR(QProblemB *_THIS, const real_t *const b, BooleanType transposed, real_t *const a)
Definition: QProblemB.c:1547
static BooleanType QProblemB_isUnbounded(QProblemB *_THIS)
Definition: QProblemB.h:1250
real_t QProblemB_getObjVal(QProblemB *_THIS)
Definition: QProblemB.c:807
static returnValue QProblemB_setLB(QProblemB *_THIS, const real_t *const lb_new)
Definition: QProblemB.h:1406
returnValue Options_ensureConsistency(Options *_THIS)
Definition: Options.c:263
returnValue QProblemB_setupAuxiliaryQPgradient(QProblemB *_THIS)
Definition: QProblemB.c:2730
returnValue QProblemB_addBound(QProblemB *_THIS, int number, SubjectToStatus B_status, BooleanType updateCholesky)
Definition: QProblemB.c:3342
Auxiliary class for storing a copy of the current matrix factorisations.
returnValue QProblemB_hotstartW(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, Bounds *const guessedBounds)
Definition: QProblemB.c:656
returnValue QProblemB_hotstartFW(QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime, Bounds *const guessedBounds)
Definition: QProblemB.c:709
#define HST_IDENTITY
static const real_t QPOASES_ZERO
returnValue QProblemB_performRamping(QProblemB *_THIS)
Definition: QProblemB.c:2101
returnValue QProblemB_changeActiveSet(QProblemB *_THIS, int BC_idx, SubjectToStatus BC_status)
Definition: QProblemB.c:3212
static BooleanType QProblemB_isBlocking(QProblemB *_THIS, real_t num, real_t den, real_t epsNum, real_t epsDen, real_t *t)
Definition: QProblemB.h:1568
static int QProblemB_getNFR(QProblemB *_THIS)
Definition: QProblemB.h:1181
returnValue QProblemB_initFW(QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const char *const R_file)
Definition: QProblemB.c:371
void QProblemBCPY(QProblemB *FROM, QProblemB *TO)
Definition: QProblemB.c:107
returnValue QProblemB_obtainAuxiliaryWorkingSet(QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Bounds *auxiliaryBounds)
Definition: QProblemB.c:1403
static BooleanType QProblemB_isSolved(QProblemB *_THIS)
Definition: QProblemB.h:1229
static returnValue QProblemB_getBounds(QProblemB *_THIS, Bounds *_bounds)
Definition: QProblemB.h:1156
returnValue QProblemB_setupSubjectToType(QProblemB *_THIS)
Definition: QProblemB.c:1239
void DenseMatrixCON(DenseMatrix *_THIS, int m, int n, int lD, real_t *v)
Definition: Matrices.c:47
static returnValue QProblemB_resetCounter(QProblemB *_THIS)
Definition: QProblemB.h:1334
Interfaces matrix-vector operations tailored to general dense matrices.
static int QProblemB_getNFV(QProblemB *_THIS)
Definition: QProblemB.h:1199
returnValue QProblemB_determineHessianType(QProblemB *_THIS)
Definition: QProblemB.c:1135
static BooleanType QProblemB_usingRegularisation(QProblemB *_THIS)
Definition: QProblemB.h:1278
const int nu
returnValue QProblemB_determineStepDirection(QProblemB *_THIS, const real_t *const delta_g, const real_t *const delta_lb, const real_t *const delta_ub, BooleanType Delta_bB_isZero, real_t *const delta_xFX, real_t *const delta_xFR, real_t *const delta_yFX)
Definition: QProblemB.c:2900
returnValue QProblemB_setupAuxiliaryWorkingSet(QProblemB *_THIS, Bounds *const auxiliaryBounds, BooleanType setupAfresh)
Definition: QProblemB.c:2620
static int Bounds_getNFX(Bounds *_THIS)
Definition: Bounds.h:499
returnValue QProblemB_solveInitialQP(QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const real_t *const _R, int *nWSR, real_t *const cputime)
Definition: QProblemB.c:2145
returnValue QProblemB_hotstartF(QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime)
Definition: QProblemB.c:615
Provides a generic way to set and pass user-specified options.
Definition: options.hpp:65
static void QProblemB_applyGivens(real_t c, real_t s, real_t nu, real_t xold, real_t yold, real_t *xnew, real_t *ynew)
Definition: QProblemB.h:1541
static returnValue QProblemB_setH(QProblemB *_THIS, real_t *const H_new)
Definition: QProblemB.h:1362
static int Bounds_getNV(Bounds *_THIS)
Definition: Bounds.h:454
real_t QProblemB_getObjValX(QProblemB *_THIS, const real_t *const _x)
Definition: QProblemB.c:831
returnValue QProblemB_init(QProblemB *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime)
Definition: QProblemB.c:219
returnValue QProblemB_performStep(QProblemB *_THIS, const real_t *const delta_g, const real_t *const delta_lb, const real_t *const delta_ub, const real_t *const delta_xFX, const real_t *const delta_xFR, const real_t *const delta_yFX, int *BC_idx, SubjectToStatus *BC_status)
Definition: QProblemB.c:3069
returnValue QProblemB_initM(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)
Definition: QProblemB.c:192
returnValue QProblemB_setPrintLevel(QProblemB *_THIS, PrintLevel _printlevel)
Definition: QProblemB.c:930
static returnValue QProblemB_setOptions(QProblemB *_THIS, Options _options)
Definition: QProblemB.h:1299
static const real_t QPOASES_INFTY
static int Bounds_getNFR(Bounds *_THIS)
Definition: Bounds.h:490
PrintLevel
void OptionsCPY(Options *FROM, Options *TO)
Definition: Options.c:64
BooleanType QProblemB_isCPUtimeLimitExceeded(QProblemB *_THIS, const real_t *const cputime, real_t starttime, int nWSR)
Definition: QProblemB.c:1882
returnValue QProblemB_regulariseHessian(QProblemB *_THIS)
Definition: QProblemB.c:1912
returnValue QProblemB_getPrimalSolution(QProblemB *_THIS, real_t *const xOpt)
Definition: QProblemB.c:880
#define BT_TRUE
Definition: acado_types.hpp:47
returnValue QProblemB_initF(QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime)
Definition: QProblemB.c:246
static real_t * DenseMatrix_getVal(DenseMatrix *_THIS)
Definition: Matrices.h:257
static BooleanType QProblemB_isInitialised(QProblemB *_THIS)
Definition: QProblemB.h:1217
BooleanType QProblemB_shallRefactorise(QProblemB *_THIS, Bounds *const guessedBounds)
Definition: QProblemB.c:3314
returnValue QProblemB_initW(QProblemB *_THIS, real_t *const _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:322
static returnValue QProblemB_setHessianType(QProblemB *_THIS, HessianType _hessianType)
Definition: QProblemB.h:1268
returnValue QProblemB_printOptions(QProblemB *_THIS)
Definition: QProblemB.c:1118
#define HST_ZERO
returnValue QProblemB_printIteration(QProblemB *_THIS, int iter, int BC_idx, SubjectToStatus BC_status, real_t homotopyLength, BooleanType isFirstCall)
Definition: QProblemB.c:3544
static HessianType QProblemB_getHessianType(QProblemB *_THIS)
Definition: QProblemB.h:1259
Stores internal information for tabular (debugging) output.
returnValue QProblemB_printProperties(QProblemB *_THIS)
Definition: QProblemB.c:981
returnValue QProblemB_areBoundsConsistent(QProblemB *_THIS, const real_t *const lb, const real_t *const ub)
Definition: QProblemB.c:1863
returnValue QProblemB_setupQPdataFromFile(QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file)
Definition: QProblemB.c:1718
returnValue QProblemB_setInfeasibilityFlag(QProblemB *_THIS, returnValue returnvalue, BooleanType doThrowError)
Definition: QProblemB.c:1847
static returnValue QProblemB_setG(QProblemB *_THIS, const real_t *const g_new)
Definition: QProblemB.h:1387
returnValue QProblemB_getWorkingSetConstraints(QProblemB *_THIS, real_t *workingSetC)
Definition: QProblemB.c:784
static unsigned int QProblemB_getCount(QProblemB *_THIS)
Definition: QProblemB.h:1325
returnValue QProblemB_setupAuxiliaryQPsolution(QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt)
Definition: QProblemB.c:2689
#define BT_FALSE
Definition: acado_types.hpp:49
returnValue QProblemB_performDriftCorrection(QProblemB *_THIS)
Definition: QProblemB.c:3263
returnValue QProblemB_removeBound(QProblemB *_THIS, int number, BooleanType updateCholesky)
Definition: QProblemB.c:3412
int QProblemB_getNZ(QProblemB *_THIS)
Definition: QProblemB.c:797
Manages working sets of bounds (= box constraints).
double real_t
Definition: AD_test.c:10
returnValue QProblemB_updateFarBounds(QProblemB *_THIS, real_t curFarBound, int nRamp, const real_t *const lb_new, real_t *const lb_new_far, const real_t *const ub_new, real_t *const ub_new_far)
Definition: QProblemB.c:2049
int rampOffset
Definition: QProblemB.h:96
static void QProblemB_computeGivens(real_t xold, real_t yold, real_t *xnew, real_t *ynew, real_t *c, real_t *s)
Definition: QProblemB.h:1503
returnValue QProblemB_loadQPvectorsFromFile(QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, real_t *const g_new, real_t *const lb_new, real_t *const ub_new)
Definition: QProblemB.c:1786
static returnValue QProblemB_setUBn(QProblemB *_THIS, int number, real_t value)
Definition: QProblemB.h:1480
static returnValue QProblemB_setUB(QProblemB *_THIS, const real_t *const ub_new)
Definition: QProblemB.h:1454
returnValue QProblemB_performRatioTestB(QProblemB *_THIS, int nIdx, const int *const idxList, Bounds *const subjectTo, const real_t *const num, const real_t *const den, real_t epsNum, real_t epsDen, real_t *t, int *BC_idx)
Definition: QProblemB.c:1951
DenseMatrix HH
Definition: QProblemB.h:66
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 PrintLevel QProblemB_getPrintLevel(QProblemB *_THIS)
Definition: QProblemB.h:1315
returnValue QProblemB_setupSubjectToTypeNew(QProblemB *_THIS, const real_t *const lb_new, const real_t *const ub_new)
Definition: QProblemB.c:1248
returnValue QProblemB_solveRegularisedQP(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, int nWSRperformed, BooleanType isFirstCall)
Definition: QProblemB.c:2515
static Options QProblemB_getOptions(QProblemB *_THIS)
Definition: QProblemB.h:1290


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