OBOE 0.1
|
#include <Parameters.h>
Public Member Functions | |
Parameters () | |
Parameters (const char *fileName) | |
virtual | ~Parameters () |
bool | setIntParameter (const char *name, int value) |
int | getIntParameter (const char *name) const |
bool | setRealParameter (const char *name, Real value) |
Real | getRealParameter (const char *name) const |
bool | setStringParameter (const char *name, const string &value) |
const string | getStringParameter (const char *name) const |
bool | setOptimizationType (const string &value) |
const string & | getOptimizationType (void) const |
const OptType | getOptType (void) const |
bool | setStartingPoint (const StdRealVector &v) |
bool | setVariableLB (const StdRealVector &v) |
bool | setVariableUB (const StdRealVector &v) |
bool | setPi (const StdRealVector &pi) |
bool | setB (const StdRealVector &v) |
bool | setB (const AccpmVector &v) |
bool | setCenterBall (const StdRealVector &v) |
const AccpmVector * | getStartingPoint () const |
const AccpmVector * | getVariableLB () const |
const AccpmVector * | getVariableUB () const |
const AccpmVector * | getPi () const |
const AccpmVector * | getB () const |
const AccpmVector * | getCenterBall () const |
bool | setOracle (Oracle *oracle) |
const Oracle * | getOracle (void) const |
bool | setActiveVariableIndex (const StdIntSet &v) |
const StdIntSet * | getActiveVariableIndex () const |
bool | hasVariableDimension () const |
void | addEqualityConstraints (const AccpmGenMatrix &constraints, const AccpmVector &rhs) |
void | removeEqualityConstraints () |
bool | hasEqualityConstraints () const |
void | getEqualityConstraints (AccpmGenMatrix *&constraints, AccpmVector *&rhs) const |
void | output (std::ostream &os) const |
Friends | |
std::ostream & | operator<< (std::ostream &, const Parameters &P) |
Manages the parameters used for tuning OBOE. It can read the parameters from a file with a specified format or can be used to set the individual parameters.
Accpm::Parameters::Parameters | ( | ) |
Accpm::Parameters::Parameters | ( | const char * | fileName | ) |
References AccpmError(), and AccpmWarning().
Accpm::Parameters::~Parameters | ( | ) | [virtual] |
References removeEqualityConstraints().
void Accpm::Parameters::addEqualityConstraints | ( | const AccpmGenMatrix & | constraints, |
const AccpmVector & | rhs | ||
) |
Add Equality constraints (D^t)*y = d The constraints matrix represents D and should have dimension number of variables(n) * number of constraints. The vector rhs is the vector with dimension number of constraints and represents the vector d, right hand side of the constraint.
References Accpm::AccpmVector::append(), Accpm::AccpmGenMatrix::assignColumn(), and Accpm::AccpmGenMatrix::getColumn().
const StdIntSet * Accpm::Parameters::getActiveVariableIndex | ( | ) | const |
Get the vector of indices of variables which are active.
const AccpmVector* Accpm::Parameters::getB | ( | ) | const [inline] |
Referenced by Accpm::Manager::getB(), and Accpm::QpGenerator::printIteration().
const AccpmVector* Accpm::Parameters::getCenterBall | ( | ) | const [inline] |
Referenced by Accpm::Manager::getCenterBall().
void Accpm::Parameters::getEqualityConstraints | ( | AccpmGenMatrix *& | constraints, |
AccpmVector *& | rhs | ||
) | const |
int Accpm::Parameters::getIntParameter | ( | const char * | name | ) | const |
Referenced by Accpm::Manager::addCut(), Accpm::Manager::check(), Accpm::LocSet::checkFeasibility(), Accpm::Manager::computeBallConstraint(), Accpm::Manager::convexityFix(), Accpm::DualMethod::DualMethod(), Accpm::Manager::init(), Accpm::LocSet::LocSet(), main(), Accpm::QpGenerator::output(), Accpm::Manager::output(), Accpm::QpGenerator::printHeader(), Accpm::QpGenerator::printIteration(), Accpm::Manager::processCuts(), Accpm::QpGenerator::run(), Accpm::Manager::update(), Accpm::Manager::update2(), Accpm::Manager::updateLB(), Accpm::Manager::updateQ(), and Accpm::Manager::updateRho().
const string & Accpm::Parameters::getOptimizationType | ( | void | ) | const |
Referenced by output(), and Accpm::Manager::output().
const OptType Accpm::Parameters::getOptType | ( | void | ) | const [inline] |
Referenced by Accpm::Manager::callSmoothOracle(), Accpm::Manager::convexityFix(), Accpm::QpGenerator::getObjLB(), Accpm::QpGenerator::getObjUB(), Accpm::QpGenerator::getOptimalObj(), Accpm::Manager::init(), Accpm::Manager::output(), Accpm::QpGenerator::run(), Accpm::Manager::update1(), and Accpm::Manager::update2().
const Oracle * Accpm::Parameters::getOracle | ( | void | ) | const |
Referenced by Accpm::Manager::callSmoothOracle(), Accpm::Manager::Manager(), and Accpm::QpGenerator::run().
const AccpmVector* Accpm::Parameters::getPi | ( | ) | const [inline] |
Real Accpm::Parameters::getRealParameter | ( | const char * | name | ) | const |
Referenced by Accpm::Manager::convexityFix(), Accpm::Manager::getRadiusBall(), Accpm::Manager::init(), Accpm::LocSet::LocSet(), Accpm::Manager::Manager(), Accpm::PointGen::PointGen(), Accpm::Manager::updateEpigraphWeight(), Accpm::Manager::updateLB(), Accpm::Manager::updateRelativeGap(), and Accpm::Manager::updateRho().
const AccpmVector* Accpm::Parameters::getStartingPoint | ( | ) | const [inline] |
Referenced by Accpm::Manager::Manager().
const string Accpm::Parameters::getStringParameter | ( | const char * | name | ) | const |
Referenced by Accpm::QpGenerator::init().
const AccpmVector* Accpm::Parameters::getVariableLB | ( | ) | const [inline] |
Referenced by Accpm::Manager::getVariableLB().
const AccpmVector* Accpm::Parameters::getVariableUB | ( | ) | const [inline] |
Referenced by Accpm::Manager::getVariableUB().
bool Accpm::Parameters::hasEqualityConstraints | ( | ) | const |
Whether the problem has Equality Constraints of the type (D^t)*y = d
bool Accpm::Parameters::hasVariableDimension | ( | ) | const |
Is the Active Set strategy supported.
void Accpm::Parameters::output | ( | std::ostream & | os | ) | const |
References getOptimizationType().
Referenced by Accpm::operator<<().
void Accpm::Parameters::removeEqualityConstraints | ( | ) |
Remove the constraints (D^t)*y = d if they exist
Referenced by ~Parameters().
bool Accpm::Parameters::setActiveVariableIndex | ( | const StdIntSet & | v | ) |
Set the variables whose indices are specified in the set v to be active, all the other variables are considered to be put to 0 and hence de-activated.
Set the vector of indices of variables which are active.
References AccpmError().
bool Accpm::Parameters::setB | ( | const StdRealVector & | v | ) |
Set the linear component of the objective function. Note: The user can either specify the linear component or provide a smooth oracle, f2, but not both. If the smooth function f2 is completely linear then the user should use the setB() function and not write a smooth oracle.
References AccpmError(), and Accpm::AccpmVector::copy().
Referenced by main().
bool Accpm::Parameters::setB | ( | const AccpmVector & | v | ) |
Same as setB(const StdRealVector& v), with the difference that the linear component is specified as an AccpmVector instead of vector<double>.
References AccpmError().
bool Accpm::Parameters::setCenterBall | ( | const StdRealVector & | v | ) |
Set the center of the ball, yr, if there are ball constraints: |y - yr|^2 <= R^2 where R is specified by RadiusBall parameter.
References AccpmError(), and Accpm::AccpmVector::copy().
Referenced by setStartingPoint().
bool Accpm::Parameters::setIntParameter | ( | const char * | name, |
int | value | ||
) |
Referenced by main().
bool Accpm::Parameters::setOptimizationType | ( | const string & | value | ) |
References AccpmWarning(), Accpm::OPT_MAX, and Accpm::OPT_MIN.
Referenced by main().
bool Accpm::Parameters::setOracle | ( | Oracle * | oracle | ) |
Referenced by Accpm::QpGenerator::init().
bool Accpm::Parameters::setPi | ( | const StdRealVector & | pi | ) |
Set the vector of weights on the non-smooth function, f1. The vector pi should be the same size as the NumSubProblems.
References AccpmError(), and Accpm::AccpmVector::copy().
Referenced by main().
bool Accpm::Parameters::setStartingPoint | ( | const StdRealVector & | v | ) |
Set the starting point for the problem. This sets the first query point given to the Oracle::eval() function by OBOE. It is the user responsibility to ensure the starting point is feasible with respect to the variable bounds which are set by setVariableLB() and setVariableUB().
If no starting point is specified the starting point is set to 0 for all the variables.
References AccpmError(), Accpm::AccpmVector::copy(), and setCenterBall().
Referenced by main().
bool Accpm::Parameters::setStringParameter | ( | const char * | name, |
const string & | value | ||
) |
Referenced by main().
bool Accpm::Parameters::setVariableLB | ( | const StdRealVector & | v | ) |
Set the lower bound on the variables. Currently the user needs to specify the bound on all the variables if they choose to set the lower bound. Ofcourse the bound can be set ACCPM_MINUS_INF for variables with no lower bounds.
The default lower bound on all variables is ACCPM_MINUS_INF.
References AccpmError(), and Accpm::AccpmVector::copy().
bool Accpm::Parameters::setVariableUB | ( | const StdRealVector & | v | ) |
Set the upper bound on the variables. Currently the user needs to specify the bound on all the variables if they choose to set the upper bound. Ofcourse the bound can be set ACCPM_PLUS_INF for variables with no upper bounds.
The default lower bound on all variables is ACCPM_PLUS_INF.
References AccpmError(), and Accpm::AccpmVector::copy().
std::ostream& operator<< | ( | std::ostream & | os, |
const Parameters & | P | ||
) | [friend] |