36 #include <qpOASES/QProblemB.hpp> 118 for( i=0; i<_nV; ++i )
g[i] = 0.0;
121 for( i=0; i<_nV; ++i )
lb[i] = 0.0;
124 for( i=0; i<_nV; ++i )
ub[i] = 0.0;
129 for( i=0; i<_nV*_nV; ++i )
R[i] = 0.0;
133 for( i=0; i<_nV; ++i )
x[i] = 0.0;
136 for( i=0; i<_nV; ++i )
y[i] = 0.0;
217 for( i=0; i<nV*nV; ++i )
251 const Bounds*
const guessedBounds,
268 if ( guessedBounds != 0 )
270 for( i=0; i<nV; ++i )
278 if ( ( xOpt == 0 ) && ( yOpt != 0 ) && ( guessedBounds != 0 ) )
281 if ( ( _R != 0 ) && ( ( xOpt != 0 ) || ( yOpt != 0 ) || ( guessedBounds != 0 ) ) )
289 return solveInitialQP( xOpt,yOpt,guessedBounds,_R, nWSR,cputime );
300 const Bounds*
const guessedBounds,
317 if ( guessedBounds != 0 )
319 for( i=0; i<nV; ++i )
327 if ( ( xOpt == 0 ) && ( yOpt != 0 ) && ( guessedBounds != 0 ) )
330 if ( ( _R != 0 ) && ( ( xOpt != 0 ) || ( yOpt != 0 ) || ( guessedBounds != 0 ) ) )
338 return solveInitialQP( xOpt,yOpt,guessedBounds,_R, nWSR,cputime );
346 const char*
const lb_file,
const char*
const ub_file,
349 const Bounds*
const guessedBounds,
350 const char*
const R_file
366 if ( guessedBounds != 0 )
368 for( i=0; i<nV; ++i )
376 if ( ( xOpt == 0 ) && ( yOpt != 0 ) && ( guessedBounds != 0 ) )
379 if ( ( R_file != 0 ) && ( ( xOpt != 0 ) || ( yOpt != 0 ) || ( guessedBounds != 0 ) ) )
411 const Bounds*
const guessedBounds
424 if ( guessedBounds != 0 )
453 int_t nWSR_performed = 0;
456 real_t cputime_needed = 0.0;
484 for (i = 0; i < nV; i++)
485 if ((ub_new[i] <
INFTY) && (ub_new[i] > farbound)) farbound = ub_new[i];
487 for (i = 0; i < nV; i++)
488 if ((lb_new[i] > -
INFTY) && (lb_new[i] < -farbound)) farbound = -lb_new[i];
491 lb_new,lb_new_far, ub_new,ub_new_far
498 cputime_remaining = *cputime - cputime_needed;
502 nWSR,&cputime_remaining,nWSR_performed,
506 nWSR_performed =
nWSR;
507 cputime_needed += cputime_remaining;
516 if ( farbound >=
INFTY )
523 lb_new,lb_new_far, ub_new,ub_new_far
530 for ( i=0; i<nV; ++i )
532 if ( ( ( lb_new == 0 ) || ( lb_new_far[i] > lb_new[i] ) ) && (
getAbs ( lb_new_far[i] -
x[i] ) < tol ) )
534 if ( ( ( ub_new == 0 ) || ( ub_new_far[i] < ub_new[i] ) ) && (
getAbs ( ub_new_far[i] -
x[i] ) < tol ) )
538 if ( nActiveFar == 0 )
543 if ( farbound >=
INFTY )
551 lb_new,lb_new_far, ub_new,ub_new_far
567 *cputime = cputime_needed + auxTime;
568 delete[] lb_new_far;
delete[] ub_new_far;
579 const char*
const lb_file,
const char*
const ub_file,
581 const Bounds*
const guessedBounds
618 returnvalue =
hotstart( g_new,lb_new,ub_new,
652 if ( workingSetB == 0 )
655 for ( i=0; i<nV; ++i )
659 case ST_LOWER: workingSetB[i] = -1.0;
break;
660 case ST_UPPER: workingSetB[i] = +1.0;
break;
661 default: workingSetB[i] = 0.0;
break;
674 if ( workingSetC == 0 )
728 for( i=0; i<nV; ++i )
729 objVal += _x[i]*
g[i];
737 for( i=0; i<nV; ++i )
738 objVal += 0.5*_x[i]*_x[i];
743 H->times(1, 1.0, _x, nV, 0.0, Hx, nV);
744 for( i=0; i<nV; ++i )
745 objVal += 0.5*_x[i]*Hx[i];
757 for( i=0; i<nV; ++i )
758 objVal += 0.5*_x[i]*
regVal*_x[i];
778 for( i=0; i<
getNV( ); ++i )
797 for( i=0; i<
getNV( ); ++i )
820 #ifndef __SUPPRESSANYOUTPUT__ 869 #ifndef __SUPPRESSANYOUTPUT__ 877 myPrintf(
"\n################# qpOASES -- QP PROPERTIES #################\n" );
885 myPrintf(
"Variables are not bounded from below.\n" );
887 myPrintf(
"Variables are bounded from below.\n" );
890 myPrintf(
"Variables are not bounded from above.\n" );
892 myPrintf(
"Variables are bounded from above.\n" );
901 myPrintf(
"Hessian is zero matrix (i.e. actually an LP is solved).\n" );
905 myPrintf(
"Hessian is identity matrix.\n" );
909 myPrintf(
"Hessian matrix is (strictly) positive definite.\n" );
913 myPrintf(
"Hessian matrix is positive definite on null space of active constraints.\n" );
917 myPrintf(
"Hessian matrix is positive semi-definite.\n" );
921 myPrintf(
"Hessian matrix is indefinite.\n" );
925 myPrintf(
"Hessian matrix has unknown type.\n" );
930 myPrintf(
"QP was found to be infeasible.\n" );
932 myPrintf(
"QP seems to be feasible.\n" );
935 myPrintf(
"QP was found to be unbounded from below.\n" );
937 myPrintf(
"QP seems to be bounded from below.\n" );
946 myPrintf(
"Status of QP object: freshly instantiated or reset.\n" );
950 myPrintf(
"Status of QP object: an auxiliary QP is currently setup.\n" );
954 myPrintf(
"Status of QP object: an auxilary QP was solved.\n" );
958 myPrintf(
"Status of QP object: a homotopy step is performed.\n" );
962 myPrintf(
"Status of QP object: an intermediate QP along the homotopy path was solved.\n" );
966 myPrintf(
"Status of QP object: solution of the actual QP was found.\n" );
973 myPrintf(
"Print level of QP object is set to display a tabular output for debugging.\n" );
977 myPrintf(
"Print level of QP object is set to display a tabular output.\n" );
981 myPrintf(
"Print level of QP object is low, i.e. only error are printed.\n" );
985 myPrintf(
"Print level of QP object is medium, i.e. error and warnings are printed.\n" );
989 myPrintf(
"Print level of QP object is high, i.e. all available output is printed.\n" );
1116 memcpy(
R,rhs.
R,_nV*_nV*
sizeof(
real_t) );
1126 memcpy(
x,rhs.
x,_nV*
sizeof(
real_t) );
1134 memcpy(
y,rhs.
y,_nV*
sizeof(
real_t) );
1231 for ( i=0; i<nV; ++i )
1233 curDiag =
H->diag(i);
1234 if ( curDiag >=
INFTY )
1237 if ( curDiag < -
ZERO )
1294 for( i=0; i<nV; ++i )
1296 if ( lb_new[i] > -
INFTY )
1308 for( i=0; i<nV; ++i )
1310 if ( ub_new[i] <
INFTY )
1319 if ( ( lb_new != 0 ) && ( ub_new != 0 ) )
1321 for( i=0; i<nV; ++i )
1341 if ( ( lb_new == 0 ) && ( ub_new == 0 ) )
1343 for( i=0; i<nV; ++i )
1348 for( i=0; i<nV; ++i )
1367 for( i=0; i<nV*nV; ++i )
1379 for( i=0; i<nV; ++i )
1392 for( i=0; i<nV; ++i )
1405 for ( j=0; j < nFR; ++j )
1410 unsigned long _nFR = (
unsigned long)nFR, _nV = (
unsigned long)nV;
1412 POTRF(
"U", &_nFR,
R, &_nV, &info );
1428 for ( i=0; i<nFR-1; ++i )
1474 const Bounds*
const guessedBounds,
Bounds* auxiliaryBounds
1482 if ( ( auxiliaryBounds == 0 ) || ( auxiliaryBounds == guessedBounds ) )
1487 if ( guessedBounds != 0 )
1491 for( i=0; i<nV; ++i )
1493 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1509 if ( ( xOpt != 0 ) && ( yOpt == 0 ) )
1512 for( i=0; i<nV; ++i )
1529 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1544 if ( ( xOpt == 0 ) && ( yOpt != 0 ) )
1547 for( i=0; i<nV; ++i )
1549 if ( yOpt[i] >
EPS )
1556 if ( yOpt[i] < -
EPS )
1564 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1582 if ( ( xOpt == 0 ) && ( yOpt == 0 ) )
1584 for( i=0; i<nV; ++i )
1594 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1641 if ( removingBound ==
BT_TRUE )
1653 for( i=(nR-1); i>=0; --i )
1656 for( j=(i+1); j<nR; ++j )
1657 sum -=
RR(i,j) * a[j];
1660 a[i] = sum /
RR(i,i);
1668 for( i=0; i<nR; ++i )
1671 for( j=0; j<i; ++j )
1672 sum -=
RR(j,i) * a[j];
1675 a[i] = sum /
RR(i,i);
1702 for( i=0; i<nV; ++i )
1703 delta_g[i] = g_new[i] -
g[i];
1707 for( i=0; i<nV; ++i )
1708 delta_lb[i] = lb_new[i] -
lb[i];
1713 for( i=0; i<nV; ++i )
1719 for( i=0; i<nV; ++i )
1720 delta_ub[i] = ub_new[i] -
ub[i];
1725 for( i=0; i<nV; ++i )
1732 for ( i=0; i<nFX; ++i )
1800 const char*
const lb_file,
const char*
const ub_file
1846 for( i=0; i<nV; ++i )
1860 for( i=0; i<nV; ++i )
1881 if ( ( g_file != 0 ) && ( g_new != 0 ) )
1950 if (lb_new && ub_new) {
1952 if (lb_new[i] > ub_new[i]+
EPS) {
1979 real_t timePerIteration = elapsedTime / ((
real_t) nWSR);
1983 if ( ( elapsedTime + timePerIteration*1.25 ) <= ( *cputime ) )
2038 for(
int_t ii=0; ii<n; ++ii )
2040 M_val[ii] = diagVal;
2060 const int_t*
const idxList,
2074 for( i=0; i<nIdx; ++i )
2084 t = num[i] / den[i];
2093 t = num[i] / den[i];
2115 for (i = 0; i < nV; i++)
2118 if (s < 1.0) s = 1.0;
2119 d =
getAbs(g_new[i] -
g[i]) / s;
2120 if (d > len) len = d;
2127 for (i = 0; i < nV; i++)
2130 if (s < 1.0) s = 1.0;
2132 if (d > len) len = d;
2140 for (i = 0; i < nV; i++)
2143 if (s < 1.0) s = 1.0;
2145 if (d > len) len = d;
2163 for (i = 0; i < nV; i++)
2176 if (bstat !=
ST_LOWER) {
lb[i] =
x[i] - rampVal; }
2177 if (bstat !=
ST_UPPER) {
ub[i] =
x[i] + rampVal; }
2178 if (bstat ==
ST_LOWER) {
lb[i] =
x[i];
y[i] = +rampVal; }
2179 if (bstat ==
ST_UPPER) {
ub[i] =
x[i];
y[i] = -rampVal; }
2207 for ( i=0; i<nV; ++i )
2210 rampVal = curFarBound * (1.0 + (1.0-t)*
ramp0 + t*
ramp1);
2213 lb_new_far[i] = -rampVal;
2215 lb_new_far[i] =
getMax( -rampVal,lb_new[i] );
2218 ub_new_far[i] = rampVal;
2220 ub_new_far[i] =
getMin( rampVal,ub_new[i] );
2225 for ( i=0; i<nV; ++i )
2228 lb_new_far[i] = -curFarBound;
2230 lb_new_far[i] =
getMax( -curFarBound,lb_new[i] );
2233 ub_new_far[i] = curFarBound;
2235 ub_new_far[i] =
getMin( curFarBound,ub_new[i] );
2254 const Bounds*
const guessedBounds,
2293 Bounds auxiliaryBounds( nV );
2325 else if ( ( xOpt == 0 ) && ( yOpt == 0 ) && ( guessedBounds == 0 ) )
2327 for( i=0; i<nV; ++i )
2328 for( j=i; j<nV; ++j )
2329 RR(i,j) = _R[i*nV+j];
2340 for( i=0; i<nV; ++i )
2342 g_original[i] =
g[i];
2343 lb_original[i] =
lb[i];
2344 ub_original[i] =
ub[i];
2351 delete[] ub_original;
delete[] lb_original;
delete[] g_original;
2357 delete[] ub_original;
delete[] lb_original;
delete[] g_original;
2374 delete[] ub_original;
delete[] lb_original;
delete[] g_original;
2402 const real_t*
const lb_new,
const real_t*
const ub_new,
2443 #ifndef __SUPPRESSANYOUTPUT__ 2458 for( iter=nWSRperformed; iter<
nWSR; ++iter )
2475 #ifndef __SUPPRESSANYOUTPUT__ 2485 delta_g,delta_lb,delta_ub,
2491 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2505 delta_xFX,delta_xFR,delta_yFX
2510 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2524 returnvalue =
performStep( delta_g,delta_lb,delta_ub,
2525 delta_xFX,delta_xFR,delta_yFX,
2531 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2558 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2569 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2599 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2620 delete[] delta_ub;
delete[] delta_lb;
delete[] delta_g;
2631 #ifndef __SUPPRESSANYOUTPUT__ 2649 const real_t*
const lb_new,
const real_t*
const ub_new,
2660 return solveQP( g_new,lb_new,ub_new, nWSR,cputime,nWSRperformed,isFirstCall );
2667 int_t nWSR_total = nWSRperformed;
2669 real_t cputime_total = 0.0;
2670 real_t cputime_cur = 0.0;
2674 returnvalue =
solveQP( g_new,lb_new,ub_new, nWSR,0,nWSRperformed,isFirstCall );
2678 cputime_cur = *cputime;
2679 returnvalue =
solveQP( g_new,lb_new,ub_new, nWSR,&cputime_cur,nWSRperformed,isFirstCall );
2682 cputime_total += cputime_cur;
2690 *cputime = cputime_total;
2706 for( i=0; i<nV; ++i )
2707 gMod[i] = g_new[i] -
regVal*
x[i];
2715 returnvalue =
solveQP( gMod,lb_new,ub_new, nWSR,0,nWSR_total,isFirstCall );
2720 cputime_cur = *cputime - cputime_total;
2721 returnvalue =
solveQP( gMod,lb_new,ub_new, nWSR,&cputime_cur,nWSR_total,isFirstCall );
2725 cputime_total += cputime_cur;
2733 *cputime = cputime_total;
2742 for( i=0; i<nV; ++i )
2748 *cputime = cputime_total;
2765 if ( auxiliaryBounds != 0 )
2767 for( i=0; i<nV; ++i )
2792 for( i=0; i<nV; ++i )
2808 for( i=0; i<nV; ++i )
2837 for( i=0; i<nV; ++i )
2842 for( i=0; i<nV; ++i )
2849 for( i=0; i<nV; ++i )
2854 for( i=0; i<nV; ++i )
2875 for ( i=0; i<nV; ++i )
2878 for ( i=0; i<nV; ++i )
2883 for ( i=0; i<nV; ++i )
2889 for ( i=0; i<nV; ++i )
2893 H->times(1, -1.0,
x, nV, 1.0,
g, nV);
2912 for ( i=0; i<nV; ++i )
2917 if ( useRelaxation ==
BT_TRUE )
2940 if ( useRelaxation ==
BT_TRUE )
2953 if ( useRelaxation ==
BT_TRUE )
2979 if ( guessedBounds == &
bounds )
3017 for ( i=0; i<nV; ++i )
3062 for( i=0; i<nFX; ++i )
3067 delta_xFX[i] = delta_lb[ii];
3069 delta_xFX[i] = delta_ub[ii];
3074 for( i=0; i<nFX; ++i )
3081 for ( i=0; i<nFR; ++i )
3110 for ( i=0; i<nFR; ++i )
3119 for ( i=0; i<nFR; ++i )
3131 for ( i=0; i<nFR; ++i )
3146 for ( i=0; i<nFR; ++i )
3165 for( i=0; i<nFX; ++i )
3169 delta_yFX[i] = delta_g[ii];
3175 delta_yFX[i] +=
regVal*delta_xFX[i];
3178 delta_yFX[i] += delta_xFX[i];
3183 for( i=0; i<nFX; ++i )
3187 delta_yFX[i] = delta_g[ii];
3203 const real_t*
const delta_lb,
const real_t*
const delta_ub,
3204 const real_t*
const delta_xFX,
3205 const real_t*
const delta_xFR,
3206 const real_t*
const delta_yFX,
3225 int_t BC_idx_tmp = -1;
3233 for( i=0; i<nFX; ++i )
3237 den[i] = -delta_yFX[i];
3242 if ( BC_idx_tmp >= 0 )
3244 BC_idx = BC_idx_tmp;
3254 for( i=0; i<nFR; ++i )
3258 den[i] = delta_lb[ii] - delta_xFR[i];
3263 if ( BC_idx_tmp >= 0 )
3265 BC_idx = BC_idx_tmp;
3273 for( i=0; i<nFR; ++i )
3277 den[i] = delta_xFR[i] - delta_ub[ii];
3282 if ( BC_idx_tmp >= 0 )
3284 BC_idx = BC_idx_tmp;
3293 #ifndef __SUPPRESSANYOUTPUT__ 3299 snprintf( messageString,
MAX_STRING_LENGTH,
"Stepsize is %.15e! (idx = %d, status = %d)",
tau,(
int)BC_idx,(
int)BC_status );
3309 for( i=0; i<nFR; ++i )
3312 x[ii] +=
tau*delta_xFR[i];
3315 for( i=0; i<nFX; ++i )
3318 x[ii] +=
tau*delta_xFX[i];
3319 y[ii] +=
tau*delta_yFX[i];
3323 for( i=0; i<nV; ++i )
3325 g[i] +=
tau*delta_g[i];
3326 lb[i] +=
tau*delta_lb[i];
3327 ub[i] +=
tau*delta_ub[i];
3333 #ifndef __SUPPRESSANYOUTPUT__ 3349 #ifndef __SUPPRESSANYOUTPUT__ 3354 switch ( BC_status )
3363 #ifndef __SUPPRESSANYOUTPUT__ 3377 #ifndef __SUPPRESSANYOUTPUT__ 3403 for ( i=0; i<nV; ++i )
3460 int_t differenceNumber = 0;
3462 for( i=0; i<nV; ++i )
3467 if ( 2*differenceNumber > guessedBounds->
getNFX( ) )
3507 if ( ( updateCholesky ==
BT_TRUE ) &&
3516 for( i=number_idx+1; i<nFR; ++i )
3521 for( j=(1+i); j<nFR; ++j )
3522 applyGivens( c,s,nu,
RR(i-1,j),
RR(i,j),
RR(i-1,j),
RR(i,j) );
3526 for( i=0; i<nFR-1; ++i )
3527 for( j=number_idx+1; j<nFR; ++j )
3528 RR(i,j-1) =
RR(i,j);
3530 for( i=0; i<nFR; ++i )
3580 if ( ( updateCholesky ==
BT_TRUE ) &&
3598 for( i=0; i<nFR; ++i )
3604 for( i=0; i<nFR; ++i )
3610 r0 =
H->diag(number);
3616 delete[]
rhs;
delete[] r;
3620 for( i=0; i<nFR; ++i )
3624 for( i=0; i<nFR; ++i )
3653 delete[]
rhs;
delete[] r;
3660 delete[]
rhs;
delete[] r;
3690 #ifndef __SUPPRESSANYOUTPUT__ 3698 real_t stat, bfeas, bcmpl;
3703 const char excStr[] =
" ef";
3709 stat = bfeas = bcmpl = 0.0;
3712 for (i = 0; i < nV; i++) grad[i] =
g[i] -
y[i];
3713 H->times(1, 1.0,
x, nV, 1.0, grad, nV);
3714 for (i = 0; i < nV; i++) if (getAbs(grad[i]) > stat) stat =
getAbs(grad[i]);
3717 for (i = 0; i < nV; i++)
if (
lb[i] -
x[i] > bfeas) bfeas =
lb[i] -
x[i];
3718 for (i = 0; i < nV; i++)
if (x[i] -
ub[i] > bfeas) bfeas = x[i] -
ub[i];
3721 for (i = 0; i < nV; i++) if (y[i] > +
EPS &&
getAbs((
lb[i] - x[i])*
y[i]) > bcmpl) bcmpl =
getAbs((
lb[i] - x[i])*
y[i]);
3722 for (i = 0; i < nV; i++)
if (
y[i] < -
EPS &&
getAbs((ub[i] - x[i])*
y[i]) > bcmpl) bcmpl =
getAbs((ub[i] - x[i])*
y[i]);
3724 if ( (iter % 10 == 0) && ( isFirstCall ==
BT_TRUE ) )
3726 snprintf( myPrintfString,
MAX_STRING_LENGTH,
"\n%5s %4s %4s %9s %9s %9s %9s %9s\n",
3727 "iter",
"addB",
"remB",
"hom len",
"tau",
"stat",
"bfeas",
"bcmpl");
3755 homotopyLength,
tau, stat, bfeas, bcmpl);
3762 if ( (iter % 10 == 0) && ( isFirstCall ==
BT_TRUE ) )
3765 "iter",
"addB",
"remB",
"hom len",
"tau");
3798 if ( ( iter == 0 ) && ( isFirstCall ==
BT_TRUE ) )
3800 snprintf( myPrintfString,
MAX_STRING_LENGTH,
"\n\n################# qpOASES -- QP NO. %3.0d ##################\n\n",(
int)
count );
3803 myPrintf(
" Iter | StepLength | Info | nFX \n" );
3804 myPrintf(
" ----------+------------------+------------------+--------- \n" );
3811 snprintf( info,3,
"LP" );
3813 snprintf( info,3,
"QP" );
3824 snprintf( info,8,
"REM BND" );
3826 snprintf( info,8,
"ADD BND" );
3828 snprintf( myPrintfString,
MAX_STRING_LENGTH,
" %5.1d | %1.6e | %s %4.1d | %4.1d \n", (
int)iter,
tau,info,(
int)BC_idx,(
int)
getNFX( ) );
returnValue getPrimalSolution(real_t *const xOpt) const
real_t getRelativeHomotopyLength(const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new)
void setNoLower(BooleanType _status)
returnValue setType(int i, SubjectToType value)
Interfaces matrix-vector operations tailored to symmetric sparse matrices.
BooleanType isInfeasible() const
returnValue copy(const QProblemB &rhs)
TabularOutput tabularOutput
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
returnValue updateFarBounds(real_t curFarBound, int_t 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
#define THROWINFO(retval)
returnValue obtainAuxiliaryWorkingSet(const real_t *const xOpt, const real_t *const yOpt, const Bounds *const guessedBounds, Bounds *auxiliaryBounds) const
#define ST_INFEASIBLE_UPPER
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
virtual returnValue getWorkingSet(real_t *workingSet)
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)
#define ST_INFEASIBLE_LOWER
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)
SymSparseMat * createDiagSparseMat(int_t n, real_t diagVal=1.0)
BooleanType enableFlippingBounds
returnValue setupBound(int _number, SubjectToStatus _status)
returnValue changeActiveSet(int BC_idx, SubjectToStatus BC_status)
BooleanType usingRegularisation() const
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
virtual returnValue getWorkingSetConstraints(real_t *workingSetC)
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)
BooleanType areBoundsConsistent(const real_t *const delta_lb, const real_t *const delta_ub) const
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)
virtual returnValue computeCholesky()
returnValue regulariseHessian()
BooleanType enableRegularisation
returnValue setupAuxiliaryQPbounds(BooleanType useRelaxation)
void rhs(const real_t *x, real_t *f)
#define END_NAMESPACE_QPOASES
virtual returnValue getWorkingSetBounds(real_t *workingSetB)
SubjectToType getType(int i) const
#define HST_POSDEF_NULLSPACE
returnValue setupAuxiliaryQP(const Bounds *const guessedBounds)
BooleanType isInitialised() const
QProblemStatus getStatus() const
real_t terminationTolerance
const uint_t MAX_STRING_LENGTH
int numRegularisationSteps
real_t getNorm(const real_t *const v, int n)
returnValue setUB(const real_t *const ub_new)
#define THROWWARNING(retval)
void setErrorVisibilityStatus(VisibilityStatus _errorVisibility)
int enableCholeskyRefactorisation
virtual returnValue setupInitialCholesky()
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...