137 const double epsilon = 0.2;
144 const double regularisation = 100.0*
EPS;
162 (x^Bx).getSubBlock( 0, 0, xBx, 1, 1 );
163 (y^x ).getSubBlock( 0, 0, xy , 1, 1 );
169 if( xy(0,0) > epsilon*xBx(0,0) ){
192 theta = (1.0-epsilon)*xBx(0,0)/
193 (xBx(0,0)-xy(0,0)+regularisation);
199 xz = epsilon*xBx(0,0);
206 BxxB *= 1.0/(xBx(0,0) + regularisation);
207 zz *= 1.0/(xz + regularisation);
228 for( run1 = 0; run1 < (int)
nBlocks; run1++ ){
Data class for storing generic optimization variables.
virtual returnValue initScaling(BlockMatrix &B, const BlockMatrix &x, const BlockMatrix &y)
Implements a very rudimentary block sparse matrix class.
BFGSupdate & operator=(const BFGSupdate &rhs)
virtual NLPderivativeApproximation * clone() const
BlockMatrix transpose() const
BEGIN_NAMESPACE_ACADO const double EPS
returnValue setDense(uint rowIdx, uint colIdx, const DMatrix &value)
Allows to pass back messages to the calling function.
virtual returnValue apply(BlockMatrix &B, const BlockMatrix &x, const BlockMatrix &y)
Block< Derived > block(Index startRow, Index startCol, Index blockRows, Index blockCols)
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
#define CLOSE_NAMESPACE_ACADO
returnValue setSubBlockLine(const int &N, const int &line1, const int &line2, const int &offset, BlockMatrix &M, const BlockMatrix &x)
Implements a constant Hessian as approximation of second-order derivatives within NLPsolvers...
returnValue getSubBlock(uint rowIdx, uint colIdx, DMatrix &value) const
ConstantHessian & operator=(const ConstantHessian &rhs)
virtual returnValue initScaling(BlockMatrix &B, const BlockMatrix &x, const BlockMatrix &y)
virtual returnValue initHessian(BlockMatrix &B, uint N, const OCPiterate &iter)
Encapsulates all user interaction for setting options, logging data and plotting results.
void rhs(const real_t *x, real_t *f)
Implements BFGS updates for approximating second-order derivatives within NLPsolvers.
virtual returnValue initHessian(BlockMatrix &B, uint N, const OCPiterate &iter)
returnValue setZero(uint rowIdx, uint colIdx)
#define BEGIN_NAMESPACE_ACADO
BFGSModificationType modification
BooleanType performsBlockUpdates() const
virtual returnValue applyUpdate(BlockMatrix &B, const BlockMatrix &x, const BlockMatrix &y)
virtual returnValue applyBlockDiagonalUpdate(BlockMatrix &B, const BlockMatrix &x, const BlockMatrix &y)
returnValue getSubBlockLine(const int &N, const int &line1, const int &line2, const int &offset, const BlockMatrix &M, BlockMatrix &x)
Base class for techniques of approximating second-order derivatives within NLPsolvers.