OBOE  0.1
Accpm::Manager Class Reference

#include <Manager.h>

List of all members.

Classes

struct  ltAccpmVectorPair

Public Member Functions

 Manager (const Parameters *param)
virtual ~Manager ()
virtual const AccpmVectorgetCurrentY () const
virtual const AccpmVectorgetActiveY () const
virtual int getActiveCuts (AccpmGenMatrix &cuts, bool activeVar=false) const
virtual int getActiveCuts (const AccpmGenMatrix *&cuts, bool activeVar=false) const
virtual const AccpmVectorgetBestY (bool activeVar=false) const
const AccpmVectorgetCurrentZ () const
const AccpmVectorgetRhsCoef () const
const AccpmVectorgetSubProblemIndex () const
const AccpmVectorgetCutOccurrence () const
const AccpmVectorgetActiveCutNorm () const
const AccpmVectorgetCurrentX () const
PointGengetPointGen ()
const PointGengetPointGen () const
const AccpmGenMatrixgetATQA () const
AccpmGenMatrixgetATQA ()
double getObjLB () const
double getObjUB () const
double getRelativeGap () const
double getWtEpigraphCut () const
virtual double getSmoothObj (bool activeVar=false) const
virtual const AccpmVectorgetSmoothGradient (bool activeVar=false) const
virtual const AccpmGenMatrixgetSmoothHessian (bool activeVar=false) const
bool inPhase2 () const
bool previousPhase2 () const
void updatePreviousPhase2 ()
bool isCurrentPointFeasible () const
ExitCode getExitCode () const
void setExitCode (ExitCode e)
double getRho () const
int getSizeOfs () const
void setSizeOfs (int n)
virtual int update1 (const AccpmVector &functionValue, const AccpmGenMatrix &subGradients, const AccpmGenMatrix &subProblemIndex, const AccpmVector *upperFunctionValues=0)
virtual int update2 (double functionValue, const AccpmGenMatrix &subGradients, const AccpmGenMatrix &hessian)
double computeBallConstraint (const AccpmVector &y) const
void computeBallConstraint (const AccpmVector &y, AccpmVector &result) const
void computeBox1Constraint (const AccpmVector &y, AccpmVector &result) const
void computeBox2Constraint (const AccpmVector &y, AccpmVector &result) const
virtual void updateVariables (const AccpmVector &y, const AccpmVector &z, const AccpmVector &s, double zs, double s0, double ss, const AccpmVector &sOld, double sOld0, const AccpmVector &ds, double ds0)
virtual void updateY (const AccpmVector &y)
int getNumOuterIteration () const
void updateInnerIterations (int n)
int getNumInnerIterations () const
virtual void updateLB (double lBound)
virtual const AccpmVectorgetVariableLB (bool activeVar=false) const
virtual const AccpmVectorgetVariableUB (bool activeVar=false) const
virtual const AccpmVectorgetB (bool activeVar=false) const
virtual const AccpmVectorgetCenterBall (bool activeVar=false) const
virtual double getRadiusBall () const
virtual const AccpmVectorgetQ (bool activeVar=false) const
virtual int computeSmoothComponent (bool hessian=true)
int callSmoothOracle (const AccpmVector &y, double &f2, AccpmVector &df2, AccpmGenMatrix *d2f2) const
virtual void updateActiveVariables ()
virtual void updateActiveVariablesForF2 ()
virtual int getNumCuts () const
virtual void output (std::ostream &os) const
void check ()

Protected Types

typedef map< const
AccpmVectorIntPair *, int,
ltAccpmVectorPair
CutSet

Protected Member Functions

virtual void init (void)
virtual void update ()
virtual double convexityFix (const AccpmVector &functionValue, const AccpmGenMatrix &subGradients, const AccpmVector &subProblemIndex, const AccpmVector &upperFunctionValues)
virtual void updateRhs (const AccpmVector &functionValue, const AccpmGenMatrix &subGradients)
virtual void updateRho (void)
virtual void updateEpigraphWeight (void)
virtual int addCut (const AccpmVectorIntPair *cut, int subProblemIndex, double weight, double rhs)
int findCut (const AccpmVectorIntPair &v) const
virtual int processCuts (const AccpmVector &functionValue, const AccpmGenMatrix &newCuts, const AccpmVector &subProblemIndex, const AccpmVector &upperFunctionValues)
virtual void updateQ ()
void updateRelativeGap ()

Protected Attributes

const Parameters_param
bool _phase2
bool _prevPhase2
bool _currentPointIsFeasible
int _numOuterIteration
int _numInnerIteration
ExitCode _exitCode
double _rho
double _objectiveFunction
double _objLB
double _objUB
double _relativeGap
double _weightEpigraphCut
AccpmVector _currentPointy
AccpmVector _bestPointy
AccpmVector _currentPointz
AccpmVector _rhsCoef
AccpmVector _subProblemIndex
AccpmVector _cutOccurrence
AccpmVector _activeCutNorm
AccpmDynMatrix _activeCuts
AccpmGenMatrix _activeCutsM
PointGen _pointGen
double _f2
AccpmVector_b
AccpmVector_df2
AccpmGenMatrix_d2f2
int _sizeOfs
int _numCuts
bool _hasSmoothOracle
CutSet _cutSet
int _currentCutId

Detailed Description

Manages the data generated during Accpm iterations.


Member Typedef Documentation

typedef map<const AccpmVectorIntPair *, int, ltAccpmVectorPair> Accpm::Manager::CutSet [protected]

Constructor & Destructor Documentation

Accpm::Manager::Manager ( const Parameters param)

The Constructor for the Manager. It does some basic initialization and creates vectors of appropriate dimensions for: Current Point Y Best Point Current Point Z

Also initializes PointGen object

References _bestPointy, _currentPointy, _currentPointz, _hasSmoothOracle, _objLB, _objUB, _param, Accpm::Parameters::getOracle(), Accpm::Parameters::getRealParameter(), Accpm::Parameters::getStartingPoint(), Accpm::Oracle::hasSmoothOracle(), init(), IS_FINITE(), updateQ(), and updateRelativeGap().

Accpm::Manager::~Manager ( ) [virtual]

References _b, _cutSet, _d2f2, and _df2.


Member Function Documentation

Returns the diagonal part of the Ball Constraints Mirrors InsertBallConstraint(...,'Diag')

References _param, AccpmLAAddMult(), AccpmLANorm2(), getCenterBall(), Accpm::Parameters::getIntParameter(), and getRadiusBall().

Referenced by computeBallConstraint().

void Accpm::Manager::computeBallConstraint ( const AccpmVector y,
AccpmVector result 
) const

Returns the Rang 1 part of the Ball Constraints Mirrors InsertBallConstraint(...,'Rang')

References _param, AccpmLAAddMult(), AccpmLAScale(), computeBallConstraint(), getCenterBall(), and Accpm::Parameters::getIntParameter().

double Accpm::Manager::convexityFix ( const AccpmVector functionValue,
const AccpmGenMatrix subGradients,
const AccpmVector subProblemIndex,
const AccpmVector upperFunctionValues 
) [protected, virtual]

Fix loose optimality cuts. Applies to oracle that deliver loose optimality cuts. (E.g., if the oracle computes the value f(y) by a maximization process and that process is not conducted to its end).

Updates the Objective Upper Bound: _objUB

Returns a value by which the objective function needs to be corrected due to convexity violation.

Must be called only in phase 2.

References _activeCutsM, _b, _bestPointy, _currentPointy, _exitCode, _hasSmoothOracle, _objUB, _param, _phase2, _rhsCoef, _subProblemIndex, AccpmError(), AccpmLAAddMult(), AccpmLADotProd(), AccpmLAMatTransVecMult(), AccpmWarning(), Accpm::CONVEXITY_FAILURE, DBL_LT(), Accpm::AccpmGenMatrix::getColumn(), Accpm::Parameters::getIntParameter(), Accpm::Parameters::getOptType(), Accpm::Parameters::getPi(), Accpm::Parameters::getRealParameter(), and Accpm::OPT_MIN.

Referenced by processCuts().

int Accpm::Manager::findCut ( const AccpmVectorIntPair v) const [protected]

References _cutSet.

Referenced by processCuts().

const AccpmVector& Accpm::Manager::getActiveCutNorm ( ) const [inline]

References _activeCutNorm.

int Accpm::Manager::getActiveCuts ( AccpmGenMatrix cuts,
bool  activeVar = false 
) const [virtual]
int Accpm::Manager::getActiveCuts ( const AccpmGenMatrix *&  cuts,
bool  activeVar = false 
) const [virtual]

References _activeCutsM.

const AccpmVector & Accpm::Manager::getActiveY ( ) const [virtual]

References _currentPointy.

Referenced by Accpm::NewtonSolution::init().

const AccpmGenMatrix& Accpm::Manager::getATQA ( ) const [inline]
const AccpmVector * Accpm::Manager::getB ( bool  activeVar = false) const [virtual]

References _param, and Accpm::Parameters::getB().

Referenced by init().

const AccpmVector & Accpm::Manager::getBestY ( bool  activeVar = false) const [virtual]
const AccpmVector * Accpm::Manager::getCenterBall ( bool  activeVar = false) const [virtual]
const AccpmVector& Accpm::Manager::getCutOccurrence ( ) const [inline]

References _cutOccurrence.

int Accpm::Manager::getNumCuts ( ) const [virtual]

References _numCuts.

Referenced by Accpm::QpGenerator::getNumCuts().

const PointGen& Accpm::Manager::getPointGen ( ) const [inline]

References _pointGen.

const AccpmVector * Accpm::Manager::getQ ( bool  activeVar = false) const [virtual]

References _pointGen, and Accpm::PointGen::_q.

double Accpm::Manager::getRadiusBall ( ) const [virtual]
double Accpm::Manager::getRho ( ) const [inline]

References _rho.

const AccpmVector& Accpm::Manager::getRhsCoef ( ) const [inline]
int Accpm::Manager::getSizeOfs ( ) const [inline]

References _sizeOfs.

Referenced by Accpm::NewtonSolution::warmStart().

const AccpmVector * Accpm::Manager::getSmoothGradient ( bool  activeVar = false) const [virtual]

References _df2.

const AccpmGenMatrix * Accpm::Manager::getSmoothHessian ( bool  activeVar = false) const [virtual]

References _d2f2.

double Accpm::Manager::getSmoothObj ( bool  activeVar = false) const [virtual]

References _f2.

const AccpmVector * Accpm::Manager::getVariableLB ( bool  activeVar = false) const [virtual]
const AccpmVector * Accpm::Manager::getVariableUB ( bool  activeVar = false) const [virtual]
double Accpm::Manager::getWtEpigraphCut ( ) const [inline]

References _weightEpigraphCut.

bool Accpm::Manager::previousPhase2 ( ) const [inline]

References _prevPhase2.

Referenced by Accpm::NewtonSolution::warmStart().

int Accpm::Manager::processCuts ( const AccpmVector functionValue,
const AccpmGenMatrix newCuts,
const AccpmVector subProblemIndex,
const AccpmVector upperFunctionValues 
) [protected, virtual]

Add the new cut information from the non-smooth Oracle f1. It is called by update1() function which takes care of transforming the cut information for a minimization problem. Update the internal structures of Manager corresponding to the new information. Returns number of filtered cuts.

References _activeCutNorm, _activeCuts, _activeCutsM, _b, _currentPointIsFeasible, _currentPointy, _cutOccurrence, _numCuts, _objectiveFunction, _param, _phase2, _rhsCoef, _subProblemIndex, AccpmLADotProd(), AccpmLANorm2(), Accpm::AccpmDynMatrix::addColumn(), addCut(), Accpm::AccpmVector::append(), convexityFix(), DBL_GT(), findCut(), Accpm::AccpmGenMatrix::getColumn(), Accpm::Parameters::getIntParameter(), Accpm::AccpmDynMatrix::getM(), Accpm::Parameters::getPi(), and updateRhs().

Referenced by update1().

void Accpm::Manager::setExitCode ( ExitCode  e) [inline]

References _exitCode.

Referenced by Accpm::QpGenerator::run().

void Accpm::Manager::setSizeOfs ( int  n) [inline]

References _sizeOfs.

void Accpm::Manager::update ( ) [protected, virtual]

Update the internal data of Manager:

Rho Phase2 flag Upper Bound on Objective Function Best Point Relative Gap Weight on the Epigraph Cut

References _bestPointy, _currentPointIsFeasible, _currentPointy, _objectiveFunction, _objUB, _param, _phase2, DBL_GT(), Accpm::Parameters::getIntParameter(), updateEpigraphWeight(), updateRelativeGap(), and updateRho().

Referenced by update1(), and update2().

int Accpm::Manager::update1 ( const AccpmVector functionValue,
const AccpmGenMatrix subGradients,
const AccpmGenMatrix subProblemIndex,
const AccpmVector upperFunctionValues = 0 
) [virtual]
void Accpm::Manager::updateInnerIterations ( int  n) [inline]

References _numInnerIteration.

References _phase2, and _prevPhase2.

Referenced by Accpm::QpGenerator::run().

void Accpm::Manager::updateRho ( void  ) [protected, virtual]
void Accpm::Manager::updateRhs ( const AccpmVector functionValue,
const AccpmGenMatrix subGradients 
) [protected, virtual]

Update the right hand side corresponding to the new cuts just returned by the Oracle

References _currentPointy, _rhsCoef, AccpmLAMatTransVecMult(), and Accpm::AccpmVector::append().

Referenced by processCuts().

void Accpm::Manager::updateY ( const AccpmVector y) [virtual]

References _currentPointy.

Referenced by updateVariables().


Member Data Documentation

Referenced by addCut(), and init().

Referenced by addCut(), findCut(), and ~Manager().

The total number of inner iterations done so far. The inner iterations refer to the number of steps taken to solve the Newton system of equations. Typically this number is 2-3 per outer iteration.

Referenced by getNumInnerIterations(), init(), output(), and updateInnerIterations().

The main iteration counter for the query point generator. At each of the outer iteration the Oracle::eval() is called.

Referenced by getNumOuterIteration(), init(), and update1().

double Accpm::Manager::_rho [protected]

Referenced by check(), getRho(), init(), updateQ(), and updateRho().

int Accpm::Manager::_sizeOfs [protected]

Referenced by getSizeOfs(), init(), and setSizeOfs().


The documentation for this class was generated from the following files: