SG++-Doxygen-Documentation
sgpp::optimization::optimizer::LogBarrier Class Reference

Log Barrier method for constrained optimization. More...

#include <LogBarrier.hpp>

Inheritance diagram for sgpp::optimization::optimizer::LogBarrier:
sgpp::optimization::optimizer::ConstrainedOptimizer sgpp::optimization::optimizer::UnconstrainedOptimizer

Public Member Functions

void clone (std::unique_ptr< UnconstrainedOptimizer > &clone) const override
 
double getBarrierDecreaseFactor () const
 
double getBarrierStartValue () const
 
const std::vector< size_t > & getHistoryOfInnerIterationNumbers () const
 
const base::DataMatrixgetHistoryOfInnerIterationPoints () const
 
VectorFunctionGradientgetInequalityConstraintGradient () const
 
ScalarFunctionGradientgetObjectiveGradient () const
 
double getTolerance () const
 
 LogBarrier (const ScalarFunction &f, const ScalarFunctionGradient &fGradient, const VectorFunction &g, const VectorFunctionGradient &gGradient, size_t maxItCount=DEFAULT_N, double tolerance=DEFAULT_TOLERANCE, double barrierStartValue=DEFAULT_BARRIER_START_VALUE, double barrierDecreaseFactor=DEFAULT_BARRIER_DECREASE_FACTOR)
 Constructor. More...
 
 LogBarrier (const LogBarrier &other)
 Copy constructor. More...
 
void optimize () override
 Pure virtual method for optimization of the objective function. More...
 
void setBarrierDecreaseFactor (double barrierDecreaseFactor)
 
void setBarrierStartValue (double barrierStartValue)
 
void setTolerance (double tolerance)
 
 ~LogBarrier () override
 Destructor. More...
 
- Public Member Functions inherited from sgpp::optimization::optimizer::ConstrainedOptimizer
 ConstrainedOptimizer (const ScalarFunction &f, const VectorFunction &g, const VectorFunction &h, size_t N=DEFAULT_N)
 Constructor. More...
 
 ConstrainedOptimizer (const ConstrainedOptimizer &other)
 Copy constructor. More...
 
VectorFunctiongetEqualityConstraintFunction () const
 
VectorFunctiongetInequalityConstraintFunction () const
 
 ~ConstrainedOptimizer () override
 Destructor. More...
 
- Public Member Functions inherited from sgpp::optimization::optimizer::UnconstrainedOptimizer
const base::DataMatrixgetHistoryOfOptimalPoints () const
 
const base::DataVectorgetHistoryOfOptimalValues () const
 
size_t getN () const
 
ScalarFunctiongetObjectiveFunction () const
 
const base::DataVectorgetOptimalPoint () const
 
double getOptimalValue () const
 
const base::DataVectorgetStartingPoint () const
 
void setN (size_t N)
 
void setStartingPoint (const base::DataVector &startingPoint)
 
 UnconstrainedOptimizer (const ScalarFunction &f, size_t N=DEFAULT_N)
 Constructor. More...
 
 UnconstrainedOptimizer (const UnconstrainedOptimizer &other)
 Copy constructor. More...
 
virtual ~UnconstrainedOptimizer ()
 Destructor. More...
 

Static Public Attributes

static constexpr double DEFAULT_BARRIER_DECREASE_FACTOR = 0.5
 default barrier decrease factor More...
 
static constexpr double DEFAULT_BARRIER_START_VALUE = 1.0
 default barrier start value More...
 
static constexpr double DEFAULT_TOLERANCE = 1e-6
 default tolerance More...
 
- Static Public Attributes inherited from sgpp::optimization::optimizer::UnconstrainedOptimizer
static const size_t DEFAULT_N = 1000
 default maximal number of iterations or function evaluations More...
 

Protected Attributes

std::unique_ptr< ScalarFunctionGradientfGradient
 objective function gradient More...
 
std::unique_ptr< VectorFunctionGradientgGradient
 inequality constraint function gradient More...
 
std::vector< size_t > kHistInner
 search history (number of inner iterations) More...
 
double mu0
 barrier start value More...
 
double rhoMuMinus
 barrier decrease factor More...
 
double theta
 tolerance More...
 
base::DataMatrix xHistInner
 search history (inner iterations) More...
 
- Protected Attributes inherited from sgpp::optimization::optimizer::ConstrainedOptimizer
std::unique_ptr< VectorFunctiong
 inequality constraint function More...
 
std::unique_ptr< VectorFunctionh
 equality constraint function More...
 
- Protected Attributes inherited from sgpp::optimization::optimizer::UnconstrainedOptimizer
std::unique_ptr< ScalarFunctionf
 objective function More...
 
base::DataVector fHist
 search history vector (optimal values) More...
 
double fOpt
 result of optimization (optimal function value) More...
 
size_t N
 maximal number of iterations or function evaluations More...
 
base::DataVector x0
 starting point More...
 
base::DataMatrix xHist
 search history matrix (optimal points) More...
 
base::DataVector xOpt
 result of optimization (location of optimum) More...
 

Detailed Description

Log Barrier method for constrained optimization.

Constructor & Destructor Documentation

◆ LogBarrier() [1/2]

sgpp::optimization::optimizer::LogBarrier::LogBarrier ( const ScalarFunction f,
const ScalarFunctionGradient fGradient,
const VectorFunction g,
const VectorFunctionGradient gGradient,
size_t  maxItCount = DEFAULT_N,
double  tolerance = DEFAULT_TOLERANCE,
double  barrierStartValue = DEFAULT_BARRIER_START_VALUE,
double  barrierDecreaseFactor = DEFAULT_BARRIER_DECREASE_FACTOR 
)

Constructor.

Parameters
fobjective function
fGradientobjective function gradient
ginequality constraint
gGradientinequality constraint gradient
maxItCountmaximal number of function evaluations
tolerancetolerance
barrierStartValuebarrier start value
barrierDecreaseFactorbarrier decrease factor

References sgpp::optimization::ScalarFunctionGradient::clone(), and sgpp::optimization::VectorFunctionGradient::clone().

Referenced by clone().

◆ LogBarrier() [2/2]

sgpp::optimization::optimizer::LogBarrier::LogBarrier ( const LogBarrier other)

Copy constructor.

Parameters
otheroptimizer to be copied

References fGradient, and gGradient.

◆ ~LogBarrier()

sgpp::optimization::optimizer::LogBarrier::~LogBarrier ( )
override

Destructor.

Member Function Documentation

◆ clone()

void sgpp::optimization::optimizer::LogBarrier::clone ( std::unique_ptr< UnconstrainedOptimizer > &  clone) const
overridevirtual
Parameters
[out]clonepointer to cloned object

Implements sgpp::optimization::optimizer::UnconstrainedOptimizer.

References LogBarrier().

◆ getBarrierDecreaseFactor()

double sgpp::optimization::optimizer::LogBarrier::getBarrierDecreaseFactor ( ) const
Returns
barrier decrease factor

References rhoMuMinus.

◆ getBarrierStartValue()

double sgpp::optimization::optimizer::LogBarrier::getBarrierStartValue ( ) const
Returns
barrier start value

References mu0.

◆ getHistoryOfInnerIterationNumbers()

const std::vector< size_t > & sgpp::optimization::optimizer::LogBarrier::getHistoryOfInnerIterationNumbers ( ) const
Returns
vector in which the k-th entry indicates the number of inner iterations in the k-th (outer) iteration, empty vector on error

References kHistInner.

◆ getHistoryOfInnerIterationPoints()

const base::DataMatrix & sgpp::optimization::optimizer::LogBarrier::getHistoryOfInnerIterationPoints ( ) const
Returns
tall matrix (d columns) in which the history of optimal points of the iterations are concatenated

References xHistInner.

◆ getInequalityConstraintGradient()

VectorFunctionGradient & sgpp::optimization::optimizer::LogBarrier::getInequalityConstraintGradient ( ) const
Returns
inequality constraint function gradient

References gGradient.

◆ getObjectiveGradient()

ScalarFunctionGradient & sgpp::optimization::optimizer::LogBarrier::getObjectiveGradient ( ) const
Returns
objective function gradient

References fGradient.

◆ getTolerance()

double sgpp::optimization::optimizer::LogBarrier::getTolerance ( ) const
Returns
tolerance

References theta.

◆ optimize()

void sgpp::optimization::optimizer::LogBarrier::optimize ( )
overridevirtual

Pure virtual method for optimization of the objective function.

The result of the optimization process can be obtained by member functions, e.g., getOptimalPoint() and getOptimalValue().

Implements sgpp::optimization::optimizer::UnconstrainedOptimizer.

References sgpp::base::DataVector::append(), sgpp::base::DataMatrix::appendRow(), sgpp::optimization::optimizer::UnconstrainedOptimizer::f, fGradient, sgpp::optimization::optimizer::UnconstrainedOptimizer::fHist, sgpp::optimization::optimizer::UnconstrainedOptimizer::fOpt, sgpp::optimization::optimizer::ConstrainedOptimizer::g, sgpp::optimization::optimizer::UnconstrainedOptimizer::getHistoryOfOptimalPoints(), sgpp::optimization::Printer::getInstance(), sgpp::base::DataMatrix::getNrows(), sgpp::optimization::optimizer::UnconstrainedOptimizer::getOptimalPoint(), gGradient, python.statsfileInfo::i, kHistInner, sgpp::base::DataVector::l2Norm(), mu, mu0, sgpp::optimization::optimizer::UnconstrainedOptimizer::N, sgpp::optimization::optimizer::AdaptiveGradientDescent::optimize(), sgpp::optimization::Printer::printStatusBegin(), sgpp::optimization::Printer::printStatusEnd(), sgpp::optimization::Printer::printStatusUpdate(), sgpp::base::DataMatrix::resize(), rhoMuMinus, sgpp::optimization::optimizer::UnconstrainedOptimizer::setStartingPoint(), sgpp::base::DataVector::sub(), theta, sgpp::base::DataVector::toString(), sgpp::optimization::optimizer::UnconstrainedOptimizer::x0, sgpp::optimization::optimizer::UnconstrainedOptimizer::xHist, xHistInner, and sgpp::optimization::optimizer::UnconstrainedOptimizer::xOpt.

◆ setBarrierDecreaseFactor()

void sgpp::optimization::optimizer::LogBarrier::setBarrierDecreaseFactor ( double  barrierDecreaseFactor)
Parameters
barrierDecreaseFactorbarrier decrease factor

References rhoMuMinus.

◆ setBarrierStartValue()

void sgpp::optimization::optimizer::LogBarrier::setBarrierStartValue ( double  barrierStartValue)
Parameters
barrierStartValuebarrier start value

References mu0.

◆ setTolerance()

void sgpp::optimization::optimizer::LogBarrier::setTolerance ( double  tolerance)
Parameters
tolerancetolerance

References theta.

Member Data Documentation

◆ DEFAULT_BARRIER_DECREASE_FACTOR

constexpr double sgpp::optimization::optimizer::LogBarrier::DEFAULT_BARRIER_DECREASE_FACTOR = 0.5
static

default barrier decrease factor

◆ DEFAULT_BARRIER_START_VALUE

constexpr double sgpp::optimization::optimizer::LogBarrier::DEFAULT_BARRIER_START_VALUE = 1.0
static

default barrier start value

◆ DEFAULT_TOLERANCE

constexpr double sgpp::optimization::optimizer::LogBarrier::DEFAULT_TOLERANCE = 1e-6
static

default tolerance

◆ fGradient

std::unique_ptr<ScalarFunctionGradient> sgpp::optimization::optimizer::LogBarrier::fGradient
protected

objective function gradient

Referenced by getObjectiveGradient(), LogBarrier(), and optimize().

◆ gGradient

std::unique_ptr<VectorFunctionGradient> sgpp::optimization::optimizer::LogBarrier::gGradient
protected

inequality constraint function gradient

Referenced by getInequalityConstraintGradient(), LogBarrier(), and optimize().

◆ kHistInner

std::vector<size_t> sgpp::optimization::optimizer::LogBarrier::kHistInner
protected

search history (number of inner iterations)

Referenced by getHistoryOfInnerIterationNumbers(), and optimize().

◆ mu0

double sgpp::optimization::optimizer::LogBarrier::mu0
protected

barrier start value

Referenced by getBarrierStartValue(), optimize(), and setBarrierStartValue().

◆ rhoMuMinus

double sgpp::optimization::optimizer::LogBarrier::rhoMuMinus
protected

barrier decrease factor

Referenced by getBarrierDecreaseFactor(), optimize(), and setBarrierDecreaseFactor().

◆ theta

double sgpp::optimization::optimizer::LogBarrier::theta
protected

tolerance

Referenced by getTolerance(), optimize(), and setTolerance().

◆ xHistInner

base::DataMatrix sgpp::optimization::optimizer::LogBarrier::xHistInner
protected

search history (inner iterations)

Referenced by getHistoryOfInnerIterationPoints(), and optimize().


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