37 #include <qpOASES/extras/SolutionAnalysis.hpp> 117 H_ptr = qp->
H->full();
119 for( i=0; i<nV; ++i )
120 H_ptr[i*nV+i] -= qp->
regVal;
127 real_t maxKktViolation=0.0, stat=0.0, feas=0.0, cmpl=0.0;
134 workingSetB,hasIdentityHessian
136 if ( workingSetB != 0 )
137 delete[] workingSetB;
155 maxKktViolation =
getMax( maxKktViolation,stat );
156 maxKktViolation =
getMax( maxKktViolation,feas );
157 maxKktViolation =
getMax( maxKktViolation,cmpl );
159 return maxKktViolation;
191 H_ptr = qp->
H->
full();
193 for( i=0; i<nV; ++i )
194 H_ptr[i*nV+i] -= qp->
regVal;
207 real_t maxKktViolation=0.0, stat=0.0, feas=0.0, cmpl=0.0;
214 workingSetB,workingSetC,hasIdentityHessian
217 if ( workingSetC != 0 )
218 delete[] workingSetC;
220 if ( workingSetB != 0 )
221 delete[] workingSetB;
242 maxKktViolation =
getMax( maxKktViolation,stat );
243 maxKktViolation =
getMax( maxKktViolation,feas );
244 maxKktViolation =
getMax( maxKktViolation,cmpl );
246 return maxKktViolation;
266 const real_t*
const g_b_bA_VAR,
real_t*
const Primal_Dual_VAR
277 const real_t*
const g_b_bA_VAR,
real_t*
const Primal_Dual_VAR
287 int_t run1, run2, run3;
344 for( run1 = 0; run1 < dim*dim; run1++ ){
346 Primal_Dual_VAR[run1] = 0.0;
359 for( run3 = 0; run3 < dim; run3++ ){
362 for( run1 = 0; run1 < nV; run1++ ){
363 delta_g_cov [run1] = g_b_bA_VAR[run3*dim+run1];
364 delta_lb_cov [run1] = g_b_bA_VAR[run3*dim+nV+run1];
365 delta_ub_cov [run1] = g_b_bA_VAR[run3*dim+nV+run1];
367 for( run1 = 0; run1 < nC; run1++ ){
368 delta_lbA_cov [run1] = g_b_bA_VAR[run3*dim+2*nV+run1];
369 delta_ubA_cov [run1] = g_b_bA_VAR[run3*dim+2*nV+run1];
376 returnvalue = qp->
determineStepDirection( delta_g_cov, delta_lbA_cov, delta_ubA_cov, delta_lb_cov, delta_ub_cov,
377 Delta_bC_isZero, Delta_bB_isZero, delta_xFX,delta_xFR,
378 delta_yAC,delta_yFX );
404 for( run1=0; run1<nFR; run1++ ){
406 K[run3*dim+run2] = delta_xFR[run1];
408 for( run1=0; run1<nFX; run1++ ){
410 K[run3*dim+run2] = delta_xFX[run1];
411 K[run3*dim+nV+run2] = delta_yFX[run1];
413 for( run1=0; run1<nAC; run1++ ){
415 K[run3*dim+2*nV+run2] = delta_yAC[run1];
429 for( run3 = 0; run3 < dim; run3++ ){
431 for( run1 = 0; run1 < nV; run1++ ){
432 delta_g_cov [run1] = K[run3+ run1*dim];
433 delta_lb_cov [run1] = K[run3+(nV+run1)*dim];
434 delta_ub_cov [run1] = K[run3+(nV+run1)*dim];
436 for( run1 = 0; run1 < nC; run1++ ){
437 delta_lbA_cov [run1] = K[run3+(2*nV+run1)*dim];
438 delta_ubA_cov [run1] = K[run3+(2*nV+run1)*dim];
445 returnvalue = qp->
determineStepDirection( delta_g_cov, delta_lbA_cov, delta_ubA_cov, delta_lb_cov, delta_ub_cov,
446 Delta_bC_isZero, Delta_bB_isZero, delta_xFX,delta_xFR,
447 delta_yAC,delta_yFX);
474 for( run1=0; run1<nFR; run1++ ){
476 Primal_Dual_VAR[run3+run2*dim] = delta_xFR[run1];
478 for( run1=0; run1<nFX; run1++ ){
480 Primal_Dual_VAR[run3+run2*dim ] = delta_xFX[run1];
481 Primal_Dual_VAR[run3+(nV+run2)*dim] = delta_yFX[run1];
483 for( run1=0; run1<nAC; run1++ ){
485 Primal_Dual_VAR[run3+(2*nV+run2)*dim] = delta_yAC[run1];
513 const real_t*
const g_b_bA_VAR,
real_t*
const Primal_Dual_VAR
526 printf(
"checkCurvatureOnStronglyActiveConstraints( SQProblem* qp ) not yet implemented for standard qpOASES!\n");
558 for( k=0; k<nFX; k++ )
559 if(
getAbs(qp->
x[FX_idx[k]]) > eps )
570 for( k=0; k<nFX; k++ )
HessianType getHessianType() const
virtual returnValue getWorkingSetBounds(real_t *workingSetB)
Implements the online active set strategy for box-constrained QPs.
returnValue getNumberArray(int *const numberarray) const
SolutionAnalysis & operator=(const SolutionAnalysis &rhs)
returnValue moveFixedToFree(int _number)
virtual real_t * full() const
Implements the online active set strategy for QPs with varying matrices.
Allows to pass back messages to the calling function.
returnValue getBounds(Bounds *const _bounds) const
returnValue resetSchurComplement(BooleanType allowInertiaCorrection)
SparseSolver * sparseSolver
#define THROWERROR(retval)
real_t delta_ubA_cov[NCMAX_ALLOC]
virtual returnValue getWorkingSetConstraints(real_t *workingSetC)
BooleanType usingRegularisation() const
virtual int_t getNegativeEigenvalues()
SubjectToStatus getStatus(int i) const
real_t delta_lbA_cov[NCMAX_ALLOC]
real_t A[NCMAX_ALLOC *NVMAX]
Provides additional tools for analysing QP solutions.
real_t delta_ub_cov[NVMAX]
returnValue determineStepDirection(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)
real_t delta_g_cov[NVMAX]
void rhs(const real_t *x, real_t *f)
#define END_NAMESPACE_QPOASES
real_t getKktViolation(QProblemB *const qp, real_t *const maxStat=0, real_t *const maxFeas=0, real_t *const maxCmpl=0) const
virtual returnValue getWorkingSetBounds(real_t *workingSetB)
QProblemStatus getStatus() const
real_t delta_lb_cov[NVMAX]
returnValue checkCurvatureOnStronglyActiveConstraints(SQProblemSchur *qp)
returnValue getVarianceCovariance(QProblemB *qp, real_t *g_b_bA_VAR, real_t *Primal_Dual_VAR) const
Manages working sets of bounds (= box constraints).
Implements the online active set strategy for QPs with varying, sparse matrices.
#define BEGIN_NAMESPACE_QPOASES
Implements the online active set strategy for QPs with general constraints.
#define REFER_NAMESPACE_QPOASES
returnValue moveFreeToFixed(int _number, SubjectToStatus _status)