50 #ifdef __CODE_GENERATION__ 61 if ( ( _nV <= 0 ) || ( _nV >
NVMAX ) )
71 _THIS->
H = &(_THIS->
HH);
73 for( i=0; i<_nV; ++i ) _THIS->
g[i] = 0.0;
74 for( i=0; i<_nV; ++i ) _THIS->
lb[i] = 0.0;
75 for( i=0; i<_nV; ++i ) _THIS->
ub[i] = 0.0;
77 for( i=0; i<_nV; ++i ) _THIS->
x[i] = 0.0;
78 for( i=0; i<_nV; ++i ) _THIS->
y[i] = 0.0;
126 memcpy( TO->
x,FROM->
x,_nV*
sizeof(
real_t) );
127 memcpy( TO->
y,FROM->
y,_nV*
sizeof(
real_t) );
247 const char*
const lb_file,
const char*
const ub_file,
277 Bounds*
const guessedBounds,
294 if ( guessedBounds != 0 )
296 for( i=0; i<nV; ++i )
304 if ( ( xOpt == 0 ) && ( yOpt != 0 ) && ( guessedBounds != 0 ) )
307 if ( ( _R != 0 ) && ( ( xOpt != 0 ) || ( yOpt != 0 ) || ( guessedBounds != 0 ) ) )
326 Bounds*
const guessedBounds,
343 if ( guessedBounds != 0 )
345 for( i=0; i<nV; ++i )
353 if ( ( xOpt == 0 ) && ( yOpt != 0 ) && ( guessedBounds != 0 ) )
356 if ( ( _R != 0 ) && ( ( xOpt != 0 ) || ( yOpt != 0 ) || ( guessedBounds != 0 ) ) )
372 const char*
const lb_file,
const char*
const ub_file,
375 Bounds*
const guessedBounds,
376 const char*
const R_file
394 if ( guessedBounds != 0 )
396 for( i=0; i<nV; ++i )
404 if ( ( xOpt == 0 ) && ( yOpt != 0 ) && ( guessedBounds != 0 ) )
407 if ( ( R_file != 0 ) && ( ( xOpt != 0 ) || ( yOpt != 0 ) || ( guessedBounds != 0 ) ) )
480 int nWSR_max = *
nWSR;
481 int nWSR_performed = 0;
484 real_t cputime_needed = 0.0;
524 for (i = 0; i < nV; i++)
525 if ((ub_new[i] <
QPOASES_INFTY) && (ub_new[i] > farbound)) farbound = ub_new[i];
527 for (i = 0; i < nV; i++)
528 if ((lb_new[i] > -
QPOASES_INFTY) && (lb_new[i] < -farbound)) farbound = -lb_new[i];
531 lb_new,lb_new_far, ub_new,ub_new_far
538 cputime_remaining = *cputime - cputime_needed;
542 nWSR,&cputime_remaining,nWSR_performed,
546 nWSR_performed = *
nWSR;
547 cputime_needed += cputime_remaining;
563 lb_new,lb_new_far, ub_new,ub_new_far
571 for ( i=0; i<nV; ++i )
573 if ( ( ( lb_new == 0 ) || ( lb_new_far[i] > lb_new[i] ) ) && (
qpOASES_getAbs ( lb_new_far[i] - _THIS->
x[i] ) < tol ) )
575 if ( ( ( ub_new == 0 ) || ( ub_new_far[i] < ub_new[i] ) ) && (
qpOASES_getAbs ( ub_new_far[i] - _THIS->
x[i] ) < tol ) )
579 if ( nActiveFar == 0 )
590 lb_new,lb_new_far, ub_new,ub_new_far
605 *cputime = cputime_needed;
616 const char*
const lb_file,
const char*
const ub_file,
659 Bounds*
const guessedBounds
677 if ( guessedBounds != 0 )
710 const char*
const lb_file,
const char*
const ub_file,
712 Bounds*
const guessedBounds
769 for (i = 0; i < nV; i++) {
771 case ST_LOWER: workingSetB[i] = -1.0;
break;
772 case ST_UPPER: workingSetB[i] = +1.0;
break;
773 default: workingSetB[i] = 0.0;
break;
786 if ( workingSetC == 0 )
842 for( i=0; i<nV; ++i )
843 objVal += _x[i]*_THIS->
g[i];
851 for( i=0; i<nV; ++i )
852 objVal += 0.5*_x[i]*_x[i];
857 for( i=0; i<nV; ++i )
858 objVal += 0.5*_x[i]*Hx[i];
869 for( i=0; i<nV; ++i )
870 objVal += 0.5*_x[i]*_THIS->
regVal*_x[i];
891 xOpt[i] = _THIS->
x[i];
910 yOpt[i] = _THIS->
y[i];
932 #ifndef __SUPPRESSANYOUTPUT__ 983 #ifndef __SUPPRESSANYOUTPUT__ 991 qpOASES_myPrintf(
"\n################# qpOASES -- QP PROPERTIES #################\n" );
1015 qpOASES_myPrintf(
"Hessian is zero matrix (i.e. actually an LP is solved).\n" );
1027 qpOASES_myPrintf(
"Hessian matrix is positive definite on null space of active constraints.\n" );
1060 qpOASES_myPrintf(
"Status of QP object: freshly instantiated or reset.\n" );
1064 qpOASES_myPrintf(
"Status of QP object: an auxiliary QP is currently setup.\n" );
1072 qpOASES_myPrintf(
"Status of QP object: a homotopy step is performed.\n" );
1076 qpOASES_myPrintf(
"Status of QP object: an intermediate QP along the homotopy path was solved.\n" );
1080 qpOASES_myPrintf(
"Status of QP object: solution of the actual QP was found.\n" );
1087 qpOASES_myPrintf(
"Print level of QP object is set to display a tabular output for debugging.\n" );
1091 qpOASES_myPrintf(
"Print level of QP object is set to display a tabular output.\n" );
1095 qpOASES_myPrintf(
"Print level of QP object is low, i.e. only error are printed.\n" );
1099 qpOASES_myPrintf(
"Print level of QP object is medium, i.e. error and warnings are printed.\n" );
1103 qpOASES_myPrintf(
"Print level of QP object is high, i.e. all available output is printed.\n" );
1164 if ( _THIS->
H != 0 )
1173 if ( _THIS->
H == 0 )
1195 for ( i=0; i<nV; ++i )
1258 for( i=0; i<nV; ++i )
1272 for( i=0; i<nV; ++i )
1283 if ( ( lb_new != 0 ) && ( ub_new != 0 ) )
1285 for( i=0; i<nV; ++i )
1305 if ( ( lb_new == 0 ) && ( ub_new == 0 ) )
1307 for( i=0; i<nV; ++i )
1312 for( i=0; i<nV; ++i )
1333 unsigned long _nFR = (
unsigned long)nFR, _nV =
NVMAX;
1347 for( i=0; i<nV; ++i )
1358 for( i=0; i<nV; ++i )
1368 for ( j=0; j < nFR; ++j )
1372 POTRF(
"U", &_nFR, _THIS->
R, &_nV, &info );
1376 if ( _THIS->
R[0] < 0.0 )
1389 for (i=0;i<nFR-1;++i)
1412 if ( ( auxiliaryBounds == 0 ) || ( auxiliaryBounds == guessedBounds ) )
1417 if ( guessedBounds != 0 )
1421 for( i=0; i<nV; ++i )
1423 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1439 if ( ( xOpt != 0 ) && ( yOpt == 0 ) )
1442 for( i=0; i<nV; ++i )
1459 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1474 if ( ( xOpt == 0 ) && ( yOpt != 0 ) )
1477 for( i=0; i<nV; ++i )
1494 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1512 if ( ( xOpt == 0 ) && ( yOpt == 0 ) )
1514 for( i=0; i<nV; ++i )
1524 #ifdef __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__ 1570 if ( removingBound ==
BT_TRUE )
1582 for( i=(nR-1); i>=0; --i )
1585 for( j=(i+1); j<nR; ++j )
1586 sum -=
RR(i,j) * a[j];
1589 a[i] = sum /
RR(i,i);
1597 for( i=0; i<nR; ++i )
1600 for( j=0; j<i; ++j )
1601 sum -=
RR(j,i) * a[j];
1604 a[i] = sum /
RR(i,i);
1631 for( i=0; i<nV; ++i )
1632 delta_g[i] = g_new[i] - _THIS->
g[i];
1636 for( i=0; i<nV; ++i )
1637 delta_lb[i] = lb_new[i] - _THIS->
lb[i];
1642 for( i=0; i<nV; ++i )
1648 for( i=0; i<nV; ++i )
1649 delta_ub[i] = ub_new[i] - _THIS->
ub[i];
1654 for( i=0; i<nV; ++i )
1661 for ( i=0; i<nFX; ++i )
1719 const char*
const lb_file,
const char*
const ub_file
1761 for( i=0; i<nV; ++i )
1775 for( i=0; i<nV; ++i )
1796 if ( ( g_file != 0 ) && ( g_new != 0 ) )
1868 if (lb_new && ub_new) {
1887 real_t elapsedTime, timePerIteration;
1898 timePerIteration = elapsedTime / ((
real_t) nWSR);
1902 if ( ( elapsedTime + timePerIteration*1.25 ) <= ( *cputime ) )
1953 const int*
const idxList,
1967 for( i=0; i<nIdx; ++i )
1977 *t = num[i] / den[i];
1986 *t = num[i] / den[i];
2010 for (i = 0; i < nV; i++)
2013 if (s < 1.0) s = 1.0;
2015 if (d > len) len = d;
2021 for (i = 0; i < nV; i++)
2024 if (s < 1.0) s = 1.0;
2026 if (d > len) len = d;
2033 for (i = 0; i < nV; i++)
2036 if (s < 1.0) s = 1.0;
2038 if (d > len) len = d;
2050 real_t curFarBound,
int nRamp,
2061 for ( i=0; i<nV; ++i )
2064 rampVal = curFarBound * (1.0 + (1.0-t)*_THIS->
ramp0 + t*_THIS->
ramp1);
2067 lb_new_far[i] = -rampVal;
2072 ub_new_far[i] = rampVal;
2079 for ( i=0; i<nV; ++i )
2082 lb_new_far[i] = -curFarBound;
2087 ub_new_far[i] = curFarBound;
2107 for (i = 0; i < nV; i++)
2111 case ST_EQUALITY: _THIS->
lb[i] = _THIS->
x[i]; _THIS->
ub[i] = _THIS->
x[i];
continue;
2118 rampVal = (1.0-t) * _THIS->
ramp0 + t * _THIS->
ramp1;
2120 if (bstat !=
ST_LOWER) { _THIS->
lb[i] = _THIS->
x[i] - rampVal; }
2121 if (bstat !=
ST_UPPER) { _THIS->
ub[i] = _THIS->
x[i] + rampVal; }
2122 if (bstat ==
ST_LOWER) { _THIS->
lb[i] = _THIS->
x[i]; _THIS->
y[i] = +rampVal; }
2123 if (bstat ==
ST_UPPER) { _THIS->
ub[i] = _THIS->
x[i]; _THIS->
y[i] = -rampVal; }
2146 Bounds*
const guessedBounds,
2220 if ( _R == _THIS->
R )
2225 else if ( ( xOpt == 0 ) && ( yOpt == 0 ) && ( guessedBounds == 0 ) )
2227 for( i=0; i<nV; ++i )
2228 for( j=i; j<nV; ++j )
2229 RR(i,j) = _R[i*nV+j];
2236 for( i=0; i<nV; ++i )
2237 g_original[i] = _THIS->
g[i];
2238 for( i=0; i<nV; ++i )
2239 lb_original[i] = _THIS->
lb[i];
2240 for( i=0; i<nV; ++i )
2241 ub_original[i] = _THIS->
ub[i];
2261 returnvalue =
QProblemB_hotstart( _THIS,g_original,lb_original,ub_original, nWSR,cputime );
2291 int*
nWSR,
real_t*
const cputime,
int nWSRperformed,
2316 #ifndef __SUPPRESSANYOUTPUT__ 2344 for( iter=nWSRperformed; iter<*
nWSR; ++iter )
2361 #ifndef __SUPPRESSANYOUTPUT__ 2371 delta_g,delta_lb,delta_ub,
2388 delta_xFX,delta_xFR,delta_yFX
2405 delta_xFX,delta_xFR,delta_yFX,
2421 if ( homotopyLength <= _THIS->
options.terminationTolerance )
2498 #ifndef __SUPPRESSANYOUTPUT__ 2517 int*
nWSR,
real_t*
const cputime,
int nWSRperformed,
2526 int nWSR_max = *
nWSR;
2527 int nWSR_total = nWSRperformed;
2529 real_t cputime_total = 0.0;
2530 real_t cputime_cur = 0.0;
2537 return QProblemB_solveQP( _THIS,g_new,lb_new,ub_new, nWSR,cputime,nWSRperformed,isFirstCall );
2543 returnvalue =
QProblemB_solveQP( _THIS,g_new,lb_new,ub_new, nWSR,0,nWSRperformed,isFirstCall );
2547 cputime_cur = *cputime;
2548 returnvalue =
QProblemB_solveQP( _THIS,g_new,lb_new,ub_new, nWSR,&cputime_cur,nWSRperformed,isFirstCall );
2551 cputime_total += cputime_cur;
2559 *cputime = cputime_total;
2573 for( i=0; i<nV; ++i )
2574 gMod[i] = g_new[i] - _THIS->
regVal * _THIS->
x[i];
2582 returnvalue =
QProblemB_solveQP( _THIS,gMod,lb_new,ub_new, nWSR,0,nWSR_total,isFirstCall );
2587 cputime_cur = *cputime - cputime_total;
2588 returnvalue =
QProblemB_solveQP( _THIS,gMod,lb_new,ub_new, nWSR,&cputime_cur,nWSR_total,isFirstCall );
2592 cputime_total += cputime_cur;
2598 *cputime = cputime_total;
2607 for( i=0; i<nV; ++i )
2608 _THIS->
g[i] = g_new[i];
2611 *cputime = cputime_total;
2621 Bounds*
const auxiliaryBounds,
2631 if ( auxiliaryBounds != 0 )
2633 for( i=0; i<nV; ++i )
2657 for( i=0; i<nV; ++i )
2673 for( i=0; i<nV; ++i )
2701 if ( xOpt != _THIS->
x )
2702 for( i=0; i<nV; ++i )
2703 _THIS->
x[i] = xOpt[i];
2707 for( i=0; i<nV; ++i )
2713 if ( yOpt != _THIS->
y )
2714 for( i=0; i<nV; ++i )
2715 _THIS->
y[i] = yOpt[i];
2719 for( i=0; i<nV; ++i )
2740 for ( i=0; i<nV; ++i )
2741 _THIS->
g[i] = _THIS->
y[i];
2743 for ( i=0; i<nV; ++i )
2744 _THIS->
g[i] = _THIS->
y[i] - _THIS->
regVal * _THIS->
x[i];
2748 for ( i=0; i<nV; ++i )
2749 _THIS->
g[i] = _THIS->
y[i] - _THIS->
x[i];
2754 for ( i=0; i<nV; ++i )
2755 _THIS->
g[i] = _THIS->
y[i];
2777 for ( i=0; i<nV; ++i )
2782 if ( useRelaxation ==
BT_TRUE )
2786 _THIS->
lb[i] = _THIS->
x[i];
2787 _THIS->
ub[i] = _THIS->
x[i];
2798 _THIS->
lb[i] = _THIS->
x[i];
2801 _THIS->
ub[i] = _THIS->
x[i];
2805 if ( useRelaxation ==
BT_TRUE )
2811 _THIS->
ub[i] = _THIS->
x[i];
2814 _THIS->
lb[i] = _THIS->
x[i];
2818 if ( useRelaxation ==
BT_TRUE )
2844 if ( guessedBounds == &(_THIS->
bounds) )
2882 for ( i=0; i<nV; ++i )
2901 const real_t*
const delta_g,
const real_t*
const delta_lb,
const real_t*
const delta_ub,
2929 for( i=0; i<nFX; ++i )
2934 delta_xFX[i] = delta_lb[ii];
2936 delta_xFX[i] = delta_ub[ii];
2941 for( i=0; i<nFX; ++i )
2948 for ( i=0; i<nFR; ++i )
2965 DenseMatrix_subTimes(_THIS->
H,
Bounds_getFree( &(_THIS->
bounds) ),
Bounds_getFixed( &(_THIS->
bounds) ), 1, -1.0, delta_xFX, nFX, 1.0, _THIS->
delta_xFR_TMP, nFR,
BT_TRUE);
2977 for ( i=0; i<nFR; ++i )
2986 for ( i=0; i<nFR; ++i )
2998 for ( i=0; i<nFR; ++i )
3009 DenseMatrix_subTimes(_THIS->
H,
Bounds_getFree( &(_THIS->
bounds) ),
Bounds_getFree( &(_THIS->
bounds) ), 1, -1.0, delta_xFR, nFR, 1.0, _THIS->
delta_xFR_TMP, nFR,
BT_TRUE);
3010 DenseMatrix_subTimes(_THIS->
H,
Bounds_getFree( &(_THIS->
bounds) ),
Bounds_getFixed( &(_THIS->
bounds) ), 1, -1.0, delta_xFX, nFX, 1.0, _THIS->
delta_xFR_TMP, nFR,
BT_TRUE);
3013 for ( i=0; i<nFR; ++i )
3021 if ( rnrm < _THIS->
options.epsIterRef )
3032 for( i=0; i<nFX; ++i )
3036 delta_yFX[i] = delta_g[ii];
3042 delta_yFX[i] += _THIS->
regVal*delta_xFX[i];
3045 delta_yFX[i] += delta_xFX[i];
3050 for( i=0; i<nFX; ++i )
3054 delta_yFX[i] = delta_g[ii];
3056 DenseMatrix_subTimes(_THIS->
H,
Bounds_getFixed( &(_THIS->
bounds) ),
Bounds_getFree( &(_THIS->
bounds) ), 1, 1.0, delta_xFR, nFR, 1.0, delta_yFX, nFX,
BT_TRUE);
3058 DenseMatrix_subTimes(_THIS->
H,
Bounds_getFixed( &(_THIS->
bounds) ),
Bounds_getFixed( &(_THIS->
bounds) ), 1, 1.0, delta_xFX, nFX, 1.0, delta_yFX, nFX,
BT_TRUE);
3070 const real_t*
const delta_g,
3071 const real_t*
const delta_lb,
const real_t*
const delta_ub,
3085 int BC_idx_tmp = -1;
3103 for( i=0; i<nFX; ++i )
3106 num[i] = _THIS->
y[ii];
3107 den[i] = -delta_yFX[i];
3112 if ( BC_idx_tmp >= 0 )
3114 *BC_idx = BC_idx_tmp;
3124 for( i=0; i<nFR; ++i )
3128 den[i] = delta_lb[ii] - delta_xFR[i];
3133 if ( BC_idx_tmp >= 0 )
3135 *BC_idx = BC_idx_tmp;
3143 for( i=0; i<nFR; ++i )
3147 den[i] = delta_xFR[i] - delta_ub[ii];
3152 if ( BC_idx_tmp >= 0 )
3154 *BC_idx = BC_idx_tmp;
3160 #ifndef __SUPPRESSANYOUTPUT__ 3174 for( i=0; i<nFR; ++i )
3177 _THIS->
x[ii] += _THIS->
tau * delta_xFR[i];
3180 for( i=0; i<nFX; ++i )
3183 _THIS->
x[ii] += _THIS->
tau * delta_xFX[i];
3184 _THIS->
y[ii] += _THIS->
tau * delta_yFX[i];
3188 for( i=0; i<nV; ++i )
3190 _THIS->
g[i] += _THIS->
tau * delta_g[i];
3191 _THIS->
lb[i] += _THIS->
tau * delta_lb[i];
3192 _THIS->
ub[i] += _THIS->
tau * delta_ub[i];
3198 #ifndef __SUPPRESSANYOUTPUT__ 3214 #ifndef __SUPPRESSANYOUTPUT__ 3219 switch ( BC_status )
3228 #ifndef __SUPPRESSANYOUTPUT__ 3236 _THIS->
y[BC_idx] = 0.0;
3242 #ifndef __SUPPRESSANYOUTPUT__ 3268 for ( i=0; i<nV; ++i )
3276 _THIS->
lb[i] = _THIS->
x[i];
3282 _THIS->
ub[i] = _THIS->
x[i];
3297 _THIS->
lb[i] = _THIS->
x[i];
3298 _THIS->
ub[i] = _THIS->
x[i];
3319 int differenceNumber = 0;
3327 for( i=0; i<nV; ++i )
3374 if ( ( updateCholesky ==
BT_TRUE ) &&
3381 for( i=number_idx+1; i<nFR; ++i )
3386 for( j=(1+i); j<nFR; ++j )
3387 QProblemB_applyGivens( c,s,nu,
RR(i-1,j),
RR(i,j), &
RR(i-1,j),&
RR(i,j) );
3391 for( i=0; i<nFR-1; ++i )
3392 for( j=number_idx+1; j<nFR; ++j )
3393 RR(i,j-1) =
RR(i,j);
3395 for( i=0; i<nFR; ++i )
3452 if ( ( updateCholesky ==
BT_TRUE ) &&
3465 for( i=0; i<nFR; ++i )
3471 for( i=0; i<nFR; ++i )
3484 for( i=0; i<nFR; ++i )
3488 for( i=0; i<nFR; ++i )
3504 case ST_LOWER: _THIS->
lb[number] = _THIS->
ub[number];
break;
3505 case ST_UPPER: _THIS->
ub[number] = _THIS->
lb[number];
break;
3530 case ST_LOWER: _THIS->
lb[number] = _THIS->
ub[number];
break;
3531 case ST_UPPER: _THIS->
ub[number] = _THIS->
lb[number];
break;
3551 #ifndef __SUPPRESSANYOUTPUT__ 3566 if ( ( iter == 0 ) && ( isFirstCall ==
BT_TRUE ) )
3572 qpOASES_myPrintf(
" ----------+------------------+------------------+--------- \n" );
3579 snprintf( info,3,
"LP" );
3581 snprintf( info,3,
"QP" );
3593 snprintf( info,8,
"REM BND" );
3595 snprintf( info,8,
"ADD BND" );
returnValue Bounds_setupBound(Bounds *_THIS, int number, SubjectToStatus _status)
returnValue QProblemB_reset(QProblemB *_THIS)
real_t DenseMatrix_getNorm(DenseMatrix *_THIS, int type)
static int QProblemB_getNV(QProblemB *_THIS)
static Indexlist * Bounds_getFree(Bounds *_THIS)
BooleanType QProblemB_isCPUtimeLimitExceeded(QProblemB *_THIS, const real_t *const cputime, real_t starttime, int nWSR)
returnValue QProblemB_backsolveR(QProblemB *_THIS, const real_t *const b, BooleanType transposed, real_t *const a)
static QProblemStatus QProblemB_getStatus(QProblemB *_THIS)
returnValue DenseMatrix_subTimes(DenseMatrix *_THIS, const Indexlist *const irows, const Indexlist *const icols, int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD, BooleanType yCompr)
returnValue QProblemB_hotstart(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime)
real_t DenseMatrix_diag(DenseMatrix *_THIS, int i)
static BooleanType Bounds_hasNoLower(Bounds *_THIS)
static void Bounds_setNoUpper(Bounds *_THIS, BooleanType _status)
TabularOutput tabularOutput
returnValue DenseMatrix_addToDiag(DenseMatrix *_THIS, real_t alpha)
returnValue QProblemB_initMW(QProblemB *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const real_t *const _R)
BooleanType isZero(real_t x, real_t TOL=ZERO)
Implements the online active set strategy for box-constrained QPs.
int Indexlist_getIndex(Indexlist *_THIS, int givennumber)
returnValue Bounds_setupAllFree(Bounds *_THIS)
static BooleanType QProblemB_isInfeasible(QProblemB *_THIS)
BooleanType enableFarBounds
returnValue QProblemB_performStep(QProblemB *_THIS, const real_t *const delta_g, const real_t *const delta_lb, const real_t *const delta_ub, const real_t *const delta_xFX, const real_t *const delta_xFR, const real_t *const delta_yFX, int *BC_idx, SubjectToStatus *BC_status)
returnValue QProblemB_determineHessianType(QProblemB *_THIS)
static SubjectToStatus Bounds_getStatus(Bounds *_THIS, int i)
returnValue DenseMatrix_getCol(DenseMatrix *_THIS, int cNum, const Indexlist *const irows, real_t alpha, real_t *col)
returnValue QProblemB_performRamping(QProblemB *_THIS)
real_t QProblemB_getObjVal(QProblemB *_THIS)
static real_t qpOASES_getMin(real_t x, real_t y)
returnValue QProblemB_printOptions(QProblemB *_THIS)
#define THROWINFO(retval)
returnValue QProblemB_getWorkingSetConstraints(QProblemB *_THIS, real_t *workingSetC)
#define ST_INFEASIBLE_UPPER
returnValue QProblemB_getWorkingSetBounds(QProblemB *_THIS, real_t *workingSetB)
Allows to pass back messages to the calling function.
returnValue QProblemB_obtainAuxiliaryWorkingSet(QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Bounds *auxiliaryBounds)
static int QProblemB_getNFX(QProblemB *_THIS)
returnValue QProblemB_setupSubjectToType(QProblemB *_THIS)
returnValue DenseMatrix_getRow(DenseMatrix *_THIS, int rNum, const Indexlist *const icols, real_t alpha, real_t *row)
real_t QProblemB_getObjValX(QProblemB *_THIS, const real_t *const _x)
returnValue QProblemB_init(QProblemB *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime)
returnValue Options_setToFast(Options *_THIS)
static BooleanType QProblemB_isUnbounded(QProblemB *_THIS)
static BooleanType Bounds_hasNoUpper(Bounds *_THIS)
static returnValue QProblemB_setLB(QProblemB *_THIS, const real_t *const lb_new)
#define THROWERROR(retval)
returnValue MessageHandling_throwWarning(MessageHandling *_THIS, returnValue Wnumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
returnValue QProblemB_setupQPdataFromFile(QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file)
returnValue QProblemB_setupQPdata(QProblemB *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
BooleanType enableEqualities
returnValue QProblemB_addBound(QProblemB *_THIS, int number, SubjectToStatus B_status, BooleanType updateCholesky)
returnValue QProblemB_determineStepDirection(QProblemB *_THIS, const real_t *const delta_g, const real_t *const delta_lb, const real_t *const delta_ub, BooleanType Delta_bB_isZero, real_t *const delta_xFX, real_t *const delta_xFR, real_t *const delta_yFX)
#define ST_INFEASIBLE_LOWER
BooleanType enableRamping
real_t QProblemB_getRelativeHomotopyLength(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new)
static const real_t QPOASES_ZERO
returnValue Flipper_set(Flipper *_THIS, const Bounds *const _bounds, const real_t *const _R, const Constraints *const _constraints, const real_t *const _Q, const real_t *const _T)
returnValue Bounds_moveFreeToFixed(Bounds *_THIS, int number, SubjectToStatus _status)
static BooleanType QProblemB_isBlocking(QProblemB *_THIS, real_t num, real_t den, real_t epsNum, real_t epsDen, real_t *t)
static int QProblemB_getNFR(QProblemB *_THIS)
BooleanType DenseMatrix_isDiag(DenseMatrix *_THIS)
returnValue MessageHandling_throwInfo(MessageHandling *_THIS, returnValue Inumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
returnValue QProblemB_changeActiveSet(QProblemB *_THIS, int BC_idx, SubjectToStatus BC_status)
real_t qpOASES_getCPUtime()
returnValue qpOASES_readFromFileV(real_t *data, int n, const char *datafilename)
returnValue Flipper_get(Flipper *_THIS, Bounds *const _bounds, real_t *const R, Constraints *const _constraints, real_t *const _Q, real_t *const _T)
void QProblemBCPY(QProblemB *FROM, QProblemB *TO)
static void Bounds_setNoLower(Bounds *_THIS, BooleanType _status)
returnValue MessageHandling_reset(MessageHandling *_THIS)
returnValue QProblemB_hotstartFW(QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime, Bounds *const guessedBounds)
returnValue QProblemB_setPrintLevel(QProblemB *_THIS, PrintLevel _printLevel)
returnValue QProblemB_getPrimalSolution(QProblemB *_THIS, real_t *const xOpt)
BooleanType enableFlippingBounds
returnValue qpOASES_readFromFileM(real_t *data, int nrow, int ncol, const char *datafilename)
returnValue QProblemB_regulariseHessian(QProblemB *_THIS)
returnValue QProblemB_setupSubjectToTypeNew(QProblemB *_THIS, const real_t *const lb_new, const real_t *const ub_new)
returnValue Bounds_init(Bounds *_THIS, int _n)
returnValue QProblemB_setInfeasibilityFlag(QProblemB *_THIS, returnValue returnvalue, BooleanType doThrowError)
returnValue QProblemB_getWorkingSet(QProblemB *_THIS, real_t *workingSet)
static returnValue Bounds_setType(Bounds *_THIS, int i, SubjectToType value)
returnValue QProblemB_loadQPvectorsFromFile(QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, real_t *const g_new, real_t *const lb_new, real_t *const ub_new)
returnValue QProblemB_performRatioTestB(QProblemB *_THIS, int nIdx, const int *const idxList, Bounds *const subjectTo, const real_t *const num, const real_t *const den, real_t epsNum, real_t epsDen, real_t *t, int *BC_idx)
returnValue Options_print(Options *_THIS)
static void MessageHandling_setInfoVisibilityStatus(MessageHandling *_THIS, VisibilityStatus _infoVisibility)
Interfaces matrix-vector operations tailored to general dense matrices.
static real_t qpOASES_getAbs(real_t x)
static int QProblemB_getNFV(QProblemB *_THIS)
returnValue QProblemB_setupInitialCholesky(QProblemB *_THIS)
static BooleanType QProblemB_usingRegularisation(QProblemB *_THIS)
returnValue QProblemB_setupAuxiliaryQP(QProblemB *_THIS, Bounds *const guessedBounds)
static real_t qpOASES_getMax(real_t x, real_t y)
int QProblemB_getNZ(QProblemB *_THIS)
static int Bounds_getNFX(Bounds *_THIS)
returnValue QProblemB_setupAuxiliaryQPsolution(QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt)
returnValue QProblemB_updateFarBounds(QProblemB *_THIS, real_t curFarBound, int nRamp, const real_t *const lb_new, real_t *const lb_new_far, const real_t *const ub_new, real_t *const ub_new_far)
static void QProblemB_applyGivens(real_t c, real_t s, real_t nu, real_t xold, real_t yold, real_t *xnew, real_t *ynew)
static returnValue QProblemB_setH(QProblemB *_THIS, real_t *const H_new)
returnValue qpOASES_myPrintf(const char *s)
returnValue QProblemB_printProperties(QProblemB *_THIS)
returnValue QProblemB_initW(QProblemB *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const real_t *const _R)
int enableDriftCorrection
returnValue QProblemB_initFW(QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const char *const R_file)
returnValue QProblemB_performDriftCorrection(QProblemB *_THIS)
BooleanType QProblemB_shallRefactorise(QProblemB *_THIS, Bounds *const guessedBounds)
static real_t qpOASES_getSqrt(real_t x)
real_t qpOASES_getNorm(const real_t *const v, int n, int type)
returnValue QProblemB_backsolveRrem(QProblemB *_THIS, const real_t *const b, BooleanType transposed, BooleanType removingBound, real_t *const a)
BooleanType enableRegularisation
returnValue QProblemB_initM(QProblemB *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime)
returnValue QProblemB_setupQPdataM(QProblemB *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
static const real_t QPOASES_INFTY
static void MessageHandling_setErrorVisibilityStatus(MessageHandling *_THIS, VisibilityStatus _errorVisibility)
void rhs(const real_t *x, real_t *f)
static void MessageHandling_setWarningVisibilityStatus(MessageHandling *_THIS, VisibilityStatus _warningVisibility)
#define END_NAMESPACE_QPOASES
returnValue Bounds_moveFixedToFree(Bounds *_THIS, int number)
void OptionsCPY(Options *FROM, Options *TO)
returnValue QProblemB_hotstartF(QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime)
#define HST_POSDEF_NULLSPACE
MessageHandling * qpOASES_getGlobalMessageHandler()
returnValue Bounds_flipFixed(Bounds *_THIS, int number)
returnValue QProblemB_setupAuxiliaryQPbounds(QProblemB *_THIS, BooleanType useRelaxation)
returnValue QProblemB_setupAuxiliaryWorkingSet(QProblemB *_THIS, Bounds *const auxiliaryBounds, BooleanType setupAfresh)
static real_t * DenseMatrix_getVal(DenseMatrix *_THIS)
static BooleanType QProblemB_isInitialised(QProblemB *_THIS)
returnValue Options_setToDefault(Options *_THIS)
returnValue QProblemB_computeCholesky(QProblemB *_THIS)
int numRegularisationSteps
returnValue QProblemB_hotstartW(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, Bounds *const guessedBounds)
#define THROWWARNING(retval)
returnValue QProblemB_areBoundsConsistent(QProblemB *_THIS, const real_t *const lb_new, const real_t *const ub_new)
int enableCholeskyRefactorisation
static const real_t QPOASES_EPS
returnValue QProblemB_solveInitialQP(QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const real_t *const _R, int *nWSR, real_t *const cputime)
returnValue QProblemB_setupAuxiliaryQPgradient(QProblemB *_THIS)
returnValue Indexlist_getNumberArray(Indexlist *_THIS, int **const numberarray)
static returnValue QProblemB_setG(QProblemB *_THIS, const real_t *const g_new)
#define QPOASES_MAX_STRING_LENGTH
returnValue QProblemB_printIteration(QProblemB *_THIS, int iter, int BC_idx, SubjectToStatus BC_status, real_t homotopyLength, BooleanType isFirstCall)
Manages working sets of bounds (= box constraints).
#define BEGIN_NAMESPACE_QPOASES
returnValue DenseMatrix_times(DenseMatrix *_THIS, int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD)
returnValue QProblemB_solveRegularisedQP(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, int nWSRperformed, BooleanType isFirstCall)
static void QProblemB_computeGivens(real_t xold, real_t yold, real_t *xnew, real_t *ynew, real_t *c, real_t *s)
returnValue qpOASES_printCopyrightNotice()
static SubjectToType Bounds_getType(Bounds *_THIS, int i)
static returnValue QProblemB_setUB(QProblemB *_THIS, const real_t *const ub_new)
returnValue QProblemB_removeBound(QProblemB *_THIS, int number, BooleanType updateCholesky)
SubjectToStatus initialStatusBounds
returnValue QProblemB_determineDataShift(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, real_t *const delta_g, real_t *const delta_lb, real_t *const delta_ub, BooleanType *Delta_bB_isZero)
returnValue QProblemB_getDualSolution(QProblemB *_THIS, real_t *const yOpt)
static Indexlist * Bounds_getFixed(Bounds *_THIS)
BEGIN_NAMESPACE_QPOASES void QProblemBCON(QProblemB *_THIS, int _nV, HessianType _hessianType)
returnValue QProblemB_initF(QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime)
void BoundsCON(Bounds *_THIS, int _n)
returnValue QProblemB_solveQP(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, int nWSRperformed, BooleanType isFirstCall)