#include <HCOD.hpp>
Public Member Functions | |
HCOD (Index sizeProblem, Index nbStage=0) | |
void | pushBackStage (const MatrixXd &J, const VectorBound &bounds) |
void | pushBackStage (const Index &nr, const double *Jdata, const Bound *bdata) |
void | pushBackStage (const Index &nr, const double *Jdata) |
void | pushBackStages (const std::vector< MatrixXd > &J, const std::vector< VectorBound > &bounds) |
Stage & | stage (Index i) |
const Stage & | stage (Index i) const |
Stage & | operator[] (Index i) |
const Stage & | operator[] (Index i) const |
void | setInitialActiveSet () |
void | setInitialActiveSet (const cstref_vector_t &Ir0, Index k) |
cstref_vector_t | getOptimalActiveSet (Index k) |
std::vector< cstref_vector_t > | getOptimalActiveSet () |
void | setInitialActiveSet (const std::vector< cstref_vector_t > &Ir) |
void | useDamp (bool c) |
bool | useDamp () const |
void | setDamping (const double &d) |
double | getMaxDamping () const |
Index | sizeA () const |
int | rank () const |
Index | nbStages () const |
void | reset (void) |
void | initialize (void) |
void | update (const Index &stageUp, const ConstraintRef &cst) |
void | update (stage_iter_t stageIter, const ConstraintRef &cst) |
void | downdate (const Index &stageDown, const Index &row) |
void | downdate (stage_iter_t stageIter, const Index &row) |
void | damp (void) |
void | computeSolution (bool compute_u=true) |
void | computeLagrangeMultipliers (const Index &stageRef) |
double | computeStepAndUpdate (void) |
double | computeStep (void) |
bool | searchAndDowndate (const Index &stageRef) |
bool | search (const Index &stageRef) |
void | makeStep (double tau, bool compute_u=true) |
void | makeStep (bool compute_u=true) |
void | activeSearch (VectorXd &u) |
void | show (std::ostream &os, bool check=false) |
void | showActiveSet (std::ostream &os) const |
bool | testRecomposition (std::ostream *os=NULL) |
bool | testSolution (std::ostream *os=NULL) |
bool | testLagrangeMultipliers (Index stageRef, std::ostream *os=NULL) const |
bool | testLagrangeMultipliers (Index stageRef, std::ostream &os) const |
void | setNameByOrder (const std::string root="") |
void | notifiorRegistration (const Stage::listener_function_t &f, int stageRank=-1) |
void | debugOnce (std::string filename="", bool keepOpen=false) |
Public Attributes | |
bool | isDebugOnce |
Index | sizeProblem |
soth::BaseY | Y |
stage_sequence_t | stages |
VectorXd | solution |
VectorXd | uNext |
VectorXd | Ytu |
VectorXd | YtuNext |
VectorXd | rho |
int | freezedStages |
bool | isReset |
bool | isInit |
bool | isSolutionCpt |
bool | withDamp |
Protected Types | |
typedef boost::shared_ptr< soth::Stage > | stage_ptr_t |
typedef std::vector< stage_ptr_t > | stage_sequence_t |
typedef stage_sequence_t::iterator | stage_iter_t |
typedef stage_sequence_t::const_iterator | stage_citer_t |
typedef stage_sequence_t::reverse_iterator | stage_riter_t |
typedef stage_sequence_t::size_type | stage_sequence_size_t |
typedef MatrixXd::Index | Index |
Protected Member Functions | |
void | updateY (const GivensSequence &Yup) |
HCOD (void) | |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
References pushBackStage(), and stages.
|
inlineprotected |
void soth::HCOD::activeSearch | ( | VectorXd & | u | ) |
References soth::BaseY::computeExplicitly(), computeLagrangeMultipliers(), computeSolution(), computeStepAndUpdate(), damp(), initialize(), makeStep(), soth::BaseY::matrixExplicit, nbStages(), searchAndDowndate(), show(), solution, sotDEBUG, sotDEBUG_ENABLE, soth::sotDEBUGFLOW, sotDEBUGIN, sotDEBUGOUT, stages, testRecomposition(), testSolution(), and Y.
void soth::HCOD::computeLagrangeMultipliers | ( | const Index & | stageRef | ) |
References computeSolution(), isSolutionCpt, rho, sotDEBUG, stages, and Ytu.
Referenced by activeSearch(), and updateY().
void soth::HCOD::computeSolution | ( | bool | compute_u = true | ) |
References damp(), isInit, isSolutionCpt, soth::BaseY::matrixExplicit, soth::BaseY::multiply(), solution, sotDEBUG, sotDEBUGIN, sotDEBUGOUT, stages, uNext, Y, Ytu, and YtuNext.
Referenced by activeSearch(), and computeLagrangeMultipliers().
double soth::HCOD::computeStep | ( | void | ) |
References isSolutionCpt, makeStep(), solution, sotDEBUG, stages, and uNext.
Referenced by computeStepAndUpdate().
double soth::HCOD::computeStepAndUpdate | ( | void | ) |
References computeStep(), isSolutionCpt, solution, sotDEBUG, stages, uNext, and update().
Referenced by activeSearch(), and damp().
void soth::HCOD::damp | ( | void | ) |
References computeStepAndUpdate(), isInit, sotDEBUG, stages, and useDamp().
Referenced by activeSearch(), and computeSolution().
void soth::HCOD::debugOnce | ( | std::string | filename = "" , |
bool | keepOpen = false |
||
) |
References isDebugOnce, soth::sotDebugTrace::openFile(), and sotDEBUG.
Referenced by search().
References isInit, stages, and updateY().
Referenced by searchAndDowndate(), and update().
void soth::HCOD::downdate | ( | stage_iter_t | stageIter, |
const Index & | row | ||
) |
cstref_vector_t soth::HCOD::getOptimalActiveSet | ( | Index | k | ) |
References getOptimalActiveSet(), soth::Stage::getOptimalActiveSet(), and stage().
std::vector< cstref_vector_t > soth::HCOD::getOptimalActiveSet | ( | ) |
References setInitialActiveSet(), and stages.
Referenced by getOptimalActiveSet(), and setInitialActiveSet().
void soth::HCOD::initialize | ( | void | ) |
References isInit, isReset, soth::BaseY::matrixExplicit, reset(), sotDEBUG, stages, update(), and Y.
Referenced by activeSearch(), and reset().
void soth::HCOD::makeStep | ( | double | tau, |
bool | compute_u = true |
||
) |
References solution, sotDEBUG, uNext, Ytu, and YtuNext.
Referenced by activeSearch(), and computeStep().
void soth::HCOD::makeStep | ( | bool | compute_u = true | ) |
|
inline |
Referenced by activeSearch().
void soth::HCOD::notifiorRegistration | ( | const Stage::listener_function_t & | f, |
int | stageRank = -1 |
||
) |
References stages.
Referenced by setNameByOrder().
void soth::HCOD::pushBackStage | ( | const MatrixXd & | J, |
const VectorBound & | bounds | ||
) |
References isInit, stages, and Y.
Referenced by HCOD(), pushBackStage(), and pushBackStages().
References isInit, pushBackStage(), sizeProblem, stages, and Y.
void soth::HCOD::pushBackStage | ( | const Index & | nr, |
const double * | Jdata | ||
) |
References isInit, pushBackStages(), sizeProblem, stages, and Y.
void soth::HCOD::pushBackStages | ( | const std::vector< MatrixXd > & | J, |
const std::vector< VectorBound > & | bounds | ||
) |
References pushBackStage(), and stage().
Referenced by pushBackStage().
int soth::HCOD::rank | ( | ) | const |
References stages.
void soth::HCOD::reset | ( | void | ) |
References initialize(), isInit, isReset, isSolutionCpt, soth::BaseY::reset(), solution, stages, Y, and Ytu.
Referenced by getMaxDamping(), and initialize().
bool soth::HCOD::search | ( | const Index & | stageRef | ) |
References debugOnce(), soth::Stage::EPSILON, solution, and stages.
Referenced by searchAndDowndate().
bool soth::HCOD::searchAndDowndate | ( | const Index & | stageRef | ) |
References downdate(), soth::Stage::EPSILON, search(), solution, and stages.
Referenced by activeSearch(), and makeStep().
void soth::HCOD::setInitialActiveSet | ( | ) |
References stages.
Referenced by getOptimalActiveSet(), setInitialActiveSet(), and stage().
void soth::HCOD::setInitialActiveSet | ( | const cstref_vector_t & | Ir0, |
Index | k | ||
) |
References getOptimalActiveSet(), soth::Stage::setInitialActiveSet(), sotDEBUG, and stage().
void soth::HCOD::setInitialActiveSet | ( | const std::vector< cstref_vector_t > & | Ir | ) |
References setInitialActiveSet(), sotDEBUGIN, sotDEBUGOUT, and stages.
void soth::HCOD::setNameByOrder | ( | const std::string | root = "" | ) |
References notifiorRegistration(), and stages.
void soth::HCOD::show | ( | std::ostream & | os, |
bool | check = false |
||
) |
References soth::BaseY::applyThisOnTheLeft(), soth::Stage::EPSILON, isSolutionCpt, soth::BaseY::matrixExplicit, showActiveSet(), sizeProblem, solution, sotDEBUGIN, sotDEBUGOUT, stages, uNext, Y, Ytu, and YtuNext.
Referenced by activeSearch(), and testLagrangeMultipliers().
void soth::HCOD::showActiveSet | ( | std::ostream & | os | ) | const |
References sotDEBUGIN, sotDEBUGOUT, and stages.
Referenced by show().
HCOD::Index soth::HCOD::sizeA | ( | ) | const |
References stages.
References stages.
Referenced by getOptimalActiveSet(), pushBackStages(), and setInitialActiveSet().
References setInitialActiveSet(), and stages.
bool soth::HCOD::testLagrangeMultipliers | ( | Index | stageRef, |
std::ostream * | os = NULL |
||
) | const |
References soth::Stage::damping(), soth::Stage::getLagrangeMultipliers(), soth::Stage::getSizeM(), soth::Stage::Jactive(), soth::BaseY::multiply(), show(), sizeProblem, solution, sotDEBUG, stages, soth::Stage::useDamp(), Y, and Ytu.
Referenced by testSolution().
|
inline |
bool soth::HCOD::testRecomposition | ( | std::ostream * | os = NULL | ) |
References sotDEBUGPRIOR, stages, and testSolution().
Referenced by activeSearch().
bool soth::HCOD::testSolution | ( | std::ostream * | os = NULL | ) |
References sotDEBUGPRIOR, stages, testLagrangeMultipliers(), and uNext.
Referenced by activeSearch(), and testRecomposition().
void soth::HCOD::update | ( | const Index & | stageUp, |
const ConstraintRef & | cst | ||
) |
References isInit, stages, and updateY().
Referenced by computeStepAndUpdate(), and initialize().
void soth::HCOD::update | ( | stage_iter_t | stageIter, |
const ConstraintRef & | cst | ||
) |
References downdate(), isInit, soth::BaseY::matrixExplicit, sotDEBUG, stages, updateY(), and Y.
|
protected |
References soth::GivensSequence::applyTransposeOnTheRight(), computeLagrangeMultipliers(), soth::BaseY::matrixExplicit, sotDEBUG, Y, Ytu, and YtuNext.
Referenced by downdate(), and update().
|
inline |
|
inline |
Referenced by damp(), downdate(), getMaxDamping(), and setDamping().
int soth::HCOD::freezedStages |
bool soth::HCOD::isDebugOnce |
Referenced by debugOnce().
bool soth::HCOD::isInit |
Referenced by computeSolution(), damp(), downdate(), initialize(), pushBackStage(), reset(), and update().
bool soth::HCOD::isReset |
Referenced by initialize(), and reset().
bool soth::HCOD::isSolutionCpt |
Referenced by computeLagrangeMultipliers(), computeSolution(), computeStep(), computeStepAndUpdate(), reset(), and show().
VectorXd soth::HCOD::rho |
Referenced by computeLagrangeMultipliers().
Index soth::HCOD::sizeProblem |
Referenced by pushBackStage(), show(), and testLagrangeMultipliers().
VectorXd soth::HCOD::solution |
Referenced by activeSearch(), computeSolution(), computeStep(), computeStepAndUpdate(), downdate(), makeStep(), reset(), search(), searchAndDowndate(), show(), and testLagrangeMultipliers().
stage_sequence_t soth::HCOD::stages |
Referenced by activeSearch(), computeLagrangeMultipliers(), computeSolution(), computeStep(), computeStepAndUpdate(), damp(), downdate(), getMaxDamping(), getOptimalActiveSet(), HCOD(), initialize(), notifiorRegistration(), pushBackStage(), rank(), reset(), search(), searchAndDowndate(), setDamping(), setInitialActiveSet(), setNameByOrder(), show(), showActiveSet(), sizeA(), stage(), testLagrangeMultipliers(), testRecomposition(), testSolution(), and update().
VectorXd soth::HCOD::uNext |
Referenced by computeSolution(), computeStep(), computeStepAndUpdate(), makeStep(), show(), and testSolution().
bool soth::HCOD::withDamp |
soth::BaseY soth::HCOD::Y |
Referenced by activeSearch(), computeSolution(), initialize(), pushBackStage(), reset(), show(), testLagrangeMultipliers(), update(), and updateY().
VectorXd soth::HCOD::Ytu |
Referenced by computeLagrangeMultipliers(), computeSolution(), makeStep(), reset(), show(), testLagrangeMultipliers(), and updateY().
VectorXd soth::HCOD::YtuNext |
Referenced by computeSolution(), makeStep(), show(), and updateY().