36 #include <qpOASES/QProblemB.hpp> 202 for( i=0; i<nV*nV; ++i )
283 const char*
const lb_file,
const char*
const ub_file,
313 const Bounds*
const guessedBounds
329 if ( guessedBounds != 0 )
331 for( i=0; i<nV; ++i )
339 if ( ( xOpt == 0 ) && ( yOpt != 0 ) && ( guessedBounds != 0 ) )
358 const Bounds*
const guessedBounds
374 if ( guessedBounds != 0 )
376 for( i=0; i<nV; ++i )
384 if ( ( xOpt == 0 ) && ( yOpt != 0 ) && ( guessedBounds != 0 ) )
400 const char*
const lb_file,
const char*
const ub_file,
403 const Bounds*
const guessedBounds
419 for( i=0; i<nV; ++i )
426 if ( ( xOpt == 0 ) && ( yOpt != 0 ) && ( guessedBounds != 0 ) )
456 int nWSR_performed = 0;
459 real_t cputime_needed = 0.0;
476 returnvalue =
solveQP( g_new,lb_new,ub_new, nWSR,cputime,0 );
485 for (i = 0; i < nV; i++)
486 if (ub_new[i] <
INFTY && ub_new[i] > farbound) farbound = ub_new[i];
488 for (i = 0; i < nV; i++)
489 if (lb_new[i] > -
INFTY && lb_new[i] < -farbound) farbound = -lb_new[i];
494 for ( i=0; i<nV; ++i )
496 t =
static_cast<real_t>(i) / static_cast<real_t>(nV-1);
497 rampVal = farbound + (1.0-t) *
ramp0 + t *
ramp1;
499 if ( ( lb_new == 0 ) || ( lb_new[i] <= -rampVal ) )
500 lb_new_far[i] = - rampVal;
502 lb_new_far[i] = lb_new[i];
503 if ( ( ub_new == 0 ) || ( ub_new[i] >= rampVal ) )
504 ub_new_far[i] = rampVal;
506 ub_new_far[i] = ub_new[i];
511 for ( i=0; i<nV; ++i )
513 lb_new_far[i] = lb_new[i];
514 ub_new_far[i] = ub_new[i];
529 cputime_remaining = *cputime - cputime_needed;
532 returnvalue =
solveRegularisedQP( g_new,lb_new_far,ub_new_far, nWSR,&cputime_remaining,nWSR_performed );
534 returnvalue =
solveQP( g_new,lb_new_far,ub_new_far, nWSR,&cputime_remaining,nWSR_performed );
536 nWSR_performed =
nWSR;
537 cputime_needed += cputime_remaining;
543 real_t maxFarbound = 1e20;
546 if ( farbound > maxFarbound )
555 for ( i=0; i<nV; ++i )
557 t =
static_cast<real_t>(i) / static_cast<real_t>(nV-1);
558 rampVal = farbound + (1.0-t) *
ramp0 + t *
ramp1;
561 lb_new_far[i] = - rampVal;
563 lb_new_far[i] =
getMax (- rampVal, lb_new[i]);
566 ub_new_far[i] = rampVal;
568 ub_new_far[i] =
getMin (rampVal, ub_new[i]);
573 for ( i=0; i<nV; ++i )
575 lb_new_far[i] = lb_new[i];
576 ub_new_far[i] = ub_new[i];
586 for ( i=0; i<nV; ++i )
588 if ( ( ( lb_new == 0 ) || ( lb_new_far[i] > lb_new[i] ) ) && ( fabs ( lb_new_far[i] -
x[i] ) < tol ) )
590 if ( ( ( ub_new == 0 ) || ( ub_new_far[i] < ub_new[i] ) ) && ( fabs ( ub_new_far[i] -
x[i] ) < tol ) )
597 if ( farbound > maxFarbound )
607 for ( i=0; i<nV; ++i )
609 t =
static_cast<real_t>(i) / static_cast<real_t>(nV-1);
610 rampVal = farbound + (1.0-t) *
ramp0 + t *
ramp1;
613 lb_new_far[i] = - rampVal;
615 lb_new_far[i] =
getMax (- rampVal, lb_new[i]);
618 ub_new_far[i] = rampVal;
620 ub_new_far[i] =
getMin (rampVal, ub_new[i]);
625 for ( i=0; i<nV; ++i )
627 lb_new_far[i] = lb_new[i];
628 ub_new_far[i] = ub_new[i];
644 *cputime = cputime_needed;
645 delete[] lb_new_far;
delete[] ub_new_far;
656 const char*
const lb_file,
const char*
const ub_file,
657 int& nWSR,
real_t*
const cputime
697 returnvalue =
hotstart( g_new,lb_new,ub_new, nWSR,cputime );
715 int& nWSR,
real_t*
const cputime,
716 const Bounds*
const guessedBounds
732 if ( guessedBounds != 0 )
768 const char*
const lb_file,
const char*
const ub_file,
769 int& nWSR,
real_t*
const cputime,
770 const Bounds*
const guessedBounds
810 returnvalue =
hotstart( g_new,lb_new,ub_new, nWSR,cputime,
872 for( i=0; i<nV; ++i )
873 objVal += _x[i]*
g[i];
881 for( i=0; i<nV; ++i )
882 objVal += 0.5*_x[i]*_x[i];
887 H->times(1, 1.0, _x, nV, 0.0, Hx, nV);
888 for( i=0; i<nV; ++i )
889 objVal += 0.5*_x[i]*Hx[i];
901 for( i=0; i<nV; ++i )
922 for( i=0; i<
getNV( ); ++i )
947 for( i=0; i<
getNV( ); ++i )
982 #ifndef __XPCTARGET__ 990 #ifndef __XPCTARGET__ 998 #ifndef __XPCTARGET__ 1015 #ifndef __XPCTARGET__ 1021 char myPrintfString[80];
1023 myPrintf(
"\n################# qpOASES -- QP PROPERTIES #################\n" );
1027 snprintf( myPrintfString,80,
"Number of Variables: %4.1d\n",
getNV( ) );
1031 myPrintf(
"Variables are not bounded from below.\n" );
1033 myPrintf(
"Variables are bounded from below.\n" );
1036 myPrintf(
"Variables are not bounded from above.\n" );
1038 myPrintf(
"Variables are bounded from above.\n" );
1047 myPrintf(
"Hessian is zero matrix (i.e. actually an LP is solved).\n" );
1051 myPrintf(
"Hessian is identity matrix.\n" );
1055 myPrintf(
"Hessian matrix is (strictly) positive definite.\n" );
1059 myPrintf(
"Hessian matrix is positive definite on null space of active constraints.\n" );
1063 myPrintf(
"Hessian matrix is positive semi-definite.\n" );
1067 myPrintf(
"Hessian matrix has unknown type.\n" );
1072 myPrintf(
"QP was found to be infeasible.\n" );
1074 myPrintf(
"QP seems to be feasible.\n" );
1077 myPrintf(
"QP was found to be unbounded from below.\n" );
1079 myPrintf(
"QP seems to be bounded from below.\n" );
1088 myPrintf(
"Status of QP object: freshly instantiated or reset.\n" );
1092 myPrintf(
"Status of QP object: an auxiliary QP is currently setup.\n" );
1096 myPrintf(
"Status of QP object: an auxilary QP was solved.\n" );
1100 myPrintf(
"Status of QP object: a homotopy step is performed.\n" );
1104 myPrintf(
"Status of QP object: an intermediate QP along the homotopy path was solved.\n" );
1108 myPrintf(
"Status of QP object: solution of the actual QP was found.\n" );
1115 myPrintf(
"Print level of QP object is low, i.e. only error are printed.\n" );
1119 myPrintf(
"Print level of QP object is medium, i.e. error and warnings are printed.\n" );
1123 myPrintf(
"Print level of QP object is high, i.e. all available output is printed.\n" );
1212 int _nV = rhs.
getNV( );
1250 memcpy(
R,rhs.
R,_nV*_nV*
sizeof(
real_t) );
1260 memcpy(
x,rhs.
x,_nV*
sizeof(
real_t) );
1268 memcpy(
y,rhs.
y,_nV*
sizeof(
real_t) );
1331 for ( i=0; i<nV; ++i )
1333 if (
H->diag(i) < -
ZERO )
1336 if ( fabs(
H->diag(i) - 1.0 ) >
EPS )
1339 if ( fabs(
H->diag(i) ) >
EPS )
1375 for( i=0; i<nV; ++i )
1377 if ( lb_new[i] > -
INFTY )
1389 for( i=0; i<nV; ++i )
1391 if ( ub_new[i] <
INFTY )
1400 if ( ( lb_new != 0 ) && ( ub_new != 0 ) )
1402 for( i=0; i<nV; ++i )
1420 if ( ( lb_new == 0 ) && ( ub_new == 0 ) )
1422 for( i=0; i<nV; ++i )
1427 for( i=0; i<nV; ++i )
1446 for( i=0; i<nV*nV; ++i )
1459 for( i=0; i<nV; ++i )
1468 for( i=0; i<nV; ++i )
1480 for ( j=0; j < nFR; ++j )
1485 unsigned long _nFR = nFR, _nV = nV;
1487 POTRF (
"U", &_nFR,
R, &_nV, &info);
1496 for (i=0;i<nFR-1;++i)
1510 const Bounds*
const guessedBounds,
Bounds* auxiliaryBounds
1518 if ( ( auxiliaryBounds == 0 ) || ( auxiliaryBounds == guessedBounds ) )
1523 if ( guessedBounds != 0 )
1527 for( i=0; i<nV; ++i )
1529 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1545 if ( ( xOpt != 0 ) && ( yOpt == 0 ) )
1548 for( i=0; i<nV; ++i )
1565 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1580 if ( ( xOpt == 0 ) && ( yOpt != 0 ) )
1583 for( i=0; i<nV; ++i )
1585 if ( yOpt[i] >
EPS )
1592 if ( yOpt[i] < -
EPS )
1600 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1618 if ( ( xOpt == 0 ) && ( yOpt == 0 ) )
1620 for( i=0; i<nV; ++i )
1630 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1677 if ( removingBound ==
BT_TRUE )
1689 for( i=(nR-1); i>=0; --i )
1692 for( j=(i+1); j<nR; ++j )
1693 sum -=
RR(i,j) * a[j];
1695 if ( fabs(
RR(i,i) ) >=
ZERO*fabs( sum ) )
1696 a[i] = sum /
RR(i,i);
1704 for( i=0; i<nR; ++i )
1707 for( j=0; j<i; ++j )
1708 sum -=
RR(j,i) * a[j];
1710 if ( fabs(
RR(i,i) ) >=
ZERO*fabs( sum ) )
1711 a[i] = sum /
RR(i,i);
1738 for( i=0; i<nV; ++i )
1739 delta_g[i] = g_new[i] -
g[i];
1743 for( i=0; i<nV; ++i )
1744 delta_lb[i] = lb_new[i] -
lb[i];
1749 for( i=0; i<nV; ++i )
1755 for( i=0; i<nV; ++i )
1756 delta_ub[i] = ub_new[i] -
ub[i];
1761 for( i=0; i<nV; ++i )
1768 for ( i=0; i<nFX; ++i )
1772 if ( ( fabs( delta_lb[ii] ) >
EPS ) || ( fabs( delta_ub[ii] ) >
EPS ) )
1808 for( i=0; i<nV; ++i )
1816 for( i=0; i<nV; ++i )
1850 for( i=0; i<nV; ++i )
1862 for( i=0; i<nV; ++i )
1874 const char*
const lb_file,
const char*
const ub_file
1920 for( i=0; i<nV; ++i )
1934 for( i=0; i<nV; ++i )
1955 if ( ( g_file != 0 ) && ( g_new != 0 ) )
2035 real_t timePerIteration = elapsedTime / ((
real_t) nWSR);
2039 if ( ( elapsedTime + timePerIteration*1.25 ) <= ( *cputime ) )
2082 const int*
const idxList,
2096 for( i=0; i<nIdx; ++i )
2106 t = num[i] / den[i];
2114 t = num[i] / den[i];
2131 int nV =
getNV( ), i;
2135 for (i = 0; i < nV; i++)
2138 if (s < 1.0) s = 1.0;
2139 d = fabs(g_new[i] -
g[i]) / s;
2140 if (d > len) len = d;
2144 for (i = 0; i < nV &&
lb_new; i++)
2146 s = fabs(lb_new[i]);
2147 if (s < 1.0) s = 1.0;
2148 d = fabs(lb_new[i] -
lb[i]) / s;
2149 if (d > len) len = d;
2153 for (i = 0; i < nV &&
ub_new; i++)
2155 s = fabs(ub_new[i]);
2156 if (s < 1.0) s = 1.0;
2157 d = fabs(ub_new[i] -
ub[i]) / s;
2158 if (d > len) len = d;
2170 int nV =
getNV( ), bstat, i;
2174 for (i = 0; i < nV; i++)
2183 t =
static_cast<real_t>(i) / static_cast<real_t>(nV-1);
2186 if (bstat !=
ST_LOWER) {
lb[i] =
x[i] - rampVal; }
2187 if (bstat !=
ST_UPPER) {
ub[i] =
x[i] + rampVal; }
2188 if (bstat ==
ST_LOWER) {
lb[i] =
x[i];
y[i] = +rampVal; }
2189 if (bstat ==
ST_UPPER) {
ub[i] =
x[i];
y[i] = -rampVal; }
2212 const Bounds*
const guessedBounds,
2213 int& nWSR,
real_t*
const cputime
2250 Bounds auxiliaryBounds( nV );
2291 for( i=0; i<nV; ++i )
2293 g_original[i] =
g[i];
2294 lb_original[i] =
lb[i];
2295 ub_original[i] =
ub[i];
2302 delete[] ub_original;
delete[] lb_original;
delete[] g_original;
2308 delete[] ub_original;
delete[] lb_original;
delete[] g_original;
2325 delete[] ub_original;
delete[] lb_original;
delete[] g_original;
2353 const real_t*
const lb_new,
const real_t*
const ub_new,
2354 int& nWSR,
real_t*
const cputime,
int nWSRperformed
2393 char messageString[80];
2406 for( iter=nWSRperformed; iter<
nWSR; ++iter )
2420 #ifndef __XPCTARGET__ 2421 snprintf( messageString,80,
"%d ...",iter );
2427 delta_g,delta_lb,delta_ub,
2433 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2447 delta_xFX,delta_xFR,delta_yFX
2452 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2466 returnvalue =
performStep( delta_g,delta_lb,delta_ub,
2467 delta_xFX,delta_xFR,delta_yFX,
2473 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2500 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2512 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2551 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2562 #ifndef __XPCTARGET__ 2563 snprintf( messageString,80,
"(nWSR = %d)",iter );
2580 const real_t*
const lb_new,
const real_t*
const ub_new,
2581 int& nWSR,
real_t*
const cputime,
int nWSRperformed
2590 return solveQP( g_new,lb_new,ub_new, nWSR,cputime,nWSRperformed );
2596 int nWSR_max =
nWSR;
2597 int nWSR_total = nWSRperformed;
2599 real_t cputime_total = 0.0;
2600 real_t cputime_cur = 0.0;
2604 returnvalue =
solveQP( g_new,lb_new,ub_new, nWSR,0,nWSRperformed );
2608 cputime_cur = *cputime;
2609 returnvalue =
solveQP( g_new,lb_new,ub_new, nWSR,&cputime_cur,nWSRperformed );
2612 cputime_total += cputime_cur;
2619 *cputime = cputime_total;
2635 for( i=0; i<nV; ++i )
2644 returnvalue =
solveQP( gMod,lb_new,ub_new, nWSR,0,nWSR_total );
2649 cputime_cur = *cputime - cputime_total;
2650 returnvalue =
solveQP( gMod,lb_new,ub_new, nWSR,&cputime_cur,nWSR_total );
2654 cputime_total += cputime_cur;
2662 *cputime = cputime_total;
2674 *cputime = cputime_total;
2691 if ( auxiliaryBounds != 0 )
2693 for( i=0; i<nV; ++i )
2718 for( i=0; i<nV; ++i )
2734 for( i=0; i<nV; ++i )
2763 for( i=0; i<nV; ++i )
2768 for( i=0; i<nV; ++i )
2775 for( i=0; i<nV; ++i )
2780 for( i=0; i<nV; ++i )
2801 for ( i=0; i<nV; ++i )
2804 for ( i=0; i<nV; ++i )
2809 for ( i=0; i<nV; ++i )
2815 for ( i=0; i<nV; ++i )
2819 H->times(1, -1.0,
x, nV, 1.0,
g, nV);
2838 for ( i=0; i<nV; ++i )
2843 if ( useRelaxation ==
BT_TRUE )
2866 if ( useRelaxation ==
BT_TRUE )
2879 if ( useRelaxation ==
BT_TRUE )
2902 if ( guessedBounds == &
bounds )
2940 for ( i=0; i<nV; ++i )
2985 for( i=0; i<nFX; ++i )
2990 delta_xFX[i] = delta_lb[ii];
2992 delta_xFX[i] = delta_ub[ii];
2997 for( i=0; i<nFX; ++i )
3004 for ( i=0; i<nFR; ++i )
3033 for ( i=0; i<nFR; ++i )
3042 for ( i=0; i<nFR; ++i )
3054 for ( i=0; i<nFR; ++i )
3069 for ( i=0; i<nFR; ++i )
3088 for( i=0; i<nFX; ++i )
3092 delta_yFX[i] = delta_g[ii];
3101 delta_yFX[i] += delta_xFX[i];
3106 for( i=0; i<nFX; ++i )
3110 delta_yFX[i] = delta_g[ii];
3126 const real_t*
const delta_lb,
const real_t*
const delta_ub,
3148 int BC_idx_tmp = -1;
3156 for( i=0; i<nFX; ++i )
3160 den[i] = -delta_yFX[i];
3165 if ( BC_idx_tmp >= 0 )
3167 BC_idx = BC_idx_tmp;
3177 for( i=0; i<nFR; ++i )
3181 den[i] = delta_lb[ii] - delta_xFR[i];
3186 if ( BC_idx_tmp >= 0 )
3188 BC_idx = BC_idx_tmp;
3196 for( i=0; i<nFR; ++i )
3200 den[i] = delta_xFR[i] - delta_ub[ii];
3205 if ( BC_idx_tmp >= 0 )
3207 BC_idx = BC_idx_tmp;
3216 #ifndef __XPCTARGET__ 3217 char messageString[80];
3220 snprintf( messageString,80,
"Stepsize is %.10e!",
tau );
3222 snprintf( messageString,80,
"Stepsize is %.10e! (BC_idx = %d, BC_status = %d)",
tau,BC_idx,BC_status );
3232 for( i=0; i<nFR; ++i )
3235 x[ii] +=
tau*delta_xFR[i];
3238 for( i=0; i<nFX; ++i )
3241 x[ii] +=
tau*delta_xFX[i];
3242 y[ii] +=
tau*delta_yFX[i];
3246 for( i=0; i<nV; ++i )
3248 g[i] +=
tau*delta_g[i];
3249 lb[i] +=
tau*delta_lb[i];
3250 ub[i] +=
tau*delta_ub[i];
3256 #ifndef __XPCTARGET__ 3257 snprintf( messageString,80,
"Stepsize is %.6e",
tau );
3272 char messageString[80];
3275 switch ( BC_status )
3284 #ifndef __XPCTARGET__ 3285 snprintf( messageString,80,
"bound no. %d.", BC_idx );
3298 #ifndef __XPCTARGET__ 3300 snprintf( messageString,80,
"lower bound no. %d.", BC_idx );
3302 snprintf( messageString,80,
"upper bound no. %d.", BC_idx );
3324 for ( i=0; i<nV; ++i )
3380 int differenceNumber = 0;
3382 for( i=0; i<nV; ++i )
3387 if ( 2*differenceNumber > guessedBounds->
getNFX( ) )
3427 if ( ( updateCholesky ==
BT_TRUE ) &&
3436 for( i=number_idx+1; i<nFR; ++i )
3441 for( j=(1+i); j<nFR; ++j )
3442 applyGivens( c,s,nu,
RR(i-1,j),
RR(i,j),
RR(i-1,j),
RR(i,j) );
3446 for( i=0; i<nFR-1; ++i )
3447 for( j=number_idx+1; j<nFR; ++j )
3448 RR(i,j-1) =
RR(i,j);
3450 for( i=0; i<nFR; ++i )
3498 if ( ( updateCholesky ==
BT_TRUE ) &&
3516 for( i=0; i<nFR; ++i )
3522 for( i=0; i<nFR; ++i )
3528 r0 =
H->diag(number);
3534 delete[]
rhs;
delete[] r;
3538 for( i=0; i<nFR; ++i )
3542 for( i=0; i<nFR; ++i )
3548 RR(nFR,nFR) =
sqrt( r0 );
3568 RR(nFR,nFR) =
sqrt( r0 );
3571 delete[]
rhs;
delete[] r;
3578 delete[]
rhs;
delete[] r;
3592 #ifndef __XPCTARGET__ 3593 char myPrintfString[160];
3596 if ( iteration < 0 )
3605 if ( iteration == 0 )
3607 snprintf( myPrintfString,160,
"\n\n################# qpOASES -- QP NO. %3.0d ##################\n\n",
count );
3610 myPrintf(
" Iter | StepLength | Info | nFX \n" );
3611 myPrintf(
" ----------+------------------+------------------+--------- \n" );
3618 snprintf( myPrintfString,80,
" %5.1d | %1.6e | LP SOLVED | %4.1d \n", iteration,
tau,
getNFX( ) );
3620 snprintf( myPrintfString,80,
" %5.1d | %1.6e | QP SOLVED | %4.1d \n", iteration,
tau,
getNFX( ) );
3628 snprintf( info,8,
"REM BND" );
3630 snprintf( info,8,
"ADD BND" );
3632 snprintf( myPrintfString,80,
" %5.1d | %1.6e | %s %4.1d | %4.1d \n", iteration,
tau,info,BC_idx,
getNFX( ) );
returnValue getPrimalSolution(real_t *const xOpt) const
HessianType getHessianType() const
returnValue setupCholeskyDecomposition()
void setNoLower(BooleanType _status)
returnValue setType(int i, SubjectToType value)
IntermediateState sqrt(const Expression &arg)
BooleanType isInfeasible() const
returnValue copy(const QProblemB &rhs)
BooleanType isZero(real_t x, real_t TOL=ZERO)
Implements the online active set strategy for box-constrained QPs.
returnValue getNumberArray(int *const numberarray) const
BooleanType enableFarBounds
returnValue moveFixedToFree(int _number)
BooleanType isUnbounded() const
returnValue printOptions() const
returnValue flipFixed(int number)
void computeGivens(real_t xold, real_t yold, real_t &xnew, real_t &ynew, real_t &c, real_t &s) const
BEGIN_NAMESPACE_ACADO const double EPS
#define THROWINFO(retval)
returnValue obtainAuxiliaryWorkingSet(const real_t *const xOpt, const real_t *const yOpt, const Bounds *const guessedBounds, Bounds *auxiliaryBounds) const
BooleanType shallRefactorise(const Bounds *const guessedBounds) const
returnValue throwInfo(returnValue Inumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
Allows to pass back messages to the calling function.
returnValue determineHessianType()
returnValue solveRegularisedQP(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=0)
Base class for managing working sets of bounds and constraints.
returnValue determineStepDirection(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)
returnValue print() const
returnValue setupAuxiliaryWorkingSet(const Bounds *const auxiliaryBounds, BooleanType setupAfresh)
returnValue setH(const real_t *const H_new)
real_t getMin(real_t x, real_t y)
#define THROWERROR(retval)
returnValue setInfeasibilityFlag(returnValue returnvalue)
returnValue setupAuxiliaryQPsolution(const real_t *const xOpt, const real_t *const yOpt)
returnValue backsolveR(const real_t *const b, BooleanType transposed, real_t *const a)
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)
BooleanType enableEqualities
returnValue performDriftCorrection()
returnValue set(const Bounds *const _bounds, const double *const _R, const Constraints *const _constraints=0, const double *const _Q=0, const double *const _T=0)
BooleanType enableRamping
returnValue throwWarning(returnValue Wnumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
returnValue readFromFile(real_t *data, int nrow, int ncol, const char *datafilename)
returnValue setupAuxiliaryQPgradient()
returnValue myPrintf(const char *s)
BooleanType enableFlippingBounds
returnValue setupBound(int _number, SubjectToStatus _status)
returnValue changeActiveSet(int BC_idx, SubjectToStatus BC_status)
BooleanType usingRegularisation() const
real_t relativeHomotopyLength(const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new)
BooleanType isCPUtimeLimitExceeded(const real_t *const cputime, real_t starttime, int nWSR) const
SubjectToStatus getStatus(int i) const
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)
returnValue getDualSolution(real_t *const yOpt) const
returnValue performRatioTest(int nIdx, const int *const idxList, const SubjectTo *const subjectTo, const real_t *const num, const real_t *const den, real_t epsNum, real_t epsDen, real_t &t, int &BC_idx) const
BooleanType isBlocking(real_t num, real_t den, real_t epsNum, real_t epsDen, real_t &t) const
returnValue determineDataShift(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)
returnValue addBound(int number, SubjectToStatus B_status, BooleanType updateCholesky)
returnValue setupQPdata(const real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
returnValue setupSubjectToType()
returnValue setupAllFree()
void setInfoVisibilityStatus(VisibilityStatus _infoVisibility)
returnValue printIteration(int iteration, int BC_idx, SubjectToStatus BC_status)
returnValue performStep(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)
virtual returnValue performRamping()
int enableDriftCorrection
returnValue printCopyrightNotice()
returnValue setupQPdataFromFile(const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file)
returnValue regulariseHessian()
BooleanType enableRegularisation
returnValue setupAuxiliaryQPbounds(BooleanType useRelaxation)
BooleanType isRegularised
void rhs(const real_t *x, real_t *f)
#define END_NAMESPACE_QPOASES
SubjectToType getType(int i) const
#define HST_POSDEF_NULLSPACE
returnValue setupAuxiliaryQP(const Bounds *const guessedBounds)
BooleanType isInitialised() const
QProblemStatus getStatus() const
real_t terminationTolerance
int numRegularisationSteps
returnValue setUB(const real_t *const ub_new)
#define THROWWARNING(retval)
void setErrorVisibilityStatus(VisibilityStatus _errorVisibility)
returnValue setG(const real_t *const g_new)
returnValue removeBound(int number, BooleanType updateCholesky)
void setNoUpper(BooleanType _status)
QProblemB & operator=(const QProblemB &rhs)
returnValue solveQP(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=0)
int getIndex(int givennumber) const
virtual returnValue printProperties()
void setWarningVisibilityStatus(VisibilityStatus _warningVisibility)
BooleanType hasNoUpper() const
Manages working sets of bounds (= box constraints).
BooleanType hasNoLower() const
#define BEGIN_NAMESPACE_QPOASES
void applyGivens(real_t c, real_t s, real_t xold, real_t yold, real_t &xnew, real_t &ynew) const
returnValue init(int _nV=0, int _nC=0)
returnValue loadQPvectorsFromFile(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) const
MessageHandling * getGlobalMessageHandler()
returnValue solveInitialQP(const real_t *const xOpt, const real_t *const yOpt, const Bounds *const guessedBounds, int &nWSR, real_t *const cputime)
SubjectToStatus initialStatusBounds
returnValue setLB(const real_t *const lb_new)
returnValue get(Bounds *const _bounds, double *const R, Constraints *const _constraints=0, double *const _Q=0, double *const _T=0) const
returnValue moveFreeToFixed(int _number, SubjectToStatus _status)
returnValue setPrintLevel(PrintLevel _printlevel)
Abstract base class for interfacing matrix-vector operations tailored to symmetric matrices...