QProblem.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 
37 #ifndef QPOASES_QPROBLEM_H
38 #define QPOASES_QPROBLEM_H
39 
40 
41 #include <qpOASES_e/Bounds.h>
42 #include <qpOASES_e/Options.h>
43 #include <qpOASES_e/Matrices.h>
44 #include <qpOASES_e/Constraints.h>
45 #include <qpOASES_e/Flipper.h>
47 
48 
50 
51 
63 typedef struct
64 {
90  unsigned int count;
92  real_t delta_xFR_TMP[NVMAX];
96  int rampOffset;
106  real_t lbA[NCMAX];
107  real_t ubA[NCMAX];
109  Constraints constraints;
111  real_t T[NVCMIN*NVCMIN];
112  real_t Q[NVMAX*NVMAX];
113  int sizeT;
115  real_t Ax[NCMAX];
117  real_t Ax_l[NCMAX];
119  real_t Ax_u[NCMAX];
124  real_t tempA[NVMAX];
125  real_t tempB[NCMAX];
126  real_t ZFR_delta_xFRz[NVMAX];
127  real_t delta_xFRy[NCMAX];
128  real_t delta_xFRz[NVMAX];
129  real_t delta_yAC_TMP[NCMAX];
130 } QProblem;
131 
132 
138 void QProblemCON( QProblem* _THIS,
139  int _nV,
140  int _nC,
141  HessianType _hessianType
142  );
143 
146 void QProblemCPY( QProblem* FROM,
147  QProblem* TO
148  );
149 
150 
155 
156 
172  DenseMatrix *_H,
173  const real_t* const _g,
174  DenseMatrix *_A,
175  const real_t* const _lb,
177  const real_t* const _ub,
179  const real_t* const _lbA,
181  const real_t* const _ubA,
183  int* nWSR,
185  real_t* const cputime
187  );
188 
189 
205  real_t* const _H,
207  const real_t* const _g,
208  real_t* const _A,
209  const real_t* const _lb,
211  const real_t* const _ub,
213  const real_t* const _lbA,
215  const real_t* const _ubA,
217  int* nWSR,
219  real_t* const cputime
221  );
222 
238  const char* const H_file,
240  const char* const g_file,
241  const char* const A_file,
242  const char* const lb_file,
244  const char* const ub_file,
246  const char* const lbA_file,
248  const char* const ubA_file,
250  int* nWSR,
252  real_t* const cputime
254  );
255 
278  DenseMatrix *_H,
280  const real_t* const _g,
281  DenseMatrix *_A,
282  const real_t* const _lb,
284  const real_t* const _ub,
286  const real_t* const _lbA,
288  const real_t* const _ubA,
290  int* nWSR,
292  real_t* const cputime,
294  const real_t* const xOpt,
296  const real_t* const yOpt,
298  Bounds* const guessedBounds,
299  Constraints* const guessedConstraints,
300  const real_t* const _R
304  );
305 
328  real_t* const _H,
330  const real_t* const _g,
331  real_t* const _A,
332  const real_t* const _lb,
334  const real_t* const _ub,
336  const real_t* const _lbA,
338  const real_t* const _ubA,
340  int* nWSR,
342  real_t* const cputime,
344  const real_t* const xOpt,
346  const real_t* const yOpt,
348  Bounds* const guessedBounds,
349  Constraints* const guessedConstraints,
350  const real_t* const _R
354  );
355 
378  const char* const H_file,
380  const char* const g_file,
381  const char* const A_file,
382  const char* const lb_file,
384  const char* const ub_file,
386  const char* const lbA_file,
388  const char* const ubA_file,
390  int* nWSR,
392  real_t* const cputime,
394  const real_t* const xOpt,
396  const real_t* const yOpt,
398  Bounds* const guessedBounds,
399  Constraints* const guessedConstraints,
400  const char* const R_file
404  );
405 
423  const real_t* const g_new,
424  const real_t* const lb_new,
426  const real_t* const ub_new,
428  const real_t* const lbA_new,
430  const real_t* const ubA_new,
432  int* nWSR,
434  real_t* const cputime
436  );
437 
457  const char* const g_file,
458  const char* const lb_file,
460  const char* const ub_file,
462  const char* const lbA_file,
464  const char* const ubA_file,
466  int* nWSR,
468  real_t* const cputime
470  );
471 
491  const real_t* const g_new,
492  const real_t* const lb_new,
494  const real_t* const ub_new,
496  const real_t* const lbA_new,
498  const real_t* const ubA_new,
500  int* nWSR,
502  real_t* const cputime,
504  Bounds* const guessedBounds,
506  Constraints* const guessedConstraints
508  );
509 
532  const char* const g_file,
533  const char* const lb_file,
535  const char* const ub_file,
537  const char* const lbA_file,
539  const char* const ubA_file,
541  int* nWSR,
543  real_t* const cputime,
545  Bounds* const guessedBounds,
547  Constraints* const guessedConstraints
549  );
550 
551 
558  const int n_rhs,
559  const real_t* g_in,
560  const real_t* lb_in,
562  const real_t* ub_in,
564  const real_t* lbA_in,
566  const real_t* ubA_in,
567  real_t* x_out,
568  real_t* y_out
569  );
570 
571 
572 
576 static inline returnValue QProblem_getConstraints( QProblem* _THIS,
577  Constraints* _constraints
578  );
579 
580 
583 static inline int QProblem_getNC( QProblem* _THIS );
584 
587 static inline int QProblem_getNEC( QProblem* _THIS );
588 
591 static inline int QProblem_getNAC( QProblem* _THIS );
592 
595 static inline int QProblem_getNIAC( QProblem* _THIS );
596 
599 int QProblem_getNZ( QProblem* _THIS );
600 
601 
606  real_t* const yOpt
607  );
608 
609 
613  ConstraintProduct _constraintProduct
614  );
615 
616 
620 
621 
622 
626  real_t* workingSet
627  );
628 
633  real_t* workingSetB
634  );
635 
640  real_t* workingSetC
641  );
642 
643 
647 static inline returnValue QProblem_getBounds( QProblem* _THIS,
648  Bounds* _bounds
649  );
650 
651 
654 static inline int QProblem_getNV( QProblem* _THIS );
655 
658 static inline int QProblem_getNFR( QProblem* _THIS );
659 
662 static inline int QProblem_getNFX( QProblem* _THIS );
663 
666 static inline int QProblem_getNFV( QProblem* _THIS );
667 
668 
673 
677  const real_t* const _x
678  );
679 
684  real_t* const xOpt
685  );
686 
687 
690 static inline QProblemStatus QProblem_getStatus( QProblem* _THIS );
691 
692 
696 static inline BooleanType QProblem_isInitialised( QProblem* _THIS );
697 
701 static inline BooleanType QProblem_isSolved( QProblem* _THIS );
702 
706 static inline BooleanType QProblem_isInfeasible( QProblem* _THIS );
707 
711 static inline BooleanType QProblem_isUnbounded( QProblem* _THIS );
712 
713 
716 static inline HessianType QProblem_getHessianType( QProblem* _THIS );
717 
720 static inline returnValue QProblem_setHessianType( QProblem* _THIS,
721  HessianType _hessianType
722  );
723 
727 static inline BooleanType QProblem_usingRegularisation( QProblem* _THIS );
728 
731 static inline Options QProblem_getOptions( QProblem* _THIS );
732 
735 static inline returnValue QProblem_setOptions( QProblem* _THIS,
736  Options _options
737  );
738 
741 static inline PrintLevel QProblem_getPrintLevel( QProblem* _THIS );
742 
746  PrintLevel _printlevel
747  );
748 
749 
752 static inline unsigned int QProblem_getCount( QProblem* _THIS );
753 
756 static inline returnValue QProblem_resetCounter( QProblem* _THIS );
757 
758 
762 
763 
777  const real_t* const xOpt,
778  const real_t* const yOpt,
779  Bounds* const guessedBounds,
780  Constraints* const guessedConstraints,
781  const real_t* const _R,
782  int* nWSR,
784  real_t* const cputime
786  );
787 
801  const real_t* const g_new,
802  const real_t* const lb_new,
804  const real_t* const ub_new,
806  const real_t* const lbA_new,
808  const real_t* const ubA_new,
810  int* nWSR,
812  real_t* const cputime,
814  int nWSRperformed,
818  BooleanType isFirstCall
819  );
820 
821 
835  const real_t* const g_new,
836  const real_t* const lb_new,
838  const real_t* const ub_new,
840  const real_t* const lbA_new,
842  const real_t* const ubA_new,
844  int* nWSR,
846  real_t* const cputime,
848  int nWSRperformed,
851  BooleanType isFirstCall
852  );
853 
854 
859 
864  const real_t* const lb_new,
865  const real_t* const ub_new,
866  const real_t* const lbA_new,
867  const real_t* const ubA_new
868  );
869 
877 
884 
889 
890 
898  const real_t* const xOpt,
900  const real_t* const yOpt,
902  Bounds* const guessedBounds,
903  Constraints* const guessedConstraints,
904  Bounds* auxiliaryBounds,
906  Constraints* auxiliaryConstraints
908  );
909 
919  Bounds* const auxiliaryBounds,
920  Constraints* const auxiliaryConstraints,
921  BooleanType setupAfresh
923  );
924 
928  const real_t* const xOpt,
930  const real_t* const yOpt
932  );
933 
939 
946  Bounds* const auxiliaryBounds,
947  Constraints* const auxiliaryConstraints,
948  BooleanType useRelaxation
949  );
950 
951 
958  int number,
959  SubjectToStatus C_status,
960  BooleanType updateCholesky,
961  BooleanType ensureLI
962  );
963 
970  int number
971  );
972 
982  int number,
983  SubjectToStatus C_status
984  );
985 
992  int number,
993  SubjectToStatus B_status,
994  BooleanType updateCholesky,
995  BooleanType ensureLI
996  );
997 
1003  int number
1004  );
1005 
1015  int number,
1016  SubjectToStatus B_status
1017  );
1018 
1025  int number,
1026  BooleanType updateCholesky,
1027  BooleanType allowFlipping,
1028  BooleanType ensureNZC
1029  );
1030 
1037  int number,
1038  BooleanType updateCholesky,
1039  BooleanType allowFlipping,
1040  BooleanType ensureNZC
1041  );
1042 
1043 
1048  int nIdx,
1049  const int* const idxList,
1050  const real_t* const num,
1051  const real_t* const den,
1052  real_t epsNum,
1053  real_t epsDen,
1054  real_t* t,
1055  int* BC_idx
1056  );
1057 
1058 
1063  BooleanType removeBoundNotConstraint,
1064  int remIdx,
1065  BooleanType* exchangeHappened,
1066  BooleanType* addBoundNotConstraint,
1067  int* addIdx,
1068  SubjectToStatus* addStatus
1069  );
1070 
1071 
1076  const real_t* const b,
1077  BooleanType transposed,
1078  real_t* const a
1079  );
1080 
1081 
1085  const real_t* const g_new,
1086  const real_t* const lbA_new,
1087  const real_t* const ubA_new,
1088  const real_t* const lb_new,
1089  const real_t* const ub_new,
1090  real_t* const delta_g,
1091  real_t* const delta_lbA,
1092  real_t* const delta_ubA,
1093  real_t* const delta_lb,
1094  real_t* const delta_ub,
1095  BooleanType* Delta_bC_isZero,
1096  BooleanType* Delta_bB_isZero
1097  );
1098 
1104  const real_t* const delta_g,
1105  const real_t* const delta_lbA,
1106  const real_t* const delta_ubA,
1107  const real_t* const delta_lb,
1108  const real_t* const delta_ub,
1109  BooleanType Delta_bC_isZero,
1110  BooleanType Delta_bB_isZero,
1111  real_t* const delta_xFX,
1112  real_t* const delta_xFR,
1113  real_t* const delta_yAC,
1114  real_t* const delta_yFX
1115  );
1116 
1123  const real_t* const delta_g,
1124  const real_t* const delta_lbA,
1125  const real_t* const delta_ubA,
1126  const real_t* const delta_lb,
1127  const real_t* const delta_ub,
1128  const real_t* const delta_xFX,
1129  const real_t* const delta_xFR,
1130  const real_t* const delta_yAC,
1131  const real_t* const delta_yFX,
1132  int* BC_idx,
1133  SubjectToStatus* BC_status,
1134  BooleanType* BC_isBound
1135  );
1136 
1142  int BC_idx,
1143  SubjectToStatus BC_status,
1144  BooleanType BC_isBound
1145  );
1146 
1147 
1152  const real_t* const g_new,
1153  const real_t* const lb_new,
1154  const real_t* const ub_new,
1155  const real_t* const lbA_new,
1156  const real_t* const ubA_new
1157  );
1158 
1159 
1164 
1165 
1168  real_t curFarBound,
1169  int nRamp,
1170  const real_t* const lb_new,
1171  real_t* const lb_new_far,
1172  const real_t* const ub_new,
1173  real_t* const ub_new_far,
1174  const real_t* const lbA_new,
1175  real_t* const lbA_new_far,
1176  const real_t* const ubA_new,
1177  real_t* const ubA_new_far
1178  );
1179 
1182  real_t curFarBound,
1183  int nRamp,
1184  const real_t* const lb_new,
1185  real_t* const lb_new_far,
1186  const real_t* const ub_new,
1187  real_t* const ub_new_far
1188  );
1189 
1190 
1191 
1196  int nIdx,
1197  const int* const idxList,
1198  Constraints* const subjectTo,
1199  const real_t* const num,
1200  const real_t* const den,
1201  real_t epsNum,
1202  real_t epsDen,
1203  real_t* t,
1204  int* BC_idx
1205  );
1206 
1207 
1211 
1212 
1220  Bounds* const guessedBounds,
1221  Constraints* const guessedConstraints
1222  );
1223 
1229  Bounds* const guessedBounds,
1230  Constraints* const guessedConstraints
1231  );
1232 
1238  DenseMatrix *_H,
1240  const real_t* const _g,
1241  DenseMatrix *_A,
1242  const real_t* const _lb,
1244  const real_t* const _ub,
1246  const real_t* const _lbA,
1248  const real_t* const _ubA
1250  );
1251 
1252 
1260  real_t* const _H,
1262  const real_t* const _g,
1263  real_t* const _A,
1264  const real_t* const _lb,
1266  const real_t* const _ub,
1268  const real_t* const _lbA,
1270  const real_t* const _ubA
1272  );
1273 
1283  const char* const H_file,
1285  const char* const g_file,
1286  const char* const A_file,
1287  const char* const lb_file,
1289  const char* const ub_file,
1291  const char* const lbA_file,
1293  const char* const ubA_file
1295  );
1296 
1303  const char* const g_file,
1304  const char* const lb_file,
1306  const char* const ub_file,
1308  const char* const lbA_file,
1310  const char* const ubA_file,
1312  real_t* const g_new,
1313  real_t* const lb_new,
1314  real_t* const ub_new,
1315  real_t* const lbA_new,
1316  real_t* const ubA_new
1317  );
1318 
1319 
1323  int iter,
1324  int BC_idx,
1325  SubjectToStatus BC_status,
1326  BooleanType BC_isBound,
1327  real_t homotopyLength,
1328  BooleanType isFirstCall
1329  );
1330 
1331 
1336 static inline returnValue QProblem_setAM( QProblem* _THIS,
1337  DenseMatrix *A_new
1338  );
1339 
1344 static inline returnValue QProblem_setA( QProblem* _THIS,
1345  real_t* const A_new
1346  );
1347 
1348 
1352 static inline returnValue QProblem_setLBA( QProblem* _THIS,
1353  const real_t* const lbA_new
1354  );
1355 
1360 static inline returnValue QProblem_setLBAn( QProblem* _THIS,
1361  int number,
1362  real_t value
1363  );
1364 
1368 static inline returnValue QProblem_setUBA( QProblem* _THIS,
1369  const real_t* const ubA_new
1370  );
1371 
1376 static inline returnValue QProblem_setUBAn( QProblem* _THIS,
1377  int number,
1378  real_t value
1379  );
1380 
1381 
1387  const real_t* const lb,
1388  const real_t* const ub,
1389  const real_t* const lbA,
1390  const real_t* const ubA
1391  );
1392 
1393 
1399  int BC_number,
1400  SubjectToStatus BC_status,
1401  BooleanType BC_isBound,
1402  real_t *xiB,
1403  real_t *xiC
1404  );
1405 
1406 
1413 
1423 
1430  const real_t* const xOpt,
1432  const real_t* const yOpt,
1434  Bounds* const guessedBounds,
1435  Bounds* auxiliaryBounds
1437  );
1438 
1439 
1444  const real_t* const b,
1445  BooleanType transposed,
1446  real_t* const a
1447  );
1448 
1454  const real_t* const b,
1455  BooleanType transposed,
1456  BooleanType removingBound,
1457  real_t* const a
1458  );
1459 
1460 
1464  const real_t* const g_new,
1465  const real_t* const lb_new,
1466  const real_t* const ub_new,
1467  real_t* const delta_g,
1468  real_t* const delta_lb,
1469  real_t* const delta_ub,
1470  BooleanType* Delta_bB_isZero
1471  );
1472 
1473 
1478  DenseMatrix *_H,
1479  const real_t* const _g,
1480  const real_t* const _lb,
1482  const real_t* const _ub
1484  );
1485 
1493  real_t* const _H,
1495  const real_t* const _g,
1496  const real_t* const _lb,
1498  const real_t* const _ub
1500  );
1501 
1511  const char* const H_file,
1513  const char* const g_file,
1514  const char* const lb_file,
1516  const char* const ub_file
1518  );
1519 
1526  const char* const g_file,
1527  const char* const lb_file,
1529  const char* const ub_file,
1531  real_t* const g_new,
1532  real_t* const lb_new,
1533  real_t* const ub_new
1534  );
1535 
1536 
1543  returnValue returnvalue,
1544  BooleanType doThrowError
1545  );
1546 
1547 
1552  const real_t* const cputime,
1553  real_t starttime,
1554  int nWSR
1555  );
1556 
1557 
1562 
1563 
1566 static inline returnValue QProblem_setHM( QProblem* _THIS,
1567  DenseMatrix* H_new
1568  );
1569 
1575 static inline returnValue QProblem_setH( QProblem* _THIS,
1576  real_t* const H_new
1577  );
1578 
1582 static inline returnValue QProblem_setG( QProblem* _THIS,
1583  const real_t* const g_new
1584  );
1585 
1589 static inline returnValue QProblem_setLB( QProblem* _THIS,
1590  const real_t* const lb_new
1591  );
1592 
1596 static inline returnValue QProblem_setLBn( QProblem* _THIS,
1597  int number,
1598  real_t value
1599  );
1600 
1604 static inline returnValue QProblem_setUB( QProblem* _THIS,
1605  const real_t* const ub_new
1606  );
1607 
1611 static inline returnValue QProblem_setUBn( QProblem* _THIS,
1612  int number,
1613  real_t value
1614  );
1615 
1616 
1617 
1622  const real_t* const g_new,
1623  const real_t* const lb_new,
1624  const real_t* const ub_new
1625  );
1626 
1627 
1628 
1633  int nIdx,
1634  const int* const idxList,
1635  Bounds* const subjectTo,
1636  const real_t* const num,
1637  const real_t* const den,
1638  real_t epsNum,
1639  real_t epsDen,
1640  real_t* t,
1641  int* BC_idx
1642  );
1643 
1647 static inline BooleanType QProblem_isBlocking( QProblem* _THIS,
1648  real_t num,
1649  real_t den,
1650  real_t epsNum,
1651  real_t epsDen,
1652  real_t* t
1654  );
1655 
1656 
1661  const char* const filename
1662  );
1663 
1668  const char* const filename
1669  );
1670 
1671 
1672 /*
1673  * g e t B o u n d s
1674  */
1675 static inline returnValue QProblem_getBounds( QProblem* _THIS, Bounds* _bounds )
1676 {
1677  int nV = QProblem_getNV( _THIS );
1678 
1679  if ( nV == 0 )
1681 
1682  *_bounds = _THIS->bounds;
1683 
1684  return SUCCESSFUL_RETURN;
1685 }
1686 
1687 
1688 /*
1689  * g e t N V
1690  */
1691 static inline int QProblem_getNV( QProblem* _THIS )
1692 {
1693  return Bounds_getNV( &(_THIS->bounds) );
1694 }
1695 
1696 
1697 /*
1698  * g e t N F R
1699  */
1700 static inline int QProblem_getNFR( QProblem* _THIS )
1701 {
1702  return Bounds_getNFR( &(_THIS->bounds) );
1703 }
1704 
1705 
1706 /*
1707  * g e t N F X
1708  */
1709 static inline int QProblem_getNFX( QProblem* _THIS )
1710 {
1711  return Bounds_getNFX( &(_THIS->bounds) );
1712 }
1713 
1714 
1715 /*
1716  * g e t N F V
1717  */
1718 static inline int QProblem_getNFV( QProblem* _THIS )
1719 {
1720  return Bounds_getNFV( &(_THIS->bounds) );
1721 }
1722 
1723 
1724 /*
1725  * g e t S t a t u s
1726  */
1728 {
1729  return _THIS->status;
1730 }
1731 
1732 
1733 /*
1734  * i s I n i t i a l i s e d
1735  */
1737 {
1738  if ( _THIS->status == QPS_NOTINITIALISED )
1739  return BT_FALSE;
1740  else
1741  return BT_TRUE;
1742 }
1743 
1744 
1745 /*
1746  * i s S o l v e d
1747  */
1748 static inline BooleanType QProblem_isSolved( QProblem* _THIS )
1749 {
1750  if ( _THIS->status == QPS_SOLVED )
1751  return BT_TRUE;
1752  else
1753  return BT_FALSE;
1754 }
1755 
1756 
1757 /*
1758  * i s I n f e a s i b l e
1759  */
1761 {
1762  return _THIS->infeasible;
1763 }
1764 
1765 
1766 /*
1767  * i s U n b o u n d e d
1768  */
1770 {
1771  return _THIS->unbounded;
1772 }
1773 
1774 
1775 /*
1776  * g e t H e s s i a n T y p e
1777  */
1779 {
1780  return _THIS->hessianType;
1781 }
1782 
1783 
1784 /*
1785  * s e t H e s s i a n T y p e
1786  */
1787 static inline returnValue QProblem_setHessianType( QProblem* _THIS, HessianType _hessianType )
1788 {
1789  _THIS->hessianType = _hessianType;
1790  return SUCCESSFUL_RETURN;
1791 }
1792 
1793 
1794 /*
1795  * u s i n g R e g u l a r i s a t i o n
1796  */
1798 {
1799  if ( _THIS->regVal > QPOASES_ZERO )
1800  return BT_TRUE;
1801  else
1802  return BT_FALSE;
1803 }
1804 
1805 
1806 /*
1807  * g e t O p t i o n s
1808  */
1809 static inline Options QProblem_getOptions( QProblem* _THIS )
1810 {
1811  return _THIS->options;
1812 }
1813 
1814 
1815 /*
1816  * s e t O p t i o n s
1817  */
1819  Options _options
1820  )
1821 {
1822  OptionsCPY( &_options,&(_THIS->options) );
1823  Options_ensureConsistency( &(_THIS->options) );
1824 
1825  QProblem_setPrintLevel( _THIS,_THIS->options.printLevel );
1826 
1827  return SUCCESSFUL_RETURN;
1828 }
1829 
1830 
1831 /*
1832  * g e t P r i n t L e v e l
1833  */
1835 {
1836  return _THIS->options.printLevel;
1837 }
1838 
1839 
1840 /*
1841  * g e t C o u n t
1842  */
1843 static inline unsigned int QProblem_getCount( QProblem* _THIS )
1844 {
1845  return _THIS->count;
1846 }
1847 
1848 
1849 /*
1850  * r e s e t C o u n t e r
1851  */
1853 {
1854  _THIS->count = 0;
1855  return SUCCESSFUL_RETURN;
1856 }
1857 
1858 
1859 
1860 /*****************************************************************************
1861  * P R O T E C T E D *
1862  *****************************************************************************/
1863 
1864 
1865 /*
1866  * s e t H
1867  */
1869 {
1870  if ( H_new == 0 )
1871  return QProblem_setH( _THIS,(real_t*)0 );
1872  else
1873  return QProblem_setH( _THIS,DenseMatrix_getVal(H_new) );
1874 }
1875 
1876 
1877 /*
1878  * s e t H
1879  */
1880 static inline returnValue QProblem_setH( QProblem* _THIS, real_t* const H_new )
1881 {
1882  /* if null pointer is passed, Hessian is set to zero matrix
1883  * (or stays identity matrix) */
1884  if ( H_new == 0 )
1885  {
1886  if ( _THIS->hessianType == HST_IDENTITY )
1887  return SUCCESSFUL_RETURN;
1888 
1889  _THIS->hessianType = HST_ZERO;
1890 
1891  _THIS->H = 0;
1892  }
1893  else
1894  {
1895  DenseMatrixCON( _THIS->H,QProblem_getNV( _THIS ),QProblem_getNV( _THIS ),QProblem_getNV( _THIS ),H_new );
1896  }
1897 
1898  return SUCCESSFUL_RETURN;
1899 }
1900 
1901 
1902 /*
1903  * s e t G
1904  */
1905 static inline returnValue QProblem_setG( QProblem* _THIS, const real_t* const g_new )
1906 {
1907  unsigned int nV = (unsigned int)QProblem_getNV( _THIS );
1908 
1909  if ( nV == 0 )
1911 
1912  if ( g_new == 0 )
1914 
1915  memcpy( _THIS->g,g_new,nV*sizeof(real_t) );
1916 
1917  return SUCCESSFUL_RETURN;
1918 }
1919 
1920 
1921 /*
1922  * s e t L B
1923  */
1924 static inline returnValue QProblem_setLB( QProblem* _THIS, const real_t* const lb_new )
1925 {
1926  unsigned int i;
1927  unsigned int nV = (unsigned int)QProblem_getNV( _THIS );
1928 
1929  if ( nV == 0 )
1931 
1932  if ( lb_new != 0 )
1933  {
1934  memcpy( _THIS->lb,lb_new,nV*sizeof(real_t) );
1935  }
1936  else
1937  {
1938  /* if no lower bounds are specified, set them to -infinity */
1939  for( i=0; i<nV; ++i )
1940  _THIS->lb[i] = -QPOASES_INFTY;
1941  }
1942 
1943  return SUCCESSFUL_RETURN;
1944 }
1945 
1946 
1947 /*
1948  * s e t L B
1949  */
1950 static inline returnValue QProblem_setLBn( QProblem* _THIS, int number, real_t value )
1951 {
1952  int nV = QProblem_getNV( _THIS );
1953 
1954  if ( nV == 0 )
1956 
1957  if ( ( number >= 0 ) && ( number < nV ) )
1958  {
1959  _THIS->lb[number] = value;
1960  return SUCCESSFUL_RETURN;
1961  }
1962  else
1963  {
1965  }
1966 }
1967 
1968 
1969 /*
1970  * s e t U B
1971  */
1972 static inline returnValue QProblem_setUB( QProblem* _THIS, const real_t* const ub_new )
1973 {
1974  unsigned int i;
1975  unsigned int nV = (unsigned int)QProblem_getNV( _THIS );
1976 
1977  if ( nV == 0 )
1979 
1980  if ( ub_new != 0 )
1981  {
1982  memcpy( _THIS->ub,ub_new,nV*sizeof(real_t) );
1983  }
1984  else
1985  {
1986  /* if no upper bounds are specified, set them to infinity */
1987  for( i=0; i<nV; ++i )
1988  _THIS->ub[i] = QPOASES_INFTY;
1989  }
1990 
1991  return SUCCESSFUL_RETURN;
1992 }
1993 
1994 
1995 /*
1996  * s e t U B
1997  */
1998 static inline returnValue QProblem_setUBn( QProblem* _THIS, int number, real_t value )
1999 {
2000  int nV = QProblem_getNV( _THIS );
2001 
2002  if ( nV == 0 )
2004 
2005  if ( ( number >= 0 ) && ( number < nV ) )
2006  {
2007  _THIS->ub[number] = value;
2008 
2009  return SUCCESSFUL_RETURN;
2010  }
2011  else
2012  {
2014  }
2015 }
2016 
2017 
2018 
2019 /*
2020  * i s B l o c k i n g
2021  */
2023  real_t num,
2024  real_t den,
2025  real_t epsNum,
2026  real_t epsDen,
2027  real_t* t
2028  )
2029 {
2030  if ( ( den >= epsDen ) && ( num >= epsNum ) )
2031  {
2032  if ( num < (*t)*den )
2033  return BT_TRUE;
2034  }
2035 
2036  return BT_FALSE;
2037 }
2038 
2039 
2040 
2041 /*
2042  * g e t C o n s t r a i n t s
2043  */
2044 static inline returnValue QProblem_getConstraints( QProblem* _THIS, Constraints* _constraints )
2045 {
2046  int nV = QProblem_getNV( _THIS );
2047 
2048  if ( nV == 0 )
2050 
2051  ConstraintsCPY( &(_THIS->constraints),_constraints );
2052 
2053  return SUCCESSFUL_RETURN;
2054 }
2055 
2056 
2057 
2058 /*
2059  * g e t N C
2060  */
2061 static inline int QProblem_getNC( QProblem* _THIS )
2062 {
2063  return Constraints_getNC( &(_THIS->constraints) );
2064 }
2065 
2066 
2067 /*
2068  * g e t N E C
2069  */
2070 static inline int QProblem_getNEC( QProblem* _THIS )
2071 {
2072  return Constraints_getNEC( &(_THIS->constraints) );
2073 }
2074 
2075 
2076 /*
2077  * g e t N A C
2078  */
2079 static inline int QProblem_getNAC( QProblem* _THIS )
2080 {
2081  return Constraints_getNAC( &(_THIS->constraints) );
2082 }
2083 
2084 
2085 /*
2086  * g e t N I A C
2087  */
2088 static inline int QProblem_getNIAC( QProblem* _THIS )
2089 {
2090  return Constraints_getNIAC( &(_THIS->constraints) );
2091 }
2092 
2093 
2094 
2095 /*****************************************************************************
2096  * P R O T E C T E D *
2097  *****************************************************************************/
2098 
2099 
2100 /*
2101  * s e t A
2102  */
2104 {
2105  if ( A_new == 0 )
2106  return QProblem_setA( _THIS,(real_t*)0 );
2107  else
2108  return QProblem_setA( _THIS,DenseMatrix_getVal(A_new) );
2109 }
2110 
2111 
2112 /*
2113  * s e t A
2114  */
2115 static inline returnValue QProblem_setA( QProblem* _THIS, real_t* const A_new )
2116 {
2117  int j;
2118  int nV = QProblem_getNV( _THIS );
2119  int nC = QProblem_getNC( _THIS );
2120 
2121  if ( nV == 0 )
2123 
2124  if ( A_new == 0 )
2126 
2127  DenseMatrixCON( _THIS->A,QProblem_getNC( _THIS ),QProblem_getNV( _THIS ),QProblem_getNV( _THIS ),A_new );
2128 
2129  DenseMatrix_times( _THIS->A,1, 1.0, _THIS->x, nV, 0.0, _THIS->Ax, nC);
2130 
2131  for( j=0; j<nC; ++j )
2132  {
2133  _THIS->Ax_u[j] = _THIS->ubA[j] - _THIS->Ax[j];
2134  _THIS->Ax_l[j] = _THIS->Ax[j] - _THIS->lbA[j];
2135 
2136  /* (ckirches) disable constraints with empty rows */
2137  if ( qpOASES_isZero( DenseMatrix_getRowNorm( _THIS->A,j,2 ),QPOASES_ZERO ) == BT_TRUE )
2139  }
2140 
2141  return SUCCESSFUL_RETURN;
2142 }
2143 
2144 
2145 /*
2146  * s e t L B A
2147  */
2148 static inline returnValue QProblem_setLBA( QProblem* _THIS, const real_t* const lbA_new )
2149 {
2150  unsigned int i;
2151  unsigned int nV = (unsigned int)QProblem_getNV( _THIS );
2152  unsigned int nC = (unsigned int)QProblem_getNC( _THIS );
2153 
2154  if ( nV == 0 )
2156 
2157  if ( lbA_new != 0 )
2158  {
2159  memcpy( _THIS->lbA,lbA_new,nC*sizeof(real_t) );
2160  }
2161  else
2162  {
2163  /* if no lower constraints' bounds are specified, set them to -infinity */
2164  for( i=0; i<nC; ++i )
2165  _THIS->lbA[i] = -QPOASES_INFTY;
2166  }
2167 
2168  return SUCCESSFUL_RETURN;
2169 }
2170 
2171 
2172 /*
2173  * s e t L B A
2174  */
2175 static inline returnValue QProblem_setLBAn( QProblem* _THIS, int number, real_t value )
2176 {
2177  int nV = QProblem_getNV( _THIS );
2178  int nC = QProblem_getNC( _THIS );
2179 
2180  if ( nV == 0 )
2182 
2183  if ( ( number >= 0 ) && ( number < nC ) )
2184  {
2185  _THIS->lbA[number] = value;
2186  return SUCCESSFUL_RETURN;
2187  }
2188  else
2190 }
2191 
2192 
2193 /*
2194  * s e t U B A
2195  */
2196 static inline returnValue QProblem_setUBA( QProblem* _THIS, const real_t* const ubA_new )
2197 {
2198  unsigned int i;
2199  unsigned int nV = (unsigned int)QProblem_getNV( _THIS );
2200  unsigned int nC = (unsigned int)QProblem_getNC( _THIS );
2201 
2202  if ( nV == 0 )
2204 
2205  if ( ubA_new != 0 )
2206  {
2207  memcpy( _THIS->ubA,ubA_new,nC*sizeof(real_t) );
2208  }
2209  else
2210  {
2211  /* if no upper constraints' bounds are specified, set them to infinity */
2212  for( i=0; i<nC; ++i )
2213  _THIS->ubA[i] = QPOASES_INFTY;
2214  }
2215 
2216  return SUCCESSFUL_RETURN;
2217 }
2218 
2219 
2220 /*
2221  * s e t U B A
2222  */
2223 static inline returnValue QProblem_setUBAn( QProblem* _THIS, int number, real_t value )
2224 {
2225  int nV = QProblem_getNV( _THIS );
2226  int nC = QProblem_getNC( _THIS );
2227 
2228  if ( nV == 0 )
2230 
2231  if ( ( number >= 0 ) && ( number < nC ) )
2232  {
2233  _THIS->ubA[number] = value;
2234  return SUCCESSFUL_RETURN;
2235  }
2236  else
2238 }
2239 
2240 
2242 
2243 
2244 #endif /* QPOASES_QPROBLEM_H */
2245 
2246 
2247 /*
2248  * end of file
2249  */
returnValue QProblem_backsolveR(QProblem *_THIS, const real_t *const b, BooleanType transposed, real_t *const a)
Definition: QProblem.c:1748
returnValue QProblem_printProperties(QProblem *_THIS)
Definition: QProblem.c:1249
returnValue QProblem_writeQpWorkspaceIntoMatFile(QProblem *_THIS, const char *const filename)
real_t g[NVMAX]
Definition: QProblem.h:68
returnValue QProblem_writeQpDataIntoMatFile(QProblem *_THIS, const char *const filename)
QProblemStatus status
Definition: QProblem.h:82
returnValue QProblem_getPrimalSolution(QProblem *_THIS, real_t *const xOpt)
Definition: QProblem.c:1168
static int QProblem_getNIAC(QProblem *_THIS)
Definition: QProblem.h:2088
static int Constraints_getNC(Constraints *_THIS)
Definition: Constraints.h:444
void QProblemCPY(QProblem *FROM, QProblem *TO)
Definition: QProblem.c:132
returnValue QProblem_addBound_ensureLI(QProblem *_THIS, int number, SubjectToStatus B_status)
Definition: QProblem.c:4388
returnValue QProblem_setupQPdataM(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)
Definition: QProblem.c:6656
static Options QProblem_getOptions(QProblem *_THIS)
Definition: QProblem.h:1809
Interface for specifying user-defined evaluations of constraint products.
returnValue QProblem_initM(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)
Definition: QProblem.c:256
returnValue QProblem_obtainAuxiliaryWorkingSet(QProblem *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Constraints *const guessedConstraints, Bounds *auxiliaryBounds, Constraints *auxiliaryConstraints)
Definition: QProblem.c:3040
USING_NAMESPACE_ACADO typedef TaylorVariable< Interval > T
static int Bounds_getNFV(Bounds *_THIS)
Definition: Bounds.h:463
returnValue QProblem_setInfeasibilityFlag(QProblem *_THIS, returnValue returnvalue, BooleanType doThrowError)
Definition: QProblem.c:2048
Flipper flipper
Definition: QProblem.h:101
returnValue QProblemBCPY_updateFarBounds(QProblem *_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: QProblem.c:6245
real_t DenseMatrix_getRowNorm(DenseMatrix *_THIS, int rNum, int type)
Definition: Matrices.c:141
returnValue QProblem_loadQPvectorsFromFile(QProblem *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, real_t *const g_new, real_t *const lb_new, real_t *const ub_new, real_t *const lbA_new, real_t *const ubA_new)
Definition: QProblem.c:6785
returnValue QProblem_init(QProblem *_THIS, real_t *const _H, const real_t *const _g, 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, real_t *const cputime)
Definition: QProblem.c:299
int QProblem_getNZ(QProblem *_THIS)
Definition: QProblem.c:1048
BooleanType QProblem_isCPUtimeLimitExceeded(QProblem *_THIS, const real_t *const cputime, real_t starttime, int nWSR)
Definition: QProblem.c:2064
returnValue QProblem_regulariseHessian(QProblem *_THIS)
Definition: QProblem.c:2094
ConstraintProduct constraintProduct
Definition: QProblem.h:122
returnValue QProblem_removeConstraint(QProblem *_THIS, int number, BooleanType updateCholesky, BooleanType allowFlipping, BooleanType ensureNZC)
Definition: QProblem.c:4565
returnValue QProblemBCPY_setupQPdataFromFile(QProblem *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file)
Definition: QProblem.c:1919
Allows to pass back messages to the calling function.
static returnValue QProblem_resetCounter(QProblem *_THIS)
Definition: QProblem.h:1852
returnValue QProblem_hotstartW(QProblem *_THIS, 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, Bounds *const guessedBounds, Constraints *const guessedConstraints)
Definition: QProblem.c:801
returnValue QProblem_setupInitialCholesky(QProblem *_THIS)
Definition: QProblem.c:544
HessianType hessianType
Definition: QProblem.h:87
returnValue QProblem_addConstraint_checkLI(QProblem *_THIS, int number)
Definition: QProblem.c:3803
returnValue QProblem_setupAuxiliaryQP(QProblem *_THIS, Bounds *const guessedBounds, Constraints *const guessedConstraints)
Definition: QProblem.c:6528
static int QProblem_getNFR(QProblem *_THIS)
Definition: QProblem.h:1700
static returnValue QProblem_setLBAn(QProblem *_THIS, int number, real_t value)
Definition: QProblem.h:2175
returnValue Options_ensureConsistency(Options *_THIS)
Definition: Options.c:263
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 QProblemBCPY_determineDataShift(QProblem *_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: QProblem.c:1818
real_t QProblem_getObjValX(QProblem *_THIS, const real_t *const _x)
Definition: QProblem.c:1119
Auxiliary class for storing a copy of the current matrix factorisations.
static BooleanType QProblem_isInfeasible(QProblem *_THIS)
Definition: QProblem.h:1760
static int QProblem_getNAC(QProblem *_THIS)
Definition: QProblem.h:2079
returnValue QProblem_removeBound(QProblem *_THIS, int number, BooleanType updateCholesky, BooleanType allowFlipping, BooleanType ensureNZC)
Definition: QProblem.c:4796
returnValue QProblem_performStep(QProblem *_THIS, const real_t *const delta_g, const real_t *const delta_lbA, const real_t *const delta_ubA, 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_yAC, const real_t *const delta_yFX, int *BC_idx, SubjectToStatus *BC_status, BooleanType *BC_isBound)
Definition: QProblem.c:5741
#define HST_IDENTITY
static const real_t QPOASES_ZERO
returnValue QProblem_areBoundsConsistent(QProblem *_THIS, const real_t *const lb, const real_t *const ub, const real_t *const lbA, const real_t *const ubA)
Definition: QProblem.c:7090
real_t ramp1
Definition: QProblem.h:95
static BooleanType qpOASES_isZero(real_t x, real_t TOL)
Definition: Utils.h:386
static int Constraints_getNEC(Constraints *_THIS)
Definition: Constraints.h:453
static int QProblem_getNV(QProblem *_THIS)
Definition: QProblem.h:1691
returnValue QProblemBCPY_loadQPvectorsFromFile(QProblem *_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: QProblem.c:1987
static returnValue QProblem_setUBA(QProblem *_THIS, const real_t *const ubA_new)
Definition: QProblem.h:2196
returnValue QProblem_setupAuxiliaryQPgradient(QProblem *_THIS)
Definition: QProblem.c:3444
returnValue QProblem_determineDataShift(QProblem *_THIS, const real_t *const g_new, const real_t *const lbA_new, const real_t *const ubA_new, const real_t *const lb_new, const real_t *const ub_new, real_t *const delta_g, real_t *const delta_lbA, real_t *const delta_ubA, real_t *const delta_lb, real_t *const delta_ub, BooleanType *Delta_bC_isZero, BooleanType *Delta_bB_isZero)
Definition: QProblem.c:5333
returnValue QProblem_performDriftCorrection(QProblem *_THIS)
Definition: QProblem.c:6429
returnValue QProblem_solveCurrentEQP(QProblem *_THIS, const int n_rhs, const real_t *g_in, const real_t *lb_in, const real_t *ub_in, const real_t *lbA_in, const real_t *ubA_in, real_t *x_out, real_t *y_out)
Definition: QProblem.c:910
static BooleanType QProblem_isInitialised(QProblem *_THIS)
Definition: QProblem.h:1736
DenseMatrix * A
Definition: QProblem.h:103
returnValue QProblem_performRatioTestB(QProblem *_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: QProblem.c:2133
returnValue QProblem_setPrintLevel(QProblem *_THIS, PrintLevel _printlevel)
Definition: QProblem.c:1193
int rampOffset
Definition: QProblem.h:96
void DenseMatrixCON(DenseMatrix *_THIS, int m, int n, int lD, real_t *v)
Definition: Matrices.c:47
returnValue QProblem_solveQP(QProblem *_THIS, 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, int nWSRperformed, BooleanType isFirstCall)
Definition: QProblem.c:2414
returnValue QProblem_addConstraint(QProblem *_THIS, int number, SubjectToStatus C_status, BooleanType updateCholesky, BooleanType ensureLI)
Definition: QProblem.c:3639
void ConstraintsCPY(Constraints *FROM, Constraints *TO)
Definition: Constraints.c:61
returnValue QProblemBCPY_obtainAuxiliaryWorkingSet(QProblem *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Bounds *auxiliaryBounds)
Definition: QProblem.c:1604
real_t regVal
Definition: QProblem.h:88
returnValue QProblem_ensureNonzeroCurvature(QProblem *_THIS, BooleanType removeBoundNotConstraint, int remIdx, BooleanType *exchangeHappened, BooleanType *addBoundNotConstraint, int *addIdx, SubjectToStatus *addStatus)
Definition: QProblem.c:5050
real_t ramp0
Definition: QProblem.h:94
returnValue QProblem_dropInfeasibles(QProblem *_THIS, int BC_number, SubjectToStatus BC_status, BooleanType BC_isBound, real_t *xiB, real_t *xiC)
Definition: QProblem.c:7121
Interfaces matrix-vector operations tailored to general dense matrices.
returnValue QProblem_hotstart(QProblem *_THIS, 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)
Definition: QProblem.c:578
Bounds bounds
Definition: QProblem.h:72
DenseMatrix HH
Definition: QProblem.h:66
static returnValue QProblem_setHessianType(QProblem *_THIS, HessianType _hessianType)
Definition: QProblem.h:1787
returnValue QProblem_setupQPdata(QProblem *_THIS, real_t *const _H, const real_t *const _g, real_t *const _A, const real_t *const _lb, const real_t *const _ub, const real_t *const _lbA, const real_t *const _ubA)
Definition: QProblem.c:6682
static returnValue QProblem_setG(QProblem *_THIS, const real_t *const g_new)
Definition: QProblem.h:1905
unsigned int count
Definition: QProblem.h:90
returnValue QProblemBCPY_setupQPdataM(QProblem *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
Definition: QProblem.c:1881
static int Bounds_getNFX(Bounds *_THIS)
Definition: Bounds.h:499
Provides a generic way to set and pass user-specified options.
Definition: options.hpp:65
returnValue QProblem_addConstraint_ensureLI(QProblem *_THIS, int number, SubjectToStatus C_status)
Definition: QProblem.c:3925
real_t QProblem_getRelativeHomotopyLength(QProblem *_THIS, 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)
Definition: QProblem.c:6142
real_t QProblem_getObjVal(QProblem *_THIS)
Definition: QProblem.c:1095
static BooleanType QProblem_isSolved(QProblem *_THIS)
Definition: QProblem.h:1748
returnValue QProblem_initW(QProblem *_THIS, real_t *const _H, const real_t *const _g, 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, 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:414
returnValue QProblem_solveInitialQP(QProblem *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Constraints *const guessedConstraints, const real_t *const _R, int *nWSR, real_t *const cputime)
Definition: QProblem.c:2232
static returnValue QProblem_setAM(QProblem *_THIS, DenseMatrix *A_new)
Definition: QProblem.h:2103
real_t x[NVMAX]
Definition: QProblem.h:77
static int Bounds_getNV(Bounds *_THIS)
Definition: Bounds.h:454
returnValue QProblem_addBound(QProblem *_THIS, int number, SubjectToStatus B_status, BooleanType updateCholesky, BooleanType ensureLI)
Definition: QProblem.c:4107
static returnValue QProblem_setHM(QProblem *_THIS, DenseMatrix *H_new)
Definition: QProblem.h:1868
DenseMatrix AA
Definition: QProblem.h:104
BooleanType infeasible
Definition: QProblem.h:84
TabularOutput tabularOutput
Definition: QProblem.h:99
static int QProblem_getNFX(QProblem *_THIS)
Definition: QProblem.h:1709
returnValue QProblem_initF(QProblem *_THIS, const char *const H_file, const char *const g_file, const char *const A_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, int *nWSR, real_t *const cputime)
Definition: QProblem.c:327
returnValue QProblem_setupTQfactorisation(QProblem *_THIS)
Definition: QProblem.c:3011
static int QProblem_getNFV(QProblem *_THIS)
Definition: QProblem.h:1718
Options options
Definition: QProblem.h:98
returnValue QProblem_addBound_checkLI(QProblem *_THIS, int number)
Definition: QProblem.c:4283
returnValue QProblem_changeActiveSet(QProblem *_THIS, int BC_idx, SubjectToStatus BC_status, BooleanType BC_isBound)
Definition: QProblem.c:6055
static returnValue QProblem_setH(QProblem *_THIS, real_t *const H_new)
Definition: QProblem.h:1880
static const real_t QPOASES_INFTY
static QProblemStatus QProblem_getStatus(QProblem *_THIS)
Definition: QProblem.h:1727
real_t tau
Definition: QProblem.h:80
static int Bounds_getNFR(Bounds *_THIS)
Definition: Bounds.h:490
returnValue QProblem_setupAuxiliaryQPbounds(QProblem *_THIS, Bounds *const auxiliaryBounds, Constraints *const auxiliaryConstraints, BooleanType useRelaxation)
Definition: QProblem.c:3489
returnValue QProblem_setupQPdataFromFile(QProblem *_THIS, const char *const H_file, const char *const g_file, const char *const A_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file)
Definition: QProblem.c:6718
PrintLevel
returnValue QProblemBCPY_setupQPdata(QProblem *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
Definition: QProblem.c:1895
returnValue QProblem_hotstartF(QProblem *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, int *nWSR, real_t *const cputime)
Definition: QProblem.c:759
void OptionsCPY(Options *FROM, Options *TO)
Definition: Options.c:64
static returnValue QProblem_setLB(QProblem *_THIS, const real_t *const lb_new)
Definition: QProblem.h:1924
returnValue QProblem_setConstraintProduct(QProblem *_THIS, ConstraintProduct _constraintProduct)
Definition: QProblem.c:1084
static int QProblem_getNC(QProblem *_THIS)
Definition: QProblem.h:2061
returnValue QProblem_getDualSolution(QProblem *_THIS, real_t *const yOpt)
Definition: QProblem.c:1058
#define BT_TRUE
Definition: acado_types.hpp:47
static returnValue QProblem_setLBA(QProblem *_THIS, const real_t *const lbA_new)
Definition: QProblem.h:2148
static real_t * DenseMatrix_getVal(DenseMatrix *_THIS)
Definition: Matrices.h:257
returnValue QProblem_getWorkingSetConstraints(QProblem *_THIS, real_t *workingSetC)
Definition: QProblem.c:1022
static returnValue QProblem_setUBn(QProblem *_THIS, int number, real_t value)
Definition: QProblem.h:1998
returnValue QProblem_backsolveRrem(QProblem *_THIS, const real_t *const b, BooleanType transposed, BooleanType removingBound, real_t *const a)
Definition: QProblem.c:1760
#define HST_ZERO
static BooleanType QProblem_isBlocking(QProblem *_THIS, real_t num, real_t den, real_t epsNum, real_t epsDen, real_t *t)
Definition: QProblem.h:2022
Stores internal information for tabular (debugging) output.
returnValue QProblem_performPlainRatioTest(QProblem *_THIS, int nIdx, const int *const idxList, const real_t *const num, const real_t *const den, real_t epsNum, real_t epsDen, real_t *t, int *BC_idx)
Definition: QProblem.c:5027
returnValue QProblemBCPY_computeCholesky(QProblem *_THIS)
Definition: QProblem.c:1525
static returnValue QProblem_getConstraints(QProblem *_THIS, Constraints *_constraints)
Definition: QProblem.h:2044
static unsigned int QProblem_getCount(QProblem *_THIS)
Definition: QProblem.h:1843
returnValue QProblem_getWorkingSet(QProblem *_THIS, real_t *workingSet)
Definition: QProblem.c:981
returnValue QProblem_setupSubjectToTypeNew(QProblem *_THIS, const real_t *const lb_new, const real_t *const ub_new, const real_t *const lbA_new, const real_t *const ubA_new)
Definition: QProblem.c:2769
static HessianType QProblem_getHessianType(QProblem *_THIS)
Definition: QProblem.h:1778
DenseMatrix * H
Definition: QProblem.h:65
real_t QProblemBCPY_getRelativeHomotopyLength(QProblem *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new)
Definition: QProblem.c:2183
real_t ub[NVMAX]
Definition: QProblem.h:70
real_t lb[NVMAX]
Definition: QProblem.h:69
returnValue QProblem_reset(QProblem *_THIS)
Definition: QProblem.c:202
static PrintLevel QProblem_getPrintLevel(QProblem *_THIS)
Definition: QProblem.h:1834
#define BT_FALSE
Definition: acado_types.hpp:49
static returnValue Constraints_setType(Constraints *_THIS, int i, SubjectToType value)
Definition: Constraints.h:377
returnValue QProblem_setupAuxiliaryWorkingSet(QProblem *_THIS, Bounds *const auxiliaryBounds, Constraints *const auxiliaryConstraints, BooleanType setupAfresh)
Definition: QProblem.c:3192
returnValue QProblem_performRamping(QProblem *_THIS)
Definition: QProblem.c:6296
Manages working sets of bounds (= box constraints).
static int Constraints_getNIAC(Constraints *_THIS)
Definition: Constraints.h:489
returnValue QProblem_setupSubjectToType(QProblem *_THIS)
Definition: QProblem.c:2760
returnValue QProblem_printIteration(QProblem *_THIS, int iter, int BC_idx, SubjectToStatus BC_status, BooleanType BC_isBound, real_t homotopyLength, BooleanType isFirstCall)
Definition: QProblem.c:6844
returnValue QProblem_updateFarBounds(QProblem *_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, const real_t *const lbA_new, real_t *const lbA_new_far, const real_t *const ubA_new, real_t *const ubA_new_far)
Definition: QProblem.c:6185
returnValue DenseMatrix_times(DenseMatrix *_THIS, int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD)
Definition: Matrices.c:196
double real_t
Definition: AD_test.c:10
returnValue QProblem_computeProjectedCholesky(QProblem *_THIS)
Definition: QProblem.c:2917
BooleanType haveCholesky
Definition: QProblem.h:75
static BooleanType QProblem_usingRegularisation(QProblem *_THIS)
Definition: QProblem.h:1797
static returnValue QProblem_setLBn(QProblem *_THIS, int number, real_t value)
Definition: QProblem.h:1950
returnValue QProblem_determineStepDirection(QProblem *_THIS, const real_t *const delta_g, const real_t *const delta_lbA, const real_t *const delta_ubA, const real_t *const delta_lb, const real_t *const delta_ub, BooleanType Delta_bC_isZero, BooleanType Delta_bB_isZero, real_t *const delta_xFX, real_t *const delta_xFR, real_t *const delta_yAC, real_t *const delta_yFX)
Definition: QProblem.c:5397
Implements the online active set strategy for QPs with general constraints.
static returnValue QProblem_setUB(QProblem *_THIS, const real_t *const ub_new)
Definition: QProblem.h:1972
returnValue QProblem_initFW(QProblem *_THIS, const char *const H_file, const char *const g_file, const char *const A_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Constraints *const guessedConstraints, const char *const R_file)
Definition: QProblem.c:472
void QProblemCON(QProblem *_THIS, int _nV, int _nC, HessianType _hessianType)
Definition: QProblem.c:51
BooleanType QProblem_shallRefactorise(QProblem *_THIS, Bounds *const guessedBounds, Constraints *const guessedConstraints)
Definition: QProblem.c:6617
returnValue QProblem_determineHessianType(QProblem *_THIS)
Definition: QProblem.c:1421
static returnValue QProblem_setUBAn(QProblem *_THIS, int number, real_t value)
Definition: QProblem.h:2223
returnValue QProblem_performRatioTestC(QProblem *_THIS, int nIdx, const int *const idxList, Constraints *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: QProblem.c:6379
static returnValue QProblem_setA(QProblem *_THIS, real_t *const A_new)
Definition: QProblem.h:2115
static returnValue QProblem_getBounds(QProblem *_THIS, Bounds *_bounds)
Definition: QProblem.h:1675
#define R
BooleanType unbounded
Definition: QProblem.h:85
static returnValue QProblem_setOptions(QProblem *_THIS, Options _options)
Definition: QProblem.h:1818
static int QProblem_getNEC(QProblem *_THIS)
Definition: QProblem.h:2070
returnValue QProblem_printOptions(QProblem *_THIS)
Definition: QProblem.c:1240
returnValue QProblem_hotstartFW(QProblem *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, int *nWSR, real_t *const cputime, Bounds *const guessedBounds, Constraints *const guessedConstraints)
Definition: QProblem.c:864
returnValue QProblem_backsolveT(QProblem *_THIS, const real_t *const b, BooleanType transposed, real_t *const a)
Definition: QProblem.c:5280
static int Constraints_getNAC(Constraints *_THIS)
Definition: Constraints.h:480
returnValue QProblem_setupAuxiliaryQPsolution(QProblem *_THIS, const real_t *const xOpt, const real_t *const yOpt)
Definition: QProblem.c:3386
returnValue QProblem_getWorkingSetBounds(QProblem *_THIS, real_t *workingSetB)
Definition: QProblem.c:1001
static BooleanType QProblem_isUnbounded(QProblem *_THIS)
Definition: QProblem.h:1769
returnValue QProblem_solveRegularisedQP(QProblem *_THIS, 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, int nWSRperformed, BooleanType isFirstCall)
Definition: QProblem.c:2655


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