soth::Stage Class Reference

#include <Stage.hpp>

Inheritance diagram for soth::Stage:
[legend]
Collaboration diagram for soth::Stage:
[legend]

List of all members.

Public Types

typedef MatrixXd::Index Index
typedef SubMatrix< MatrixXd >
::RowIndices 
Indirect
typedef TriangularView
< SubMatrixXd, Lower > 
TriSubMatrixXd
typedef TriangularView
< const_SubMatrixXd, Lower > 
const_TriSubMatrixXd
typedef VectorBlock
< MatrixXd::RowXpr > 
RowL
typedef MatrixXd::RowXpr RowML

Public Member Functions

 Stage (const MatrixXd &J, const VectorBound &bounds, BaseY &Y)
 Stage (const Index nr, const Index nc, const double *Jdata, const Bound *bdata, const BaseY &Y)
 Stage (const Index nr, const Index nc, const double *Jdata, const BaseY &Y)
void setInitialActiveSet (void)
void setInitialActiveSet (const cstref_vector_t &initialGuess, bool checkTwin=false)
cstref_vector_t getOptimalActiveSet (bool withTwin=false)
void reset (void)
void computeInitialCOD (BaseY &Yinit)
bool downdate (const Index position, GivensSequence &Ydown)
bool propagateDowndate (GivensSequence &Ydown, bool decreasePreviousRank)
Index update (const ConstraintRef &cst, GivensSequence &Yup)
void propagateUpdate (GivensSequence &Ydown, Index decreasePreviousRank)
void computeSolution (VectorXd &Ytu) const
void damp (void)
template<typename VectorDerived >
void applyDamping (MatrixBase< VectorDerived > &x) const
template<typename VD1 , typename VD2 >
void applyDamping (MatrixBase< VD1 > &x, MatrixBase< VD2 > &y) const
template<typename VectorDerived >
void applyDampingTranspose (MatrixBase< VectorDerived > &x) const
template<typename VD1 , typename VD2 >
void applyDampingTranspose (MatrixBase< VD1 > &x, const MatrixBase< VD2 > &y) const
void damping (const double &factor)
double damping (void) const
bool useDamp (void) const
void dampBoundValue (const ConstraintRef &cst, const double &value)
template<typename D >
void computeError (const VectorXd &Ytu, MatrixBase< D > &err) const
void computeError (const VectorXd &Ytu)
void computeRho (const VectorXd &Ytu, VectorXd &Ytrho, bool inLambda=false)
template<typename D >
void computeLagrangeMultipliers (VectorXd &rho, MatrixBase< D > &l) const
 input: rho_under_i = {ro_1, ..., ro_i} on return: lambda_i = Wr_i*L_i^{-T}*rho_i rho_under_{i-1} = rho_under_{i-1} + Mr_i^T*L_i^{-T}*rho_i ??? * rho_i = L_i^{-T}*rho_i (should not be useful).
void computeLagrangeMultipliers (VectorXd &rho)
bool checkBound (const VectorXd &u0, const VectorXd &u1, ConstraintRef *, double *tau)
bool checkBound (const VectorXd &u0, const VectorXd &u1, ConstraintRef &cstmax, double &taumax)
bool maxLambda (const VectorXd &u, double &lmax, Index &row) const
void freezeSlacks (const bool &slacks=true)
void recompose (MatrixXd &WMLY) const
void show (std::ostream &os, Index stageRef, bool check=false) const
void showActiveSet (std::ostream &os) const
SubMatrix< MatrixXd,
RowPermutation > 
Jactive (MatrixXd &J_) const
MatrixXd Jactive () const
SubVectorXd eactive (VectorXd &e_) const
VectorXd eactive () const
bool testRecomposition (void) const
bool testSolution (const VectorXd &solution) const
bool testUnactiveTwins (void)
Index where (Index cst) const
ConstraintRef which (Index row) const
bool isActive (Index cst) const
SubMatrixXd getM ()
const_SubMatrixXd getM () const
SubMatrixXd getL ()
const_SubMatrixXd getL () const
TriSubMatrixXd getLtri ()
const_TriSubMatrixXd getLtri () const
TriSubMatrixXd getLdtri ()
const_TriSubMatrixXd getLdtri () const
SubVectorXd gete ()
const_SubVectorXd gete () const
SubVectorXd getLagrangeMultipliers ()
const_SubVectorXd getLagrangeMultipliers () const
MatrixXd getWr () const
VectorXd getLagrangeDamped () const
RowL rowL0 (const Index r)
RowML rowMrL0 (const Index r)
RowL rowML (const Index r)
Index rowSize (const Index r)
Index nbConstraints (void) const
Index sizeA (void) const
Index sizeN (void) const
Index rank () const
Index getSizeM () const
Index getSizeL () const

Public Attributes

std::string name

Static Public Attributes

static double EPSILON = 1e-8

Protected Member Functions

void nullifyLineDeficient (const Index row, const Index in_r)
void computeInitialJY ()
void conditionalWinit (bool id)
void regularizeHessenberg (GivensSequence &Ydown)
Index nullifyACrossFromW (const Index position)
void removeARowFromL (Index row)
void removeACrossFromW (const Index &row, const Index &col)
void addARow (const Index &mlrowup, bool deficient=false)
void computeErrorFromJu (const VectorXd &MLYtu)
template<typename D >
void computeErrorFromJu (const VectorXd &Ytu, MatrixBase< D > &err) const
void computeMLYtu (const VectorXd &Ytu, VectorXd &MLYtu) const

Protected Attributes

MatrixXd W_
MatrixXd ML_
VectorXd e_
VectorXd lambda_
Indirect Ir
Indirect Irn
Indirect Iw
Indirect Im
Indirect Il
SubMatrixXd M
SubMatrixXd L
SubMatrixXd W
SubMatrixXd Wr
SubMatrixXd Mr
SubVectorXd e
SubVectorXd lambda
VectorXd lambdadamped
VectorXd lzfreezed
bool isWIdenty
Index sizeM
Index sizeL
SubActiveSet< ActiveSet
< Indirect >, Indirect
activeSet
AllocatorML freeML
MatrixXd Ld_
MatrixXd Ldwork_
VectorXd edwork_
SubMatrixXd Ld
SubMatrixXd Ldwork
SubVectorXd edwork
GivensSequence Wd
double dampingFactor
bool isReset
bool isInit
bool isOptimumCpt
bool isLagrangeCpt
bool isDampCpt
bool isFreezed

Static Protected Attributes

static const double DAMPING_FACTOR = 1e-2

Member Typedef Documentation

typedef MatrixXd::Index soth::Stage::Index

Reimplemented from soth::BasicStage.

typedef SubMatrix<MatrixXd>::RowIndices soth::Stage::Indirect
typedef VectorBlock<MatrixXd::RowXpr> soth::Stage::RowL
typedef MatrixXd::RowXpr soth::Stage::RowML
typedef TriangularView<SubMatrixXd,Lower> soth::Stage::TriSubMatrixXd

Constructor & Destructor Documentation

soth::Stage::Stage ( const MatrixXd &  J,
const VectorBound bounds,
BaseY Y 
)
soth::Stage::Stage ( const Index  nr,
const Index  nc,
const double *  Jdata,
const Bound bdata,
const BaseY Y 
)
soth::Stage::Stage ( const Index  nr,
const Index  nc,
const double *  Jdata,
const BaseY Y 
)

Member Function Documentation

void soth::Stage::addARow ( const Index mlrowup,
bool  deficient = false 
) [protected]
template<typename VectorDerived >
void soth::Stage::applyDamping ( MatrixBase< VectorDerived > &  x) const
template<typename VD1 , typename VD2 >
void soth::Stage::applyDamping ( MatrixBase< VD1 > &  x,
MatrixBase< VD2 > &  y 
) const
template<typename VectorDerived >
void soth::Stage::applyDampingTranspose ( MatrixBase< VectorDerived > &  x) const
template<typename VD1 , typename VD2 >
void soth::Stage::applyDampingTranspose ( MatrixBase< VD1 > &  x,
const MatrixBase< VD2 > &  y 
) const
bool soth::Stage::checkBound ( const VectorXd &  u0,
const VectorXd &  u1,
ConstraintRef cstptr,
double *  tau 
)
template<typename D >
void soth::Stage::computeError ( const VectorXd &  Ytu,
MatrixBase< D > &  err 
) const
void soth::Stage::computeError ( const VectorXd &  Ytu)
void soth::Stage::computeErrorFromJu ( const VectorXd &  MLYtu) [protected]

References isLagrangeCpt, lambda, and sotDEBUG.

Referenced by computeError().

template<typename D >
void soth::Stage::computeErrorFromJu ( const VectorXd &  Ytu,
MatrixBase< D > &  err 
) const [protected]

References e, isWIdenty, sizeA(), and W.

template<typename D >
void soth::Stage::computeLagrangeMultipliers ( VectorXd &  rho,
MatrixBase< D > &  l 
) const

input: rho_under_i = {ro_1, ..., ro_i} on return: lambda_i = Wr_i*L_i^{-T}*rho_i rho_under_{i-1} = rho_under_{i-1} + Mr_i^T*L_i^{-T}*rho_i ??? * rho_i = L_i^{-T}*rho_i (should not be useful).

References isInit, isWIdenty, L, Mr, soth::BasicStage::nc, sizeA(), sizeL, sizeM, soth::solveInPlaceWithUpperTriangular(), sotDEBUG, and Wr.

Referenced by computeLagrangeMultipliers().

void soth::Stage::computeLagrangeMultipliers ( VectorXd &  rho)
void soth::Stage::computeMLYtu ( const VectorXd &  Ytu,
VectorXd &  MLYtu 
) const [protected]

References getLtri(), M, soth::BasicStage::nc, sizeL, sizeM, and sotDEBUG.

Referenced by computeError().

void soth::Stage::computeRho ( const VectorXd &  Ytu,
VectorXd &  Ytrho,
bool  inLambda = false 
)
void soth::Stage::computeSolution ( VectorXd &  Ytu) const
void soth::Stage::conditionalWinit ( bool  id) [protected]
void soth::Stage::dampBoundValue ( const ConstraintRef cst,
const double &  value 
)
void soth::Stage::damping ( const double &  factor) [inline]
double soth::Stage::damping ( void  ) const [inline]
VectorXd soth::Stage::eactive ( ) const

References e_.

Referenced by show().

SubVectorXd soth::Stage::gete ( ) [inline]
const_SubVectorXd soth::Stage::gete ( ) const [inline]
SubMatrixXd soth::Stage::getL ( ) [inline]
const_SubMatrixXd soth::Stage::getL ( ) const [inline]
VectorXd soth::Stage::getLagrangeDamped ( ) const [inline]
SubVectorXd soth::Stage::getLagrangeMultipliers ( ) [inline]
const_SubVectorXd soth::Stage::getLagrangeMultipliers ( ) const [inline]
TriSubMatrixXd soth::Stage::getLdtri ( ) [inline]
const_TriSubMatrixXd soth::Stage::getLdtri ( ) const [inline]
TriSubMatrixXd soth::Stage::getLtri ( ) [inline]

Referenced by computeMLYtu().

const_TriSubMatrixXd soth::Stage::getLtri ( ) const [inline]
SubMatrixXd soth::Stage::getM ( ) [inline]
const_SubMatrixXd soth::Stage::getM ( ) const [inline]
Index soth::Stage::getSizeL ( ) const [inline]
Index soth::Stage::getSizeM ( ) const [inline]
MatrixXd soth::Stage::getWr ( ) const [inline]
MatrixXd soth::Stage::Jactive ( ) const

Referenced by show(), and testRecomposition().

bool soth::Stage::maxLambda ( const VectorXd &  u,
double &  lmax,
Index row 
) const
Index soth::Stage::nbConstraints ( void  ) const [inline]

Reimplemented from soth::BasicStage.

MatrixXd::Index soth::Stage::nullifyACrossFromW ( const Index  position) [protected]

References EPSILON, Irn, isWIdenty, L, M, ML_, rowSize(), sizeA(), sotDEBUG, and W.

Referenced by downdate().

void soth::Stage::nullifyLineDeficient ( const Index  row,
const Index  in_r 
) [protected]
Index soth::Stage::rank ( ) const [inline]

Referenced by computeInitialCOD().

void soth::Stage::regularizeHessenberg ( GivensSequence Ydown) [protected]
Stage::RowL soth::Stage::rowL0 ( const Index  r)

References Ir, ML_, soth::BasicStage::nc, and sizeM.

Stage::RowL soth::Stage::rowML ( const Index  r)

References Irn, ML_, and rowSize().

Referenced by propagateDowndate(), and propagateUpdate().

Stage::RowML soth::Stage::rowMrL0 ( const Index  r)

References Ir, and ML_.

Referenced by regularizeHessenberg().

Stage::Index soth::Stage::rowSize ( const Index  r)

References soth::BasicStage::nc, sizeM, and sizeN().

Referenced by nullifyACrossFromW(), and rowML().

void soth::Stage::show ( std::ostream &  os,
Index  stageRef,
bool  check = false 
) const
void soth::Stage::showActiveSet ( std::ostream &  os) const

References activeSet.

Index soth::Stage::sizeN ( void  ) const [inline]
bool soth::Stage::testRecomposition ( void  ) const
bool soth::Stage::testSolution ( const VectorXd &  solution) const
bool soth::Stage::useDamp ( void  ) const [inline]
Stage::Index soth::Stage::where ( Index  cst) const

Member Data Documentation

const double soth::Stage::DAMPING_FACTOR = 1e-2 [static, protected]
double soth::Stage::dampingFactor [protected]
VectorXd soth::Stage::e_ [protected]

Referenced by computeInitialJY(), and eactive().

SubVectorXd soth::Stage::edwork [mutable, protected]
VectorXd soth::Stage::edwork_ [mutable, protected]

Referenced by rowL0(), and rowMrL0().

bool soth::Stage::isReset [protected]

Referenced by computeInitialCOD(), and reset().

Referenced by eactive(), Jactive(), and show().

VectorXd soth::Stage::lambda_ [protected]
VectorXd soth::Stage::lambdadamped [mutable, protected]
MatrixXd soth::Stage::Ld_ [protected]

Referenced by damp().

MatrixXd soth::Stage::Ldwork_ [protected]
VectorXd soth::Stage::lzfreezed [protected]
MatrixXd soth::Stage::W_ [protected]

Referenced by addARow().